/* ── Auth pages: login, signup, password reset, etc. ─────────── */
/* References global design tokens from ui-unified.css:
   --brand-ink, --surface, --surface-soft, --border-soft,
   --shadow-soft, --radius-lg
   Top clearance handled by #main-content > :first-child in nav-v2.css */

.auth-page {
  --auth-accent: #0b8f8b;
  --auth-accent-hover: #097a77;
  --auth-accent-faint: rgba(11, 143, 139, 0.15);
  --auth-muted: #6c7a8d;
  --auth-label: #3b4252;
  --auth-input-border: #d6dde8;
  --auth-danger: #c0392b;
  --auth-danger-hover: #a93226;

  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 60vh;
  padding-right: 1rem;
  padding-bottom: 4rem;
  padding-left: 1rem;
  background: radial-gradient(circle at top right, #fff9dc 0%, var(--surface) 38%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  margin-top: 4rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 2.4rem 2.2rem 2rem;
}

.auth-card--narrow {
  max-width: 380px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-ink);
  letter-spacing: -0.015em;
  margin: 0 0 0.25rem;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--auth-muted);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

/* ── Alert ─────────────────────────────────────────────────── */
.auth-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.2rem;
}

.auth-alert p {
  margin: 0;
}

.auth-alert--success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

/* ── Form fields ──────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.auth-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--auth-label);
}

.auth-input,
.auth-form .form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.92rem;
  color: var(--brand-ink);
  background: var(--surface-soft);
  border: 1px solid var(--auth-input-border);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.auth-input:focus,
.auth-form .form-control:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px var(--auth-accent-faint);
  background: var(--surface);
}

.auth-error {
  font-size: 0.78rem;
  color: var(--auth-danger);
}

/* ── Row helpers ──────────────────────────────────────────── */
.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--auth-label);
}

.auth-link {
  color: var(--auth-accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
}

/* ── Primary button ───────────────────────────────────────── */
.auth-btn {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--surface);
  background: var(--auth-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.auth-btn:hover {
  background: var(--auth-accent-hover);
}

.auth-btn--outline {
  background: transparent;
  color: var(--auth-accent);
  border: 1.5px solid var(--auth-accent);
}

.auth-btn--outline:hover {
  background: var(--auth-accent-faint);
}

.auth-btn--danger {
  background: var(--auth-danger);
}

.auth-btn--danger:hover {
  background: var(--auth-danger-hover);
}

.auth-btn--sm {
  width: auto;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  margin-top: 0;
}

/* ── Divider ──────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.2rem 0;
  color: #9aa5b4;
  font-size: 0.78rem;
  text-transform: lowercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

/* ── Social buttons ───────────────────────────────────────── */
.auth-social {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--auth-label);
  background: var(--surface-soft);
  border: 1px solid var(--auth-input-border);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.auth-social-btn:hover {
  border-color: var(--auth-accent);
  background: var(--surface);
  color: var(--brand-ink);
}

/* ── Footer text ──────────────────────────────────────────── */
.auth-footer-text {
  text-align: center;
  font-size: 0.82rem;
  color: var(--auth-muted);
  margin: 1.4rem 0 0;
}

.auth-footer-text a {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer-text a:hover {
  text-decoration: underline;
}

/* ── Settings page ────────────────────────────────────────── */
.settings-card {
  width: 100%;
  max-width: 560px;
  margin-top: 4rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 2.4rem 2.2rem 2rem;
}

.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-soft);
  margin-bottom: 1.6rem;
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--auth-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.settings-tab i {
  font-size: 0.78rem;
  opacity: 0.55;
}

.settings-tab:hover {
  color: var(--brand-ink);
}

.settings-tab:hover i {
  opacity: 0.8;
}

.settings-tab--active {
  color: var(--auth-accent);
  border-bottom-color: var(--auth-accent);
}

.settings-tab--active i {
  opacity: 1;
}

.settings-panel {
  display: none;
}

.settings-panel--active {
  display: block;
}

.settings-form {
  gap: 1.1rem;
}

/* ── Avatar block ───────────────────────────────────────── */
.settings-avatar-block {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.2rem;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  margin-bottom: 0.4rem;
}

.settings-avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 4px 12px rgba(20, 28, 58, 0.1);
  flex-shrink: 0;
}

.settings-avatar-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-avatar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.settings-avatar-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--auth-danger);
  cursor: pointer;
}

.settings-avatar-clear input {
  accent-color: var(--auth-danger);
}

.settings-avatar-hint {
  font-size: 0.74rem;
  color: var(--auth-muted);
}

/* ── Sections (Security tab) ────────────────────────────── */
.settings-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-section-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.settings-section-icon {
  font-size: 0.92rem;
  color: var(--auth-muted);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.settings-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-ink);
  margin: 0;
  line-height: 1.3;
}

.settings-section-desc {
  font-size: 0.8rem;
  color: var(--auth-muted);
  margin: 0.15rem 0 0;
  line-height: 1.4;
}

.settings-section--danger .settings-section-icon {
  color: var(--auth-danger);
}

.settings-section--danger .settings-section-title {
  color: var(--auth-danger);
}

/* ── Preferences toggles ────────────────────────────────── */
.settings-pref-intro {
  font-size: 0.86rem;
  color: var(--auth-muted);
  margin: 0 0 0.5rem;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.settings-toggle-row:hover {
  border-color: var(--auth-input-border);
  background: var(--surface);
}

.settings-toggle-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--brand-ink);
}

.settings-toggle-row .form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: var(--auth-accent);
}

.auth-hint {
  font-size: 0.76rem;
  color: var(--auth-muted);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card,
  .settings-card {
    padding: 1.6rem 1.2rem 1.4rem;
    border-radius: 14px;
  }

  .settings-tabs {
    gap: 0;
  }

  .settings-tab {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.4rem;
    font-size: 0.78rem;
  }

  .settings-tab i {
    display: none;
  }

  .settings-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-avatar-block {
    flex-direction: column;
    text-align: center;
    padding: 1.2rem 1rem;
  }

  .settings-avatar-info {
    align-items: center;
  }
}
