/* ═════════════════════════════════════════════════════════════════════
   Auth Pages Design System - Login, Register, Google Settings
   Dark & Light Theme Support with Professional Polish
   ═════════════════════════════════════════════════════════════════════ */

:root {
  /* Auth-specific theme colors — Apex Command Dark Mode (teal/orange) */
  --auth-bg-gradient-start: #06090f;
  --auth-bg-gradient-mid: #0c1220;
  --auth-bg-gradient-end: #111a2e;
  
  --auth-accent-primary: #3b82f6;     /* Electric Blue */
  --auth-accent-secondary: #8b5cf6;   /* Violet */
  --auth-card-bg: rgba(12, 18, 32, 0.85);
  --auth-card-border: rgba(59, 130, 246, 0.18);
  
  --auth-input-bg: rgba(8, 13, 24, 0.6);
  --auth-input-border: rgba(59, 130, 246, 0.20);
  --auth-input-border-focus: rgba(59,130,246, 0.55);
  --auth-input-text: #f8fafc;
  
  --auth-btn-primary-bg: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  --auth-btn-primary-text: #ffffff;
  --auth-btn-primary-shadow: rgba(59, 130, 246, 0.3);
  
  --auth-btn-secondary-bg: rgba(148, 163, 184, 0.08);
  --auth-btn-secondary-border: rgba(59, 130, 246, 0.2);
  --auth-btn-secondary-text: #cbd5e1;
  
  --auth-text-primary: #f1f5f9;
  --auth-text-secondary: #94a3b8;
  --auth-text-muted: #64748b;
  
  --auth-error-bg: rgba(220, 38, 38, 0.15);
  --auth-error-border: rgba(239, 68, 68, 0.4);
  --auth-error-text: #fca5a5;
  
  --auth-success-bg: rgba(34, 197, 94, 0.15);
  --auth-success-border: rgba(34, 197, 94, 0.4);
  --auth-success-text: #86efac;
  
  --auth-warning-bg: rgba(245, 158, 11, 0.15);
  --auth-warning-border: rgba(251, 191, 36, 0.4);
  --auth-warning-text: #fcd34d;
  
  --auth-info-bg: rgba(59, 130, 246, 0.15);
  --auth-info-border: rgba(96, 165, 250, 0.4);
  --auth-info-text: #93c5fd;
}

html[data-theme='light'] {
  /* Auth-specific theme colors — Apex Command Light Mode */
  --auth-bg-gradient-start: #f8fafc;
  --auth-bg-gradient-mid: #f1f5f9;
  --auth-bg-gradient-end: #e2e8f0;
  
  --auth-accent-primary: #2563eb;
  --auth-accent-secondary: #7c3aed;
  --auth-card-bg: #ffffff;
  --auth-card-border: rgba(15, 23, 42, 0.08);
  
  --auth-input-bg: #ffffff;
  --auth-input-border: rgba(15, 23, 42, 0.12);
  --auth-input-border-focus: rgba(37, 99, 235, 0.55);
  --auth-input-text: #0f172a;
  
  --auth-btn-primary-bg: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  --auth-btn-primary-text: #ffffff;
  --auth-btn-primary-shadow: rgba(37, 99, 235, 0.25);
  
  --auth-btn-secondary-bg: #ffffff;
  --auth-btn-secondary-border: rgba(15, 23, 42, 0.15);
  --auth-btn-secondary-text: #334155;
  
  --auth-text-primary: #0f172a;
  --auth-text-secondary: #475569;
  --auth-text-muted: #94a3b8;
  
  --auth-error-bg: rgba(220, 38, 38, 0.08);
  --auth-error-border: rgba(220, 38, 38, 0.3);
  --auth-error-text: #dc2626;
  
  --auth-success-bg: rgba(34, 197, 94, 0.08);
  --auth-success-border: rgba(34, 197, 94, 0.3);
  --auth-success-text: #15803d;
  
  --auth-warning-bg: rgba(245, 158, 11, 0.08);
  --auth-warning-border: rgba(245, 158, 11, 0.3);
  --auth-warning-text: #b45309;
  
  --auth-info-bg: rgba(59, 130, 246, 0.08);
  --auth-info-border: rgba(59, 130, 246, 0.3);
  --auth-info-text: #1e40af;
}

/* ─── Auth Page Background ────────────────────────────────────────── */
.auth-page-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 12%, var(--accent-blue-glow), transparent 42%),
    radial-gradient(circle at 90% 88%, var(--accent-violet-glow), transparent 44%),
    linear-gradient(140deg, var(--bg-primary), var(--bg-secondary));
  transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme='light'] .auth-page-container {
  background:
    radial-gradient(circle at 10% 12%, rgba(59, 130, 246, .12), transparent 42%),
    radial-gradient(circle at 90% 88%, rgba(139, 92, 246, .1), transparent 44%),
    linear-gradient(140deg, rgba(250, 253, 255, .95), rgba(241, 247, 255, .95));
}

.auth-grid-dots {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .24;
  background-image: linear-gradient(rgba(148, 163, 184, .24) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .24) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at center, black 36%, transparent 94%);
}

/* Logged-in settings screens need top anchoring under navbar */
.auth-settings-page {
  min-height: calc(100vh - 72px);
  align-items: flex-start;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

.auth-settings-shell {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.auth-settings-shell .auth-card {
  width: 100% !important;
  max-width: none !important;
}

.auth-card.auth-google-status-card {
  max-width: none;
  width: 100%;
}

.auth-google-status-card {
  max-width: none;
  width: 100%;
}

@media (min-width: 1024px) {
  .auth-settings-shell-google {
    max-width: 960px;
  }

  .auth-google-status-card {
    width: 100%;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ─── Google Settings Page ────────────────────────────────────────── */
.auth-google-settings-page {
  padding-top: 2.5rem;
}

.auth-google-shell {
  max-width: 960px;
  width: 100%;
}

.auth-google-header {
  margin-bottom: 2rem;
}

.auth-google-icon-container {
  background: linear-gradient(135deg, #ea4335 0%, #f97316 100%);
  box-shadow: 0 14px 36px rgba(234, 67, 53, 0.28);
}

.auth-google-status-card {
  margin-bottom: 1.5rem;
  border-color: rgba(234, 67, 53, 0.2);
}

.auth-google-card-accent {
  background: linear-gradient(90deg, #ea4335 0%, #f97316 100%);
}

.auth-google-linked-alert {
  margin-bottom: 1.25rem;
}

.auth-google-linked-message {
  margin-bottom: 0.75rem;
}

.auth-google-email-chip {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.4;
  background: var(--auth-success-bg);
  color: var(--auth-success-text);
  border: 1px solid var(--auth-success-border);
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  word-break: break-all;
}

.auth-google-actions {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.auth-google-action-form {
  display: block;
  width: 100%;
}

.auth-btn-danger-soft {
  background: var(--auth-error-bg);
  border: 1.5px solid var(--auth-error-border);
  color: var(--auth-error-text);
  box-shadow: none;
}

.auth-btn-danger-soft:hover {
  transform: translateY(-1px);
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(239, 68, 68, 0.55);
}

.auth-google-inline-info {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.auth-google-unlinked-card {
  width: 100%;
  background: color-mix(in oklab, var(--auth-card-bg) 85%, transparent);
  border: 1px solid var(--auth-card-border);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
}

.auth-google-unlinked-row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.auth-google-unlinked-icon {
  font-size: 1.75rem;
  color: var(--auth-text-muted);
  width: 1.75rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.auth-google-unlinked-content {
  flex: 1;
}

.auth-google-unlinked-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--auth-text-secondary);
  margin-bottom: 0.5rem;
}

.auth-google-unlinked-text {
  font-size: 0.95rem;
  color: var(--auth-text-muted);
  line-height: 1.6;
}

.auth-google-benefits {
  margin-top: 1.25rem;
}

.auth-google-benefits-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-text-secondary);
  margin-bottom: 0.75rem;
}

.auth-google-benefits-title-icon {
  color: var(--auth-success-text);
}

.auth-google-benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.auth-google-benefits-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--auth-text-muted);
}

.auth-google-benefits-item-icon {
  color: var(--auth-success-border);
  width: 1rem;
  flex-shrink: 0;
}

.auth-google-security-note {
  margin-bottom: 1.5rem;
  width: 100%;
}

.auth-google-back-wrap {
  border-top: 1px solid var(--auth-card-border);
  padding-top: 1.25rem;
  text-align: center;
}

.auth-google-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

html[data-theme='light'] .auth-google-status-card {
  border-color: rgba(234, 67, 53, 0.18);
}

html[data-theme='light'] .auth-google-unlinked-card {
  background: #f8fafc;
}

html[data-theme='light'] .auth-page-container {
  background: radial-gradient(ellipse at top, var(--auth-bg-gradient-start) 0%, var(--auth-bg-gradient-end) 100%);
}

/* Animated grid pattern background */
.auth-page-container::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: 
    radial-gradient(circle at 18% 12%, rgba(59,130,246, 0.22), transparent 44%),
    radial-gradient(circle at 86% 83%, rgba(139,92,246, 0.18), transparent 42%);
  animation: auth-bg-pulse 8s ease-in-out infinite;
  pointer-events: none;
}

html[data-theme='light'] .auth-page-container::before {
  background-image: 
    radial-gradient(circle at 18% 12%, rgba(15, 126, 122, 0.1), transparent 50%),
    radial-gradient(circle at 86% 83%, rgba(234, 88, 12, 0.07), transparent 48%);
}

@keyframes auth-bg-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}

/* Grid dots overlay */
.auth-grid-dots {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image: radial-gradient(rgba(148, 163, 184, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  animation: auth-grid-drift 20s linear infinite;
}

html[data-theme='light'] .auth-grid-dots {
  background-image: radial-gradient(rgba(30, 41, 59, 0.08) 1px, transparent 1px);
  opacity: 0.4;
}

@keyframes auth-grid-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(24px, 24px); }
}

/* ─── Auth Cards ───────────────────────────────────────────────────────── */
.auth-card {
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-card-border);
  border-radius: 16px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(20px);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme='light'] .auth-card {
  box-shadow: 
    0 20px 48px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(15, 23, 42, 0.04) inset;
  backdrop-filter: blur(10px);
}

.auth-card-accent-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--auth-accent-primary) 0%, var(--auth-accent-secondary) 50%, var(--auth-accent-primary) 100%);
}

.auth-card-body {
  padding: 2.5rem 2rem;
  width: 100%;
}

@media (min-width: 640px) {
  .auth-card-body {
    padding: 3rem 3.5rem;
    width: 100%;
  }
}

/* ─── Auth Header ──────────────────────────────────────────────────────── */
.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--auth-accent-primary) 0%, var(--auth-accent-secondary) 100%);
  box-shadow: 0 12px 32px var(--auth-btn-primary-shadow);
  margin-bottom: 1.5rem;
  animation: auth-icon-float 3s ease-in-out infinite;
}

@keyframes auth-icon-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.auth-icon-container i {
  font-size: 1.75rem;
  color: #ffffff;
}

.auth-heading {
  font-family: 'Rajdhani', 'Orbitron', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--auth-text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.auth-subheading {
  font-size: 1rem;
  color: var(--auth-text-secondary);
  font-weight: 500;
}

/* ─── Form Elements ─────────────────────────────────────────────────────── */
.auth-form-group {
  margin-bottom: 1.5rem;
}

.auth-form-label {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.auth-form-label i {
  margin-right: 0.5rem;
  color: var(--auth-accent-primary);
  font-size: 0.875rem;
}

.auth-form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--auth-input-bg);
  border: 1.5px solid var(--auth-input-border);
  border-radius: 10px;
  font-size: 1rem;
  color: var(--auth-input-text);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.auth-form-input::placeholder {
  color: var(--auth-text-muted);
  opacity: 0.7;
}

.auth-form-input:focus {
  outline: none;
  border-color: var(--auth-input-border-focus);
  background: var(--auth-input-bg);
  box-shadow: 
    0 0 0 3px rgba(59,130,246, 0.15),
    0 4px 12px rgba(59,130,246, 0.1);
}

html[data-theme='light'] .auth-form-input:focus {
  box-shadow: 
    0 0 0 3px rgba(15, 126, 122, 0.1),
    0 2px 8px rgba(15, 126, 122, 0.08);
}

.auth-form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-form-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
  line-height: 1.4;
}

.auth-form-error {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--auth-error-text);
  font-weight: 500;
}

.auth-form-error i {
  font-size: 0.75rem;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.auth-btn-primary {
  background: var(--auth-btn-primary-bg);
  color: var(--auth-btn-primary-text);
  box-shadow: 0 4px 16px var(--auth-btn-primary-shadow);
}

.auth-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--auth-btn-primary-shadow);
}

.auth-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px var(--auth-btn-primary-shadow);
}

.auth-btn-secondary {
  background: var(--auth-btn-secondary-bg);
  color: var(--auth-btn-secondary-text);
  border: 1.5px solid var(--auth-btn-secondary-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-btn-secondary:hover {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.4);
  transform: translateY(-1px);
}

html[data-theme='light'] .auth-btn-secondary:hover {
  background: rgba(241, 245, 249, 1);
}

.auth-btn-full {
  width: 100%;
}

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Google OAuth Button ───────────────────────────────────────────────── */
.auth-google-btn {
  position: relative;
  width: 100%;
  height: 52px;
  border-radius: 10px;
  border: 1.5px solid rgba(226, 232, 240, 0.15);
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme='light'] .auth-google-btn {
  border-color: rgba(0, 0, 0, 0.12);
}

.auth-google-btn-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-radius: 9px;
  transition: opacity 0.3s ease;
}

html[data-theme='light'] .auth-google-btn-bg {
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(249, 250, 251, 1) 100%);
}

.auth-google-btn-hover {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
  border-radius: 9px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-google-btn:hover .auth-google-btn-hover {
  opacity: 1;
}

.auth-google-btn:hover {
  border-color: rgba(66, 133, 244, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(66, 133, 244, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

html[data-theme='light'] .auth-google-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(66, 133, 244, 0.1) inset;
}

.auth-google-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
}

.auth-google-btn-content {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 100%;
}

.auth-google-btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.auth-google-btn-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff; /* White text for dark theme */
}

html[data-theme='light'] .auth-google-btn-text {
  color: #1f2937; /* Dark text for light theme */
}

/* ─── Alert Messages ────────────────────────────────────────────────────── */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  width: 100%;
  animation: auth-alert-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes auth-alert-slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-alert-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.auth-alert-content {
  flex: 1;
}

.auth-alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.auth-alert-message {
  opacity: 0.9;
  font-size: 0.8125rem;
}

.auth-alert-error {
  background: var(--auth-error-bg);
  border: 1px solid var(--auth-error-border);
  color: var(--auth-error-text);
}

.auth-alert-success {
  background: var(--auth-success-bg);
  border: 1px solid var(--auth-success-border);
  color: var(--auth-success-text);
}

.auth-alert-warning {
  background: var(--auth-warning-bg);
  border: 1px solid var(--auth-warning-border);
  color: var(--auth-warning-text);
}

.auth-alert-info {
  background: var(--auth-info-bg);
  border: 1px solid var(--auth-info-border);
  color: var(--auth-info-text);
}

/* ─── Divider ───────────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--auth-card-border);
}

.auth-divider-text {
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
  font-weight: 500;
  padding: 0 0.25rem;
}

/* ─── Password Toggle ───────────────────────────────────────────────────── */
.auth-password-toggle {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--auth-text-muted);
  cursor: pointer;
  padding: 0.375rem;
  transition: color 0.2s;
}

.auth-password-toggle:hover {
  color: var(--auth-accent-primary);
}

.auth-password-toggle:focus {
  outline: 2px solid var(--auth-accent-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Link Styles ───────────────────────────────────────────────────────── */
.auth-link {
  color: var(--auth-accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s, text-decoration 0.2s;
}

.auth-link:hover {
  color: var(--auth-accent-secondary);
  text-decoration: underline;
}

/* ─── ALTCHA Widget Container ────────────────────────────────────────── */
.altcha-widget-container {
  /* Positioned via JavaScript above submit button */
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  border-radius: 12px;
}

.altcha-widget-container altcha-widget {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* Ensure inline ALTCHA widget is properly centered on auth pages */
form .altcha-widget-container {
  text-align: center;
}

/* Mobile responsiveness for ALTCHA widget */
@media (max-width: 640px) {
  .altcha-widget-container altcha-widget {
    max-width: 100%;
  }
}

.auth-link:focus {
  outline: 2px solid var(--auth-accent-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── Mobile Responsiveness ────────────────────────────────────────── */
@media (max-width: 640px) {
  .auth-page-container {
    padding: 1.5rem 1rem;
  }

  .auth-settings-page {
    min-height: calc(100vh - 64px);
    padding-top: 1rem;
    padding-bottom: 1.5rem;
  }

  .auth-settings-shell {
    max-width: 100%;
  }
  
  .auth-card-body {
    padding: 2rem 1.5rem;
  }
  
  .auth-heading {
    font-size: 1.875rem;
  }
  
  .auth-icon-container {
    width: 56px;
    height: 56px;
    margin-bottom: 1.25rem;
  }
  
  .auth-icon-container i {
    font-size: 1.5rem;
  }
  
  .auth-form-input,
  .auth-btn {
    min-height: 48px; /* Touch-friendly */
  }
  
  .auth-google-btn {
    min-height: 48px;
  }

  .auth-google-settings-page {
    padding-top: 1.25rem;
  }

  .auth-google-header {
    margin-bottom: 1.5rem;
  }

  .auth-google-email-chip {
    width: 100%;
    text-align: center;
    border-radius: 10px;
  }
}

@media (max-width: 360px) {
  .auth-card-body {
    padding: 1.75rem 1.25rem;
  }
  
  .auth-heading {
    font-size: 1.625rem;
  }
}

/* ─── Accessibility ─────────────────────────────────────────────────────── */
.auth-form-input:focus-visible,
.auth-btn:focus-visible,
.auth-google-btn:focus-visible {
  outline: 3px solid var(--auth-accent-primary);
  outline-offset: 2px;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .auth-icon-container {
    animation: none;
  }
  
  .auth-page-container::before,
  .auth-grid-dots {
    animation: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .auth-form-input {
    border-width: 2px;
  }
  
  .auth-btn {
    border: 2px solid currentColor;
  }
  
  .auth-card {
    border-width: 2px;
  }
}
