/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --emerald:     #0D3B26;
  --emerald-mid: #1B5E40;
  --emerald-lt:  #2E7D55;
  --gold:        #C9A84C;
  --gold-lt:     #E8CC7A;
  --gold-pale:   #FDF6E3;
  --ivory:       #FFFDF7;
  --card:        #FFFFFF;
  --text:        #1A1A1A;
  --text-2:      #555555;
  --text-3:      #999999;
  --border:      #EBEBEB;
  --red:         #D64045;
  --green:       #2E7D55;
  --radius:      16px;
  --nav-h:       68px;
  --safe-b:      env(safe-area-inset-bottom, 0px);
}
html, body {
  height: 100%; width: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px; color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior: none;
}
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; border: none; outline: none; background: none; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.93); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.anim-fade-up   { animation: fadeUp  .4s cubic-bezier(.2,0,.2,1) both; }
.anim-fade-in   { animation: fadeIn  .35s ease both; }
.anim-scale-in  { animation: scaleIn .35s cubic-bezier(.2,0,.2,1) both; }

/* Stagger delays for lists */
.anim-stagger > * { animation: fadeUp .38s cubic-bezier(.2,0,.2,1) both; }
.anim-stagger > *:nth-child(1)  { animation-delay: .04s; }
.anim-stagger > *:nth-child(2)  { animation-delay: .09s; }
.anim-stagger > *:nth-child(3)  { animation-delay: .14s; }
.anim-stagger > *:nth-child(4)  { animation-delay: .19s; }
.anim-stagger > *:nth-child(5)  { animation-delay: .24s; }
.anim-stagger > *:nth-child(6)  { animation-delay: .29s; }
.anim-stagger > *:nth-child(n+7){ animation-delay: .34s; }

/* Individual delay helpers */
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }
.delay-3 { animation-delay: .24s; }
.delay-4 { animation-delay: .32s; }
.delay-5 { animation-delay: .40s; }
a { text-decoration: none; color: inherit; }

/* ── Auth layout ── */
.auth-body { background: var(--emerald); min-height: 100vh; }
.auth-screen { min-height: 100vh; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.auth-hero {
  padding: 48px 24px 32px; text-align: center; color: #fff;
}
.auth-logo { font-size: 52px; margin-bottom: 10px; }
.auth-app-name { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.auth-tagline { font-size: 14px; opacity: .7; margin-top: 6px; }

.auth-card {
  flex: 1; background: var(--ivory); border-radius: 28px 28px 0 0;
  padding: 28px 20px calc(32px + env(safe-area-inset-bottom, 0px));
}
.auth-card-title { font-size: 22px; font-weight: 800; line-height: 1.35; margin-bottom: 20px; color: var(--emerald); text-align: center; }

.auth-mode-toggle {
  display: flex; background: var(--border); border-radius: 12px;
  padding: 3px; margin-bottom: 20px;
}
.auth-mode-btn {
  flex: 1; text-align: center; padding: 9px;
  border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-3);
  transition: all .2s;
}
.auth-mode-btn.active { background: var(--emerald); color: #fff; }

.auth-group { margin-bottom: 16px; }
.auth-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 7px; }
.auth-input-wrap { position: relative; }
.auth-input {
  width: 100%; min-width: 0; display: block;
  padding: 14px 16px; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--card);
  font-size: 15px; transition: border-color .2s;
  box-sizing: border-box; color: var(--text);
  -webkit-text-fill-color: var(--text);
}
.auth-input:focus { border-color: var(--emerald); }
.auth-input.is-error { border-color: var(--red); }
.auth-eye {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 18px; opacity: .5;
}
.auth-error { font-size: 12px; color: var(--red); margin-top: 5px; font-weight: 500; }
.auth-alert {
  background: #FEECEC; border: 1px solid #FCCACA; color: var(--red);
  border-radius: 12px; padding: 12px 14px; font-size: 13px; font-weight: 500;
  margin-bottom: 16px;
}
.auth-btn-primary {
  width: 100%; padding: 16px; border-radius: 14px; font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, var(--gold-lt), var(--gold));
  color: var(--emerald); box-shadow: 0 4px 16px rgba(201,168,76,.4);
  margin-top: 6px; transition: transform .15s;
}
.auth-btn-primary:active { transform: scale(.97); }
.auth-btn-outline {
  display: block; width: 100%; padding: 14px; border-radius: 14px;
  border: 2px solid var(--emerald); color: var(--emerald);
  font-size: 15px; font-weight: 600; text-align: center; margin-top: 10px;
}
.auth-btn-ghost {
  display: block; width: 100%; padding: 12px; text-align: center;
  font-size: 14px; color: var(--text-3); font-weight: 500; margin-top: 4px;
}
.auth-divider {
  text-align: center; font-size: 13px; color: var(--text-3); margin: 16px 0 0;
}

/* ── Google Sign-In button ── */
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 16px; border-radius: 14px;
  background: #fff; border: 1.5px solid #dadce0;
  font-size: 15px; font-weight: 600; color: #3c4043;
  text-decoration: none; transition: box-shadow .2s, background .2s;
  box-shadow: 0 1px 3px rgba(60,64,67,.12);
}
.google-btn:active { background: #f8f9fa; box-shadow: none; }
.google-btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

.auth-or-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 14px; color: var(--text-3); font-size: 12px;
}
.auth-or-divider::before,
.auth-or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-footer {
  margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--border); text-align: center;
}
.auth-footer-desc {
  font-size: 13px; color: var(--text-3); line-height: 1.65; margin-bottom: 14px;
}
.auth-footer-links {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-3); margin-bottom: 10px;
}
.auth-footer-links a {
  color: var(--emerald-lt); text-decoration: underline; text-underline-offset: 2px;
}
.auth-footer-copy { font-size: 11px; color: var(--text-3); }

.auth-back-link {
  display: inline-block; font-size: 13px; font-weight: 600;
  color: var(--emerald-lt); margin-bottom: 20px;
}
.privacy-body { font-size: 14px; color: var(--text-2); line-height: 1.7; }
.privacy-body h2 {
  font-size: 15px; font-weight: 700; color: var(--emerald);
  margin: 22px 0 8px;
}
.privacy-body p { margin-bottom: 10px; }
.privacy-body ul { padding-left: 18px; margin-bottom: 10px; }
.privacy-body li { margin-bottom: 6px; }
.privacy-updated { font-size: 12px; color: var(--text-3); margin-bottom: 16px; }

/* ── Desktop auth layout ── */
@media (min-width: 600px) {
  .auth-body {
    display: flex; align-items: center; justify-content: center;
    background: var(--emerald);
  }
  .auth-screen {
    width: 420px; min-height: auto;
    border-radius: 28px; overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,.45);
    margin: 40px 0;
  }
  .auth-card {
    flex: none;
    border-radius: 0; padding-bottom: 32px;
  }
}

/* ── Dev/test mode banner ── */
.dev-banner {
  background: #1A1A00; color: #FFD600; border: 1px solid #FFD600;
  border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 500;
  margin-bottom: 14px; text-align: center;
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
  :root {
    --gold-pale: #1E1A0E;
    --ivory:     #0F1E15;
    --card:      #1C2B22;
    --text:      #F0EFE9;
    --text-2:    #A0A09A;
    --text-3:    #666660;
    --border:    #2A3A2E;
  }
}
html.dark {
  --gold-pale: #1E1A0E;
  --ivory:     #0F1E15;
  --card:      #1C2B22;
  --text:      #F0EFE9;
  --text-2:    #A0A09A;
  --text-3:    #666660;
  --border:    #2A3A2E;
}
