/* ============================================================
   Auth page  —  pages/auth/index.html
   Design tokens: see tokens.css
   ============================================================

   Layout:
     .auth                     — full-height centering shell
       .auth__card             — white form card
         .auth__brand          — logo + name at the top of card
         .auth__title
         .auth__error          — error banner (hidden by default)
         .auth__form
           .auth-field         — individual field wrapper
           .auth__submit       — full-width submit btn modifier
       .auth__footer           — links + copyright

   States on .auth:
     [data-state="idle"]     — default, inputs enabled
     [data-state="loading"]  — spinner shown, inputs disabled
     [data-state="error"]    — error banner visible, inputs highlighted
   ============================================================ */

/* ── Shell ─────────────────────────────────────────────────── */
.auth-body {
  background: var(--color-bg);
}

.auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 24px;
}

/* ── Brand (inside card) ────────────────────────────────────── */
.auth__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
}

.auth__brand--centered {
  justify-content: center;
}

.auth__logo {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.auth__brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.auth__brand-suffix {
  font-weight: 500;
  color: var(--color-text-muted);
}

/* ── Card ──────────────────────────────────────────────────── */
.auth__card {
  width: 100%;
  max-width: 400px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 32px 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Error banner ──────────────────────────────────────────── */
/* ── Error banner ──────────────────────────────────────────── */
.auth__error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-btn);
  font-size: 13px;
  color: #991B1B;
  line-height: 1.5;
}

.auth__error--hidden {
  display: none;
}

.auth__error-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #DC2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* ── Form ──────────────────────────────────────────────────── */
.auth__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Field ─────────────────────────────────────────────────── */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  cursor: default;
}

.auth-field__input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.auth-field__input::placeholder {
  color: var(--color-text-muted);
}

.auth-field__input:hover:not(:disabled) {
  border-color: #C0C8D4;
}

.auth-field__input:focus:not(:disabled) {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45, 91, 229, 0.15);
}

.auth-field__input:disabled {
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* Error state */
.auth-field__input--error {
  border-color: #EF4444;
}
.auth-field__input--error:focus {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ── Password wrapper (input + toggle) ─────────────────────── */
.auth-field__pwd-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field__input--pwd {
  padding-right: 42px;    /* room for toggle button */
}

.auth-field__pwd-toggle {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-icon);
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.auth-field__pwd-toggle:hover {
  color: var(--color-primary);
  background: var(--color-hover-bg);
}

.auth-field__pwd-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* ── Submit button modifier ────────────────────────────────── */
.auth__submit {
  width: 100%;
  margin-top: 4px;
}

/* ── Footer ────────────────────────────────────────────────── */
.auth__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.auth__footer-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.auth__footer-link {
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.auth__footer-link:hover {
  color: var(--color-primary);
}

.auth__footer-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.auth__footer-copy {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ============================================================
   Responsive — Tablet (640–1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .auth {
    padding: 32px 24px;
    gap: 20px;
  }

  .auth__card {
    max-width: 440px;
    padding: 28px 28px 32px;
  }
}

/* ============================================================
   Responsive — Mobile (< 640px)
   ============================================================ */
@media (max-width: 639px) {
  .auth {
    padding: 24px 16px;
    gap: 16px;
    justify-content: center;
  }

  .auth__card {
    max-width: 100%;
    padding: 24px 20px 28px;
  }
}







