/* =========================================================
   Care Helper — Thunder Option B (Light Blue + White)
   Icons: Lucide (ISC License) — inline SVG only, no emoji
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
  --primary: #6699FB;
  --primary-active: #4d7fe0;
  --primary-focus: #8fb4fc;
  --primary-disabled: #D6D6D6;
  --primary-tint-light: #B7D8FB;
  --primary-tint-mid: #AECBF0;

  --ink: #1d1d1f;
  --body: #3c3c3c;
  --body-strong: #1a1a1a;
  --muted: #6b6b6b;
  --muted-soft: #9a9a9a;
  --hairline: #e6e6e6;
  --hairline-strong: #cccccc;

  --canvas: #ffffff;
  --canvas-parchment: #F5F5FF;
  --surface-soft: #f7f7f7;
  --surface-card: #fafafa;
  --surface-pearl: #fafafc;
  --surface-strong: #ebebeb;
  --surface-dark: #1a2129;
  --surface-tile-1: #272729;
  --surface-tile-2: #2a2a2c;

  --on-primary: #ffffff;
  --on-dark: #ffffff;
  --on-dark-soft: #bbbbbb;

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #dc2626;

  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 18px;
  --r-pill: 9999px;
  --r-full: 9999px;

  --sp-xxs: 4px;
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;
  --sp-section: 80px;

  --product-shadow: rgba(0,0,0,0.22) 3px 5px 30px;
}

[data-theme="dark"] {
  --primary: #89B4FF;
  --primary-active: #6f9bf0;
  --primary-focus: #a6c6ff;
  --ink: #f5f5f7;
  --body: #d1d1d6;
  --body-strong: #ffffff;
  --muted: #8e8e93;
  --muted-soft: #636366;
  --hairline: #2c2c2e;
  --hairline-strong: #3a3a3c;
  --canvas: #0e0e10;
  --canvas-parchment: #161618;
  --surface-soft: #1a1a1c;
  --surface-card: #1c1c1e;
  --surface-pearl: #1e1e20;
  --surface-strong: #2c2c2e;
  --surface-dark: #000000;
  --surface-tile-1: #111113;
  --surface-tile-2: #131315;
  --on-dark: #ffffff;
  --on-dark-soft: #ebebf5;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--canvas);
  color: var(--body);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.1px;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ---- Typography ---- */
.hero-display { font-size: 56px; font-weight: 700; line-height: 1.07; letter-spacing: -0.28px; color: var(--body-strong); margin: 0; }
.display-lg   { font-size: 40px; font-weight: 700; line-height: 1.1;  color: var(--body-strong); margin: 0; }
.display-md   { font-size: 32px; font-weight: 700; line-height: 1.15; color: var(--body-strong); margin: 0; }
.display-sm   { font-size: 24px; font-weight: 700; line-height: 1.25; color: var(--body-strong); margin: 0; }
.lead         { font-size: 22px; font-weight: 400; line-height: 1.4;  color: var(--body); margin: 0; }
.title-md     { font-size: 18px; font-weight: 700; line-height: 1.4;  color: var(--body-strong); margin: 0; }
.body-md      { font-size: 17px; font-weight: 400; line-height: 1.5;  letter-spacing: -0.1px; }
.body-light   { font-size: 16px; font-weight: 300; line-height: 1.55; color: var(--body); }
.caption      { font-size: 14px; font-weight: 400; line-height: 1.43; letter-spacing: -0.1px; color: var(--muted); }
.label-uppercase { font-size: 13px; font-weight: 700; line-height: 1.3; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.fine-print   { font-size: 12px; font-weight: 400; line-height: 1.3; letter-spacing: -0.1px; color: var(--muted); }
strong { font-weight: 600; }

@media (max-width: 640px) { .hero-display { font-size: 34px; } }
@media (max-width: 419px) { .hero-display { font-size: 28px; } }

/* ---- Layout ---- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--sp-lg); }
.section { padding: var(--sp-section) 0; }
.section--light    { background: var(--canvas); }
.section--parchment{ background: var(--canvas-parchment); }
.section--dark     { background: var(--surface-dark); color: var(--on-dark); }
.section--dark .display-sm,
.section--dark .display-md,
.section--dark .display-lg,
.section--dark .title-md { color: var(--on-dark); }
.section--dark .body-light,
.section--dark .body-md,
.section--dark .caption { color: var(--on-dark-soft); }
.section--dark .label-uppercase { color: rgba(255,255,255,0.5); }

.grid   { display: grid; gap: var(--sp-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---- Icons ---- */
.icon    { width: 22px; height: 22px; stroke: currentColor; flex-shrink: 0; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 48px; height: 48px; }

/* ---- Product Image Cards ---- */
.product-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: var(--canvas-parchment);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: var(--sp-sm);
}
.product-img-wrap svg {
  width: 60%;
  height: 60%;
  color: var(--primary);
  opacity: 0.85;
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-md);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 14px 28px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 600; line-height: 1; border: none;
  transition: transform .12s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.95); }
.btn-primary   { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-active); }
.btn-secondary { background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline-strong); }
[data-theme="dark"] .btn-secondary { background: var(--surface-card); border-color: var(--hairline-strong); }
.btn-secondary-on-dark { background: transparent; color: var(--on-dark); border: 1px solid var(--on-dark); }
.btn-block { width: 100%; }
.btn-sm { height: 38px; padding: 8px 18px; font-size: 14px; }
.btn[disabled] { background: var(--primary-disabled); color: var(--muted); cursor: not-allowed; pointer-events: none; }

/* ---- Chips ---- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong); background: var(--canvas);
  color: var(--ink); font-size: 15px; font-weight: 600;
  transition: all .15s ease;
}
.chip:hover  { border-color: var(--primary); color: var(--primary); }
.chip.is-selected { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-group  { display: flex; flex-wrap: wrap; gap: var(--sp-sm); }
[data-theme="dark"] .chip { background: var(--surface-card); color: var(--ink); }

/* ---- Inputs ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-md); }
.field label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea {
  height: 48px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--hairline-strong); background: var(--canvas);
  color: var(--ink); font-size: 16px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; padding: 12px 16px; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint-light);
}
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea { background: var(--surface-card); color: var(--ink); border-color: var(--hairline-strong); }

/* ---- Cards ---- */
.card {
  background: var(--surface-card); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--sp-lg);
}
.card-product {
  background: var(--surface-card); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--sp-md);
  transition: border-color .15s, transform .15s;
}
.card-product:hover { border-color: var(--primary-tint-mid); transform: translateY(-2px); }

/* ---- Nav ---- */
.top-nav {
  position: sticky; top: 0; z-index: 50; height: 64px;
  display: flex; align-items: center;
  background: var(--canvas); border-bottom: 1px solid var(--hairline);
  transition: background .25s;
}
.top-nav.scrolled { backdrop-filter: blur(20px) saturate(180%); background: color-mix(in srgb, var(--canvas) 80%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); }
.brand .icon { color: var(--primary); }
.nav-links { display: flex; gap: var(--sp-lg); align-items: center; }
.nav-link { font-size: 14px; font-weight: 600; letter-spacing: 0.2px; color: var(--body); transition: color .15s; }
.nav-link:hover { color: var(--primary); }
.nav-link.active { color: var(--primary); }
.theme-toggle {
  width: 40px; height: 40px; border-radius: var(--r-full);
  border: 1px solid var(--hairline-strong); background: var(--canvas);
  display: flex; align-items: center; justify-content: center; color: var(--ink);
  transition: background .15s, color .15s;
}
.theme-toggle .icon { width: 18px; height: 18px; }
@media (max-width: 419px) { .nav-links { display: none; } }

/* ---- Footer ---- */
.footer { background: var(--canvas-parchment); padding: var(--sp-xxl) 0 var(--sp-lg); color: var(--muted); }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xl); margin-bottom: var(--sp-xl); }
.footer-col h4 { font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink); margin: 0 0 var(--sp-sm); }
.footer-col a { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; transition: color .15s; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--hairline); padding-top: var(--sp-md); }
@media (max-width: 640px) { .footer-cols { grid-template-columns: 1fr; } }

/* ---- Loading Screen ---- */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--canvas);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .4s ease;
}
#loading-screen.hide { opacity: 0; pointer-events: none; }
.loader-ring { width: 64px; height: 64px; }
.loader-ring circle {
  fill: none; stroke: var(--primary); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 150; stroke-dashoffset: 0;
  transform-origin: center;
  animation: spin 1.1s linear infinite, dash 1.6s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dash {
  0%   { stroke-dasharray: 1, 180; }
  50%  { stroke-dasharray: 120, 180; }
  100% { stroke-dasharray: 1, 180; }
}

/* ---- Tags / Badges ---- */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); background: var(--primary-tint-light); color: var(--primary-active); }
[data-theme="dark"] .tag { background: rgba(137,180,255,0.18); color: var(--primary); }
.tag-warn  { background: rgba(245,158,11,0.15); color: #b45309; }
.tag-avoid { background: rgba(220,38,38,0.12); color: var(--error); }
.tag-good  { background: rgba(34,197,94,0.12); color: #15803d; }

/* ---- Progress dots (quiz) ---- */
.progress-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: var(--sp-lg); }
.progress-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline-strong); transition: all .2s ease; }
.progress-dots span.is-active { background: var(--primary); width: 22px; border-radius: var(--r-pill); }

/* ---- Routine table ---- */
.routine-table { width: 100%; border-collapse: collapse; }
.routine-table th {
  text-align: left; font-size: 13px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  padding: var(--sp-sm); border-bottom: 1px solid var(--hairline);
}
.routine-table td {
  padding: var(--sp-sm); border-bottom: 1px solid var(--hairline);
  vertical-align: top; font-size: 15px;
}
.routine-table tr:last-child td { border-bottom: none; }
.routine-table tr:hover td { background: var(--surface-soft); }
.routine-step { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.routine-step .icon { width: 16px; height: 16px; color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.routine-step.is-active .icon { color: var(--warning); }
.routine-step.is-active span { font-weight: 600; }

/* ---- Hair wash schedule ---- */
.wash-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--sp-xs); margin: var(--sp-lg) 0; }
.wash-day {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--sp-sm); border-radius: var(--r-md);
  background: var(--surface-tile-1); color: var(--on-dark-soft); font-size: 13px; font-weight: 600;
}
.wash-day.is-wash { background: var(--primary); color: var(--on-primary); }
.wash-day .icon { width: 20px; height: 20px; }
@media (max-width: 640px) { .wash-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---- Makeup steps ---- */
.makeup-steps { display: flex; flex-direction: column; gap: 0; }
.makeup-step {
  display: flex; align-items: flex-start; gap: var(--sp-md);
  padding: var(--sp-md) 0; border-bottom: 1px solid var(--hairline);
}
.makeup-step:last-child { border-bottom: none; }
.step-num {
  width: 32px; height: 32px; border-radius: var(--r-full);
  background: var(--primary-tint-light); color: var(--primary-active);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.step-content { flex: 1; min-width: 0; }
.step-product { margin-top: var(--sp-xs); }

/* ---- Do/Don't items ---- */
.do-item, .dont-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: var(--sp-sm) 0; border-bottom: 1px solid var(--hairline); font-size: 15px;
}
.do-item:last-child, .dont-item:last-child { border-bottom: none; }
.do-item .icon   { color: var(--success); flex-shrink: 0; margin-top: 2px; }
.dont-item .icon { color: var(--error);   flex-shrink: 0; margin-top: 2px; }

/* ---- Profile summary card ---- */
.profile-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-active) 100%);
  border-radius: var(--r-lg); padding: var(--sp-xl);
  color: var(--on-primary); position: relative; overflow: hidden;
}
.profile-card::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.profile-tags { display: flex; flex-wrap: wrap; gap: var(--sp-xs); margin-top: var(--sp-md); }
.profile-tag {
  padding: 6px 14px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.2); font-size: 13px; font-weight: 600; color: white;
}

/* ---- Hero section ---- */
.hero-section {
  background: var(--surface-dark); color: var(--on-dark);
  padding: var(--sp-section) 0; position: relative; overflow: hidden;
}
.hero-section::before {
  content: ""; position: absolute; left: -10%; top: -20%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(102,153,251,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-section .display-lg, .hero-section .hero-display { color: var(--on-dark); }
.hero-section .body-light { color: var(--on-dark-soft); }

/* ---- Quiz section ---- */
.quiz-section { background: var(--canvas-parchment); padding: var(--sp-section) 0; }
.quiz-card-wrap { max-width: 580px; margin: 0 auto; }

/* ---- How it works steps ---- */
.how-step {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--sp-md);
}
.how-icon {
  width: 72px; height: 72px; border-radius: var(--r-full);
  background: var(--primary-tint-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}

/* ---- Products page ---- */
.filter-bar { display: flex; gap: var(--sp-sm); flex-wrap: wrap; margin-bottom: var(--sp-xl); }
.filter-chip {
  padding: 8px 18px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong); background: var(--canvas);
  color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* ---- Welcome back banner ---- */
.welcome-back {
  background: var(--primary-tint-light); border: 1px solid var(--primary-tint-mid);
  border-radius: var(--r-lg); padding: var(--sp-lg); margin-bottom: var(--sp-xl);
}

/* ---- Utility ---- */
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-xs { gap: var(--sp-xs); }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.gap-lg { gap: var(--sp-lg); }
.mt-xs { margin-top: var(--sp-xs); }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mt-xl { margin-top: var(--sp-xl); }
.mb-xs { margin-bottom: var(--sp-xs); }
.mb-sm { margin-bottom: var(--sp-sm); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.w-100 { width: 100%; }
