/* ══════════════════════════════════════════════════════════════════
   auth.css — Login / Sign-up page styles
   Uses the same CSS custom properties as style.css.
   No existing selectors are overridden.
   ══════════════════════════════════════════════════════════════════ */

/* ── Auth page wrapper ───────────────────────────────────────────── */
#authPage {
  display: none;                 /* hidden by default; auth.js shows it */
  min-height: 100vh;
  background: var(--bg, #eceef3);
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: var(--font, 'Manrope', system-ui, sans-serif);
}

/* ── Centred shell ───────────────────────────────────────────────── */
.auth-shell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Card ────────────────────────────────────────────────────────── */
.auth-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e4e7ee);
  border-radius: 20px;
  padding: 40px 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg, 0 1px 3px rgba(20,23,31,.08), 0 26px 50px -24px rgba(20,23,31,.40));
}

/* ── Logo ────────────────────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 28px;
}

.auth-logo-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--accent, #3a55e6), var(--accent-strong, #2b40c4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  letter-spacing: -.04em;
  box-shadow: 0 6px 14px -6px var(--accent, #3a55e6);
  flex-shrink: 0;
}

.auth-logo-text {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--ink, #14171f);
}

.auth-logo-text small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2, #9aa0ad);
  margin-top: -1px;
}

/* ── Headings ────────────────────────────────────────────────────── */
.auth-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink, #14171f);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 14px;
  color: var(--muted, #787f8c);
  line-height: 1.5;
  margin-bottom: 26px;
}

/* ── Message banner ──────────────────────────────────────────────── */
.auth-message {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-xs, 8px);
  margin-bottom: 16px;
  line-height: 1.45;
}

.auth-message--error {
  background: var(--bad-soft, #fdeceb);
  color: var(--bad, #d3413a);
  border: 1px solid rgba(211, 65, 58, .2);
}

.auth-message--success {
  background: var(--good-soft, #e6f6ec);
  color: var(--good, #15924a);
  border: 1px solid rgba(21, 146, 74, .2);
}

/* ── Form fields ─────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #787f8c);
}

.auth-input {
  border: 1px solid var(--line-strong, #d2d7e1);
  border-radius: var(--radius-sm, 11px);
  padding: 11px 13px;
  font-size: 14px;
  background: var(--surface, #fff);
  color: var(--ink, #14171f);
  outline: none;
  transition: border .15s, box-shadow .15s;
  font-family: var(--font, 'Manrope', system-ui, sans-serif);
  width: 100%;
}

.auth-input:focus {
  border-color: var(--accent, #3a55e6);
  box-shadow: 0 0 0 3px var(--accent-soft, #eef0fe);
}

.auth-input::placeholder {
  color: var(--muted-2, #9aa0ad);
}

/* ── Primary submit button ───────────────────────────────────────── */
.auth-btn-primary {
  padding: 13px 20px;
  background: var(--accent, #3a55e6);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm, 11px);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font, 'Manrope', system-ui, sans-serif);
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 8px 18px -8px var(--accent, #3a55e6);
  width: 100%;
  margin-top: 4px;
}

.auth-btn-primary:hover {
  background: var(--accent-strong, #2b40c4);
}

.auth-btn-primary:active {
  transform: scale(.98);
}

.auth-btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* ── Divider ─────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-2, #9aa0ad);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line, #e4e7ee);
}

/* ── Google button ───────────────────────────────────────────────── */
.auth-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  background: var(--surface, #fff);
  color: var(--ink, #14171f);
  border: 1px solid var(--line-strong, #d2d7e1);
  border-radius: var(--radius-sm, 11px);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font, 'Manrope', system-ui, sans-serif);
  transition: background .15s, border-color .15s;
  width: 100%;
}

.auth-btn-google:hover:not(:disabled) {
  background: var(--surface-2, #f5f6f9);
  border-color: var(--muted-2, #9aa0ad);
}

.auth-btn-google:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ── Switch mode link ────────────────────────────────────────────── */
.auth-switch {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--muted, #787f8c);
}

.auth-link {
  background: none;
  border: none;
  color: var(--accent, #3a55e6);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-family: var(--font, 'Manrope', system-ui, sans-serif);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-link:hover {
  color: var(--accent-strong, #2b40c4);
}

/* ── Sidebar user/logout area ────────────────────────────────────── */
.nav-user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  margin: 0 10px 8px;
  border-radius: var(--radius-xs, 8px);
  background: var(--surface-2, #f5f6f9);
  border: 1px solid var(--line, #e4e7ee);
  min-width: 0;
}

.nav-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent, #3a55e6), var(--accent-strong, #2b40c4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.nav-user-email {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2, #3d434f);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.nav-logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted, #787f8c);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}

.nav-logout-btn:hover {
  color: var(--bad, #d3413a);
  background: var(--bad-soft, #fdeceb);
}

/* Hide user row and email text when sidebar is collapsed */
.app.nav-collapsed .nav-user-row {
  justify-content: center;
  padding: 8px;
  margin: 0 8px 6px;
}

.app.nav-collapsed .nav-user-email {
  display: none;
}

/* ── Forgot password components ──────────────────────────────────── */
.auth-forgot {
  text-align: center;
  margin-top: 16px;
}

.auth-forgot-back {
  margin-bottom: 22px;
}

.auth-forgot-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-soft, #eef0fe);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  #authPage {
    padding: 0;
  }

  .auth-shell {
    min-height: 100dvh;
    padding: 64px 16px 44px;
    align-items: center;
  }

  .auth-card {
    border-radius: 24px;
    padding: 30px 24px 28px;
    border: none;
    box-shadow: 0 1px 3px rgba(20,23,31,.08), 0 26px 50px -24px rgba(20,23,31,.40);
  }

  .auth-logo {
    margin-bottom: 20px;
  }

  .auth-logo-box {
    width: 42px;
    height: 42px;
  }

  .auth-title {
    font-size: 25px;
    letter-spacing: -.025em;
  }

  .auth-sub {
    font-size: 13px;
    margin-bottom: 0;
  }

  .auth-btn-google {
    height: 50px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(20,23,31,.06), 0 8px 16px -12px rgba(20,23,31,.40);
  }

  .auth-divider {
    margin: 20px 0;
    font-size: 11.5px;
  }

  .auth-form {
    gap: 0;
  }

  .auth-field + .auth-field {
    margin-top: 16px;
  }

  .auth-label {
    font-size: 11px;
  }

  .auth-input {
    height: 50px;
    background: var(--accent-soft, #eef0fe);
    border-color: transparent;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 500;
  }

  .auth-input:focus {
    background: var(--surface, #fff);
    border-color: var(--accent, #3a55e6);
  }

  .auth-btn-primary {
    height: 52px;
    border-radius: 12px;
    font-size: 15.5px;
    font-weight: 800;
    box-shadow: 0 12px 22px -10px var(--accent, #3a55e6);
    margin-top: 22px;
  }

  .auth-switch {
    margin-top: 18px;
    font-size: 13px;
  }

  .auth-forgot {
    margin-top: 16px;
  }
}