/* =====================================================================
   Vital — design tokens & shared primitives
   Aesthetic: clínico moderno (teal + grafito sobre off-white)
   Typography: Bricolage Grotesque (display) + Geist (body)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700&family=Geist:wght@300;400;500;600;700&display=swap');

:root {
  /* — neutrals — */
  --bg:           #F4F6F8;
  --surface:      #FFFFFF;
  --surface-2:    #FAFBFC;
  --surface-3:    #EEF2F5;
  --line:         #E2E8EE;
  --line-strong:  #C8D3DC;

  /* — ink — */
  --ink:          #0B1F33;
  --ink-soft:     #45586D;
  --ink-muted:    #7A8A9C;
  --ink-faint:    #AAB6C2;

  /* — brand: clinical teal — */
  --brand:        #0E7490;
  --brand-deep:   #155E75;
  --brand-soft:   #DCEEF1;
  --brand-faint:  #EEF7F8;

  /* — semantic — */
  --success:      #047857;
  --success-soft: #E5F4ED;
  --warning:      #B45309;
  --warning-soft: #FBF1E1;
  --danger:       #B42318;
  --danger-soft:  #FDECEC;

  /* — radii — */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* — shadows — */
  --shadow-card:   0 1px 2px rgba(11, 31, 51, 0.04), 0 4px 14px rgba(11, 31, 51, 0.06);
  --shadow-pop:    0 8px 24px rgba(11, 31, 51, 0.10), 0 2px 6px rgba(11, 31, 51, 0.06);
  --shadow-phone:  0 30px 60px -20px rgba(11, 31, 51, 0.35), 0 18px 36px -12px rgba(11, 31, 51, 0.18);

  /* — fonts — */
  --font-display: 'Bricolage Grotesque', ui-serif, Georgia, serif;
  --font-body:    'Geist', ui-sans-serif, -apple-system, system-ui, sans-serif;

  /* — sizes (mobile, generous defaults for mixed audience) — */
  --size-mobile-w: 390px;
  --size-mobile-h: 844px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* — phone frame (iPhone 14 ratio) — */
.phone {
  width: var(--size-mobile-w);
  height: var(--size-mobile-h);
  background: var(--surface);
  border-radius: 48px;
  box-shadow: var(--shadow-phone);
  position: relative;
  overflow: hidden;
  border: 8px solid #0B1F33;
  flex-shrink: 0;
}

.phone-screen {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 30px;
  background: #0B1F33;
  border-radius: 999px;
  z-index: 100;
}

.status-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  z-index: 50;
  pointer-events: none;
}
.status-bar .right {
  display: flex;
  gap: 6px;
  align-items: center;
}

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: var(--ink);
  border-radius: 999px;
  opacity: 0.85;
  z-index: 100;
}

/* — page chrome inside phone — */
.page {
  position: absolute;
  inset: 0;
  padding: 64px 0 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.page--scroll { overflow-y: auto; }

.page-header {
  padding: 8px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
.page-header .subtitle {
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.page-content {
  padding: 0 24px;
  flex: 1;
}

/* — typography helpers — */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* — buttons — */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 22px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 20px -8px rgba(14, 116, 144, 0.55);
}
.btn--primary:hover { background: var(--brand-deep); }

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn--soft {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--block { width: 100%; }
.btn--lg { padding: 20px 24px; font-size: 18px; border-radius: var(--r-lg); }

/* — cards — */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.card-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* — pill / tag — */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--brand-faint);
  color: var(--brand-deep);
  letter-spacing: -0.005em;
}
.pill--success { background: var(--success-soft); color: var(--success); }
.pill--warning { background: var(--warning-soft); color: var(--warning); }
.pill--danger  { background: var(--danger-soft);  color: var(--danger); }
.pill--neutral { background: var(--surface-3);    color: var(--ink-soft); }

/* — form inputs — */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}
.input, .select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  font-size: 17px;
  color: var(--ink);
  font-family: var(--font-body);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-faint);
}
.input::placeholder { color: var(--ink-faint); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* — chip selectors (for time-of-day picker, day picker) — */
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s ease;
}
.chip--active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* — divider — */
.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

/* — bottom nav — */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 84px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 12px 24px;
  z-index: 60;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-faint);
}
.tab svg { width: 22px; height: 22px; }
.tab--active { color: var(--brand-deep); }
.tab--ai-fab {
  position: relative;
}
.tab--ai-fab .fab {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-top: -22px;
  box-shadow: 0 12px 24px -10px rgba(14, 116, 144, 0.5);
}
.tab--ai-fab .fab svg { width: 26px; height: 26px; }

/* ================ landing / index page only ================ */

.landing {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(14, 116, 144, 0.08), transparent 60%),
    radial-gradient(700px 600px at 100% 20%, rgba(11, 31, 51, 0.05), transparent 60%),
    var(--bg);
  padding: 80px 48px 120px;
  font-family: var(--font-body);
}

.landing-hero {
  max-width: 1100px;
  margin: 0 auto 64px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.landing-eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.landing h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--ink);
  max-width: 14ch;
}
.landing h1 em {
  font-style: normal;
  color: var(--brand);
  font-weight: 500;
}

.landing-lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-top: 16px;
}

.landing-meta {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.landing-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.landing-meta-key {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.landing-meta-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.flows {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 56px 36px;
  align-items: start;
}

.flow {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.flow-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.flow-num {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-deep);
  letter-spacing: 0.05em;
}
.flow-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.flow-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.flow-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-deep);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.flow-frame {
  width: 100%;
  aspect-ratio: 390 / 844;
  background: var(--surface);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
}
.flow-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* — utility — */
.muted { color: var(--ink-muted); }
.soft  { color: var(--ink-soft); }
.center{ text-align: center; }
.mono  { font-family: ui-monospace, SFMono-Regular, monospace; font-feature-settings: "tnum" 1; }
.tnum  { font-feature-settings: "tnum" 1; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }

/* — wireframe gallery layout (used inside each flow file when opened standalone) — */
.gallery {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  padding: 80px 32px 120px;
  background:
    radial-gradient(800px 500px at 50% -10%, rgba(14, 116, 144, 0.06), transparent 60%),
    var(--bg);
}
.gallery-header {
  text-align: center;
  max-width: 720px;
}
.gallery-header h1 {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.gallery-header p {
  margin-top: 12px;
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.gallery-row {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  justify-content: center;
  align-items: flex-start;
}
.gallery-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 390px;
}
.step-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.step-tag b { color: var(--brand-deep); }
.step-caption {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
  max-width: 36ch;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-deep);
  margin-bottom: -24px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
}
