/* TSARIVA Design System
   Brand: Forest #0B5C3F, Gold #D4A537, Mint #1A8A5F, Cream #FAF7F0, Ink #0A1F17
   Mobile-first, modern, welcoming
*/

:root {
  /* Brand */
  --forest: #0B5C3F;
  --forest-deep: #083D2A;
  --forest-light: #E8F2EC;
  --gold: #D4A537;
  --gold-soft: #F5E6B8;
  --gold-deep: #8B6914;
  --mint: #1A8A5F;
  --mint-light: #D4F0E2;
  --cream: #FAF7F0;
  --cream-warm: #F5EFE0;
  --ink: #0A1F17;
  --ink-soft: #4A5A52;

  /* Status */
  --success: #1A8A5F;
  --success-bg: #D4F0E2;
  --warning: #C97C0E;
  --warning-bg: #FCEBD0;
  --danger: #B83232;
  --danger-bg: #FAE0E0;

  /* Neutrals */
  --white: #FFFFFF;
  --gray-50: #FAFAF7;
  --gray-100: #F0EEE7;
  --gray-200: #E0DDD2;
  --gray-300: #C7C3B5;
  --gray-400: #9B9685;
  --gray-500: #6B6759;
  --gray-600: #4A463C;
  --gray-700: #2C2A24;

  /* Type */
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(10, 31, 23, 0.04), 0 1px 3px rgba(10, 31, 23, 0.06);
  --shadow-md: 0 4px 6px rgba(10, 31, 23, 0.04), 0 2px 4px rgba(10, 31, 23, 0.06);
  --shadow-lg: 0 12px 24px rgba(10, 31, 23, 0.08), 0 4px 8px rgba(10, 31, 23, 0.06);

  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--mint); }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p { color: var(--ink-soft); }

/* Layout */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 640px; }
.container-form { max-width: 440px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  white-space: nowrap;
  min-height: 48px;
  letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--forest);
  color: var(--white);
}
.btn-primary:hover { background: var(--forest-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(0); }

.btn-gold {
  background: var(--gold);
  color: var(--ink);
}
.btn-gold:hover { background: #C09525; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-ghost {
  background: transparent;
  color: var(--forest);
  border: 1px solid var(--gray-200);
}
.btn-ghost:hover { background: var(--white); border-color: var(--forest); }

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Forms */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.field .hint {
  display: block;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 6px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  min-height: 48px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(11, 92, 63, 0.1);
}
.input::placeholder { color: var(--gray-400); }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
}
.card-padded { padding: 1.5rem; }
@media (min-width: 640px) {
  .card-padded { padding: 2rem; }
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--forest);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-weight: 700;
  font-size: 18px;
}

/* Header */
.site-header {
  padding: 1.25rem 0;
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(250, 247, 240, 0.85);
  border-bottom: 1px solid rgba(224, 221, 210, 0.5);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Hero */
.hero {
  padding: 4rem 0 5rem;
  text-align: center;
}
@media (min-width: 768px) {
  .hero { padding: 6rem 0 7rem; }
}
.hero-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: var(--forest-light);
  color: var(--forest);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  margin-bottom: 1.5rem;
}
.hero h1 {
  margin-bottom: 1.25rem;
  max-width: 16ch;
  margin-left: auto;
  margin-right: auto;
}
.hero h1 .accent { color: var(--forest); }
.hero p {
  font-size: 1.125rem;
  max-width: 540px;
  margin: 0 auto 2rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Feature grid */
.features {
  padding: 4rem 0;
  background: var(--white);
}
.features-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  margin-top: 3rem;
}
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }

.feature {
  padding: 1.75rem;
  background: var(--cream);
  border-radius: var(--radius-lg);
  border: 1px solid var(--cream-warm);
  transition: all var(--transition);
}
.feature:hover { border-color: var(--forest); transform: translateY(-2px); }
.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--forest);
  color: var(--gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.feature h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.feature p { font-size: 14px; color: var(--ink-soft); }

/* Personas section */
.personas {
  padding: 4rem 0;
}
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { max-width: 540px; margin: 1rem auto 0; }

.persona-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .persona-grid { grid-template-columns: repeat(3, 1fr); } }

.persona {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  transition: all var(--transition);
}
.persona:hover { box-shadow: var(--shadow-lg); border-color: var(--gold); }
.persona-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-deep);
  background: var(--gold-soft);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}
.persona h3 { margin-bottom: 0.75rem; }
.persona ul {
  list-style: none;
  margin-top: 1rem;
}
.persona li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  gap: 8px;
}
.persona li::before {
  content: '✓';
  color: var(--mint);
  font-weight: 700;
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  padding: 3rem 0 2rem;
  background: var(--ink);
  color: var(--cream);
}
.site-footer .logo { color: var(--cream); }
.site-footer .logo-mark { background: var(--gold); color: var(--ink); }
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  margin-bottom: 2rem;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(245, 239, 224, 0.1);
  font-size: 13px;
  color: rgba(245, 239, 224, 0.5);
  text-align: center;
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: var(--cream);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}
@media (min-width: 640px) { .auth-card { padding: 2.5rem; } }
.auth-card .logo { margin-bottom: 1.75rem; }
.auth-card h1 { font-size: 1.625rem; margin-bottom: 0.5rem; }
.auth-card .auth-sub {
  color: var(--ink-soft);
  margin-bottom: 2rem;
  font-size: 15px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 20px;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transition: transform var(--transition);
  max-width: calc(100vw - 32px);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--mint); }
.toast.error { background: var(--danger); }

/* Loading spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Onboarding */
.onboarding {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  padding: 2rem 1.25rem;
}
.onboarding-container {
  max-width: 640px;
  margin: 0 auto;
}
.onboarding-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 2rem;
}
.progress-dot {
  height: 4px;
  flex: 1;
  background: var(--gray-200);
  border-radius: 2px;
  transition: background var(--transition);
}
.progress-dot.active { background: var(--forest); }
.progress-dot.done { background: var(--mint); }

.onboarding-step h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}
.onboarding-step .step-sub {
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 2rem;
}
.choice {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1.25rem;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.choice:hover { border-color: var(--gold); transform: translateY(-1px); }
.choice.selected { border-color: var(--forest); background: var(--forest-light); }
.choice-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 4px;
}
.choice-desc {
  font-size: 14px;
  color: var(--ink-soft);
}

.onboarding-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

/* App shell */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 36px;
  height: 36px;
  background: var(--forest);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}
.app-main {
  flex: 1;
  padding: 2rem 1.25rem;
}
.app-main .container { max-width: 1100px; }

.welcome-card {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}
.welcome-card h2 { color: var(--white); margin-bottom: 0.5rem; }
.welcome-card p { color: rgba(255, 255, 255, 0.85); }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--gray-200);
}
.empty-state h3 { margin-bottom: 0.5rem; }
.empty-state p { margin-bottom: 1.5rem; max-width: 400px; margin-left: auto; margin-right: auto; }

.stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 2rem;
}
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: var(--white);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-100);
}
.stat-label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
