/**
 * base.css - global element styles, focus rings, scrollbars, base utility classes
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

html, body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 16px;
}

body {
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--text-primary); letter-spacing: -0.01em; }

/* Visible, consistent focus rings everywhere (accessibility requirement). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Thin, unobtrusive scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
*::-webkit-scrollbar-track { background: transparent; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-title { font-size: var(--fs-2xl); font-weight: 700; }
.page-subtitle { color: var(--text-secondary); font-size: var(--fs-md); margin-top: 4px; }
.page-error { padding: 48px; text-align: center; color: var(--text-secondary); }

.empty-inline { color: var(--text-muted); font-size: var(--fs-sm); padding: 12px 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.btn:active { transform: scale(0.97); }
.btn i, .btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-xs); }
.btn--primary:hover:not(:disabled) { background: var(--brand-700); box-shadow: var(--shadow-sm); }

.btn--secondary { background: var(--brand-50); color: var(--brand-700); }
.btn--secondary:hover:not(:disabled) { background: var(--brand-100); }

.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text-primary); }

.btn--danger { background: var(--danger-500); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #cf3338; }

.btn--google { background: #fff; color: var(--text-primary); border: 1px solid var(--border-strong); }
.btn--google:hover { background: var(--surface); }

.btn--block { width: 100%; }
.btn--sm { height: 32px; padding: 0 12px; font-size: var(--fs-xs); }

.btn--ghost.btn--danger, button.btn--ghost.btn--danger { color: var(--danger-500); }
.btn--ghost.btn--danger:hover:not(:disabled) { background: var(--danger-100); }

/* Forms */
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); }
.field-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-error { min-height: 16px; font-size: var(--fs-xs); color: var(--danger-500); }
.field-hint { font-size: var(--fs-xs); color: var(--text-muted); }

.text-input {
  height: 44px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0 14px;
  background: #fff;
  font-size: var(--fs-md);
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.text-input:focus { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }
.text-input--invalid { border-color: var(--danger-500); }

select {
  height: 40px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0 10px;
  background: #fff;
  font-size: var(--fs-sm);
}

/* Empty / error states shared across pages */
.empty-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
  gap: 8px;
}
.empty-state i, .error-state i { width: 40px; height: 40px; color: var(--text-muted); margin-bottom: 8px; }
.empty-state__hint { font-size: var(--fs-sm); color: var(--text-muted); }
