/* ═══════════════════════════════════════════════
   DAARA — Shared Design System
   ═══════════════════════════════════════════════ */

/* Fonts loaded via <link> in each page <head> */

/* ─── Design Tokens ─── */
:root {
  --cream:        #FAF7F2;
  --warm-white:   #FDF9F4;
  --sand:         #EDE4D3;
  --blush:        #E8C9B4;
  --terracotta:   #C4724A;
  --rust:         #A85432;
  --sage:         #7A9E8A;
  --deep-sage:    #4D7A62;
  --slate:        #5C6B7A;
  --deep-slate:   #2E3D4A;
  --charcoal:     #1E2A30;
  --gold:         #C9A84C;
  --light-gold:   #F0E4C0;

  /* Thread — the signature red thread, distinct from terracotta */
  --thread:       #C0392B;
  --thread-light: rgba(192,57,43,0.15);
  --thread-faint: rgba(192,57,43,0.06);

  --font-serif:   'Cormorant Garamond', Georgia, serif;
  --font-sans:    'DM Sans', 'Helvetica Neue', sans-serif;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow-soft:  0 4px 24px rgba(30,42,48,0.08);
  --shadow-hover: 0 8px 36px rgba(30,42,48,0.14);
  --transition:   all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height:   64px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img  { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════
   THREAD STRUCTURAL MOTIF
   A thin vertical terracotta line used as a
   connective element throughout the UI
   ═══════════════════════════════════════════════ */

/* Inline thread accent — horizontal rule variant */
.thread-rule {
  display: block;
  width: 40px;
  height: 2px;
  background: var(--thread);
  border-radius: 2px;
  margin: 1rem 0;
}

/* Thread dot — small circle on the timeline */
.thread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--thread);
  flex-shrink: 0;
}

/* Vertical thread line — runs beside milestone list */
.thread-line {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--thread) 8%,
    var(--thread) 92%,
    transparent 100%
  );
  opacity: 0.35;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(250,247,242,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand .wordmark {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--terracotta);
  letter-spacing: 0.04em;
}
.nav-brand .script {
  font-size: 0.85rem;
  color: var(--slate);
  font-family: var(--font-serif);
  font-style: italic;
}
/* Thread accent on brand */
.nav-brand::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--thread);
  margin-left: 0.2rem;
  opacity: 0.7;
}

.nav-links {
  display: flex;
  gap: 0.15rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--slate);
  padding: 0.5rem 0.9rem;
  border-radius: 20px;
  transition: var(--transition);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--sand);
  color: var(--terracotta);
}
.nav-cta {
  background: var(--terracotta) !important;
  color: white !important;
  border-radius: 20px;
  padding: 0.45rem 1.1rem !important;
}
.nav-cta:hover {
  background: var(--rust) !important;
  color: white !important;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  z-index: 1100;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--warm-white);
  border-bottom: 1px solid var(--sand);
  padding: 1rem 1.5rem 1.5rem;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(30,42,48,0.10);
  flex-direction: column;
  gap: 0.25rem;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  text-decoration: none;
  font-size: 1rem;
  color: var(--deep-slate);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-weight: 400;
}
.nav-drawer a:hover,
.nav-drawer a.active { background: var(--sand); color: var(--terracotta); }
.nav-drawer .drawer-cta {
  margin-top: 0.5rem;
  background: var(--terracotta);
  color: white;
  text-align: center;
  border-radius: 20px;
  font-weight: 500;
}
.nav-drawer .drawer-cta:hover { background: var(--rust); color: white; }

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */

.footer {
  background: var(--charcoal);
  color: rgba(255,255,255,0.55);
  padding: 3rem 2rem;
  text-align: center;
}
.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--blush);
  margin-bottom: 0.2rem;
}
.footer-script {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.92rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1.2rem;
}
/* Thread dot in footer brand */
.footer-thread {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--thread);
  margin: 0 0.4rem;
  vertical-align: middle;
  opacity: 0.6;
}
.footer p { font-size: 0.83rem; line-height: 1.7; margin-bottom: 0.3rem; }
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1.2rem 0;
  list-style: none;
}
.footer-nav a {
  text-decoration: none;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--blush); }
.footer-disclaimer {
  max-width: 640px;
  margin: 1.2rem auto 0;
  font-size: 0.78rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.35);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1rem;
}

/* ═══════════════════════════════════════════════
   SHARED LAYOUT
   ═══════════════════════════════════════════════ */

.page-content { padding-top: var(--nav-height); min-height: 100vh; }
section { padding: 5rem 2rem; }
.section-inner { max-width: 960px; margin: 0 auto; }
.section-inner-narrow { max-width: 720px; margin: 0 auto; }

.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  color: var(--deep-slate);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.section-intro {
  font-size: 1.02rem;
  color: var(--slate);
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 3rem;
}

/* Page hero (inner pages) */
.page-hero {
  background: linear-gradient(150deg, var(--warm-white) 0%, var(--sand) 70%, var(--blush) 100%);
  padding: 4rem 2rem 3rem;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(201,168,76,0.1) 0%, transparent 55%),
    radial-gradient(ellipse at 10% 90%, rgba(122,158,138,0.09) 0%, transparent 50%);
}
/* Thread accent line on page hero */
.page-hero::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, transparent, var(--thread) 30%, var(--thread) 70%, transparent);
  opacity: 0.4;
}
.page-hero-inner {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.page-hero-label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 0.7rem;
}
.page-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  color: var(--terracotta);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}
.page-hero .subtitle {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--deep-slate);
  margin-bottom: 0.8rem;
  line-height: 1.5;
}
.page-hero .desc {
  font-size: 0.97rem;
  color: var(--slate);
  max-width: 580px;
  line-height: 1.75;
}

/* Journey orientation callout */
.journey-orientation {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.4rem;
  padding: 0.9rem 1.1rem;
  background: rgba(192,57,43,0.06);
  border-left: 2px solid var(--thread);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: var(--deep-slate);
  line-height: 1.65;
  max-width: 560px;
}
.journey-orientation-icon {
  color: var(--thread);
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */

.btn-primary {
  display: inline-block;
  background: var(--terracotta);
  color: white;
  border: none;
  padding: 0.9rem 2.2rem;
  border-radius: 40px;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  letter-spacing: 0.03em;
  font-family: var(--font-sans);
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--rust);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168,84,50,0.28);
}
.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--terracotta);
  border: 1.5px solid var(--terracotta);
  padding: 0.88rem 2.2rem;
  border-radius: 40px;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  letter-spacing: 0.03em;
  font-family: var(--font-sans);
  cursor: pointer;
}
.btn-secondary:hover { background: var(--terracotta); color: white; transform: translateY(-2px); }
.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--slate);
  border: 1px solid var(--sand);
  padding: 0.55rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: none;
  transition: var(--transition);
  font-family: var(--font-sans);
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--slate); background: var(--warm-white); }
.btn-sage {
  display: inline-block;
  background: var(--sage);
  color: white;
  border: none;
  padding: 0.55rem 1.3rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.btn-sage:hover { background: var(--deep-sage); }
.btn-cancel {
  background: transparent;
  color: var(--slate);
  border: 1px solid var(--sand);
  padding: 0.55rem 1.2rem;
  border-radius: 20px;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.btn-cancel:hover { background: var(--warm-white); }

/* ═══════════════════════════════════════════════
   TAGS
   ═══════════════════════════════════════════════ */

.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tag-identity   { background: rgba(201,168,76,0.15);  color: #8a6e1a; }
.tag-values     { background: rgba(77,122,98,0.15);   color: var(--deep-sage); }
.tag-village    { background: rgba(196,114,74,0.13);  color: var(--rust); }
.tag-resilience { background: rgba(92,107,122,0.13);  color: var(--slate); }
.tag-body       { background: rgba(232,201,180,0.4);  color: #8a5a3a; }
.tag-clinical   { background: rgba(122,158,138,0.15); color: var(--deep-sage); }

/* ═══════════════════════════════════════════════
   FORMS & REFLECTION AREAS
   ═══════════════════════════════════════════════ */

.reflection-area {
  width: 100%;
  min-height: 130px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--sand);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.93rem;
  color: var(--charcoal);
  background: var(--warm-white);
  resize: vertical;
  line-height: 1.65;
  transition: border-color 0.2s;
  margin-bottom: 0.75rem;
}
.reflection-area:focus {
  outline: none;
  border-color: var(--terracotta);
  background: white;
}
.reflection-area::placeholder { color: #c5b8a8; }

.reflection-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.save-note { font-size: 0.78rem; color: var(--sage); font-style: italic; }
.autosave-indicator {
  font-size: 0.75rem;
  color: var(--sage);
  opacity: 0;
  transition: opacity 0.4s;
  font-style: italic;
}
.autosave-indicator.visible { opacity: 1; }

/* ═══════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(30,42,48,0.45);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius);
  padding: 2.2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  position: relative;
}
/* Thread accent on modal */
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--thread), var(--terracotta));
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--deep-slate);
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
}
.modal p { font-size: 0.9rem; color: var(--slate); margin-bottom: 1rem; line-height: 1.6; }
.modal-notice {
  font-size: 0.8rem !important;
  color: var(--sage) !important;
  background: rgba(122,158,138,0.09);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  margin-bottom: 1rem !important;
  line-height: 1.55 !important;
}
.modal input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--sand);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s;
  background: var(--warm-white);
  color: var(--charcoal);
}
.modal input:focus { outline: none; border-color: var(--terracotta); background: white; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem; }

/* ═══════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--deep-slate);
  color: white;
  padding: 0.8rem 1.8rem;
  border-radius: 40px;
  font-size: 0.88rem;
  font-weight: 400;
  z-index: 3000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════
   OFFLINE BANNER
   ═══════════════════════════════════════════════ */

.offline-banner {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  z-index: 990;
  background: var(--deep-slate);
  color: rgba(255,255,255,0.9);
  padding: 0.75rem 2rem;
  text-align: center;
  font-size: 0.87rem;
  line-height: 1.5;
}
.offline-banner.visible { display: block; }
.offline-banner strong { color: var(--blush); }

/* ═══════════════════════════════════════════════
   FORM FIELDS (auth, onboarding, settings)
   ═══════════════════════════════════════════════ */

.field-group {
  margin-bottom: 1.2rem;
}
.field-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--deep-slate);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--sand);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-family: var(--font-sans);
  color: var(--charcoal);
  background: var(--warm-white);
  transition: border-color 0.2s, background 0.2s;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--terracotta);
  background: white;
}
.field-hint {
  font-size: 0.78rem;
  color: var(--slate);
  margin-top: 0.3rem;
  line-height: 1.5;
  font-style: italic;
}
.field-error {
  font-size: 0.8rem;
  color: var(--rust);
  margin-top: 0.3rem;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  section { padding: 3.5rem 1.25rem; }
  .section-title { font-size: 1.7rem; }
  .page-hero { padding: 3rem 1.25rem 2.5rem; }
}
@media (max-width: 480px) {
  .btn-primary, .btn-secondary { padding: 0.8rem 1.6rem; font-size: 0.88rem; }
}
