body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, #f6f7fb 0%, #eef2f7 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  color: #1f2937;
}

/* Design tokens */
:root {
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --text-900: #111827;
  --text-700: #374151;
  --muted-100: #f5f6fb;
  --muted-200: #eef2f7;
  --muted-300: #e5e7eb;
  --muted-400: #d1d5db;
  --shadow-strong: 0 12px 30px rgba(2, 6, 23, 0.12), 0 2px 6px rgba(2, 6, 23, 0.06);
  --ring-primary: 0 0 0 4px rgba(37, 99, 235, 0.15);
  --ring-neutral: 0 0 0 4px rgba(17, 24, 39, 0.08);
}

.logo-container {
  margin-top: 2rem;
  text-align: center;
}

.logo { height: 72px; opacity: 0.95; }
.logo:hover { opacity: 1; }

/* Remove old blue/solid header bar from public pages */
.header { display: none; }

.card {
  background: #ffffff;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-strong);
  max-width: 420px;
  width: 92%;
}

form {
  display: grid;
  gap: 1rem;
}

label { font-weight: 600; margin-bottom: 0.35rem; color: #374151; }

input {
  padding: 0.7rem 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 1rem;
  background: #fafafa;
  transition: border-color .2s, box-shadow .2s, background .2s;
  width: 100%;
  box-sizing: border-box;
}
input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #fff;
}

/* Input with trailing icon (e.g., password visibility) */
.input-with-icon { position: relative; width: 100%; }
.input-with-icon > input { width: 100%; padding-right: 2.5rem; }
.toggle-password {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
}
.toggle-password:focus-visible { box-shadow: var(--ring-primary); border-radius: 6px; }
.toggle-password svg { width: 18px; height: 18px; }
.toggle-password .icon-eye-off { display: none; }
.toggle-password.is-visible .icon-eye { display: none; }
.toggle-password.is-visible .icon-eye-off { display: inline; }

/* Accessibility helpers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 1px, 1px); white-space: nowrap; border: 0; }

/* Auth layout refinements */
.auth-title { margin-bottom: .5rem; text-align: center; }
.auth-subtitle { text-align: center; margin-bottom: 1.25rem; }
.form-stack { display: grid; gap: .9rem; }
.checkbox-row { display: flex; align-items: center; margin-top: .25rem; margin-bottom: .5rem; }
.checkbox-label { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; margin: 0; font-weight: 500; color: var(--text-900); }
.checkbox-label span { white-space: nowrap; font-weight: 500; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand-600); }
.btn-full { width: 100%; }
.helper-links { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: .5rem; flex-wrap: wrap; }
.helper-links .divider { color: #9ca3af; }
.text-center { text-align: center; }

/* Modern Buttons */
.btn, button.submit-btn {
  --btn-bg: var(--brand-600);
  --btn-bg-hover: var(--brand-700);
  --btn-border: transparent;
  --btn-color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid var(--btn-border);
  color: var(--btn-color);
  background: linear-gradient(180deg, var(--btn-bg), var(--btn-bg-hover));
  box-shadow: 0 4px 14px rgba(37,99,235,.25), 0 2px 6px rgba(37,99,235,.15);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover, button.submit-btn:hover { filter: brightness(1.02); box-shadow: 0 6px 18px rgba(37,99,235,.28), 0 3px 8px rgba(37,99,235,.18); }
.btn:active, button.submit-btn:active { transform: translateY(1px); filter: brightness(.98); }
.btn:focus-visible, button.submit-btn:focus-visible { outline: none; box-shadow: var(--ring-primary); }
.btn:disabled, button.submit-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Primary/Secondary variants */
.btn-primary, button.submit-btn { --btn-bg: var(--brand-600); --btn-bg-hover: var(--brand-700); --btn-color: #fff; --btn-border: transparent; }
.btn-secondary { --btn-bg: #f8fafc; --btn-bg-hover: #eef2f7; --btn-color: var(--text-900); --btn-border: var(--muted-300); background: linear-gradient(180deg, #ffffff, #f8fafc); box-shadow: 0 1px 3px rgba(2,6,23,0.06); }
.btn-secondary:hover { box-shadow: 0 2px 6px rgba(2,6,23,0.08); }
.btn-secondary:focus-visible { box-shadow: var(--ring-neutral); }

.btn-link { background: transparent; color: var(--brand-700); border: none; padding: 0; box-shadow: none; font-weight: 600; }
.btn-link:hover { text-decoration: underline; filter: none; box-shadow: none; }
.btn-link:focus-visible { box-shadow: var(--ring-primary); border-radius: 8px; }

/* Button sizes */
.btn-sm { padding: .55rem .75rem; border-radius: 10px; font-weight: 600; }
.btn-lg { padding: 1rem 1.25rem; border-radius: 14px; font-weight: 800; }

/* Modern refinements for login */
.btn-pill { border-radius: 9999px; }
.btn-with-icon { gap: .6rem; }
.btn-with-icon .icon { display: inline-flex; transition: transform .15s ease; }
.btn-with-icon:hover .icon { transform: translateX(4px); }

/* Ghost button for subtle secondary actions */
.btn-ghost { background: rgba(17,24,39,0.02); color: var(--text-900); border-color: rgba(17,24,39,0.06); }
.btn-ghost:hover { background: rgba(17,24,39,0.04); }

/* Elevated glow variant */
.btn-elevated { box-shadow: 0 8px 24px rgba(37,99,235,.28), 0 4px 10px rgba(37,99,235,.18); }
.btn-elevated:hover { box-shadow: 0 10px 28px rgba(37,99,235,.32), 0 6px 12px rgba(37,99,235,.2); }

/* Loading state */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 1em; height: 1em; border: 2px solid rgba(255,255,255,.7); border-top-color: transparent; border-radius: 50%; display: inline-block; animation: btnspin 1s linear infinite; }
@keyframes btnspin { to { transform: rotate(360deg); } }

/* Top bar */
.topbar { width: 100%; display: flex; justify-content: flex-end; padding: .75rem 1rem; }

.muted-text { color: #6b7280; font-size: .9rem; }
.success-text { color: #059669; }
.error-text { color: #dc2626; }

/* Motion accessibility */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
