/* ==========================================================================
   HairCare Companion - design system
   Warm cream base, sage + deep green accents, charcoal text, rounded cards.
   ========================================================================== */
:root {
  --hc-cream: #FBF7F1;
  --hc-cream-2: #F4EDE3;
  --hc-surface: #FFFFFF;
  --hc-sage: #9CAF88;
  --hc-sage-soft: #E3EADB;
  --hc-green: #2F5D50;
  --hc-green-dark: #1F4238;
  --hc-charcoal: #2E2B28;
  --hc-muted: #6B6660;
  --hc-line: #E6DDD0;
  --hc-amber: #B26B27;
  --hc-danger: #A63D40;
  --hc-info: #2C5D8A;
  --hc-radius: 16px;
  --hc-radius-sm: 10px;
  --hc-shadow: 0 1px 2px rgba(46, 43, 40, .06), 0 8px 24px rgba(46, 43, 40, .05);
  --hc-shadow-lg: 0 12px 40px rgba(46, 43, 40, .12);
  --hc-font: "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Sans Devanagari",
             "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Arabic", "Noto Sans JP", sans-serif;
  --hc-space: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--hc-cream);
  color: var(--hc-charcoal);
  font-family: var(--hc-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { text-align: right; }
h1, h2, h3, h4 { color: var(--hc-green-dark); line-height: 1.25; margin: 0 0 .5rem; font-weight: 650; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .75rem; }
a { color: var(--hc-green); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .hc-muted { color: var(--hc-muted); }
h1, h2, h3, p, li, label, button, input, textarea, select { overflow-wrap: break-word; }

/* ---------- layout ---------- */
.hc-shell { min-height: 100%; display: flex; flex-direction: column; }
.hc-topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 247, 241, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hc-line);
}
.hc-topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.hc-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--hc-green-dark); }
.hc-brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg, var(--hc-sage), var(--hc-green));
  display: grid; place-items: center; color: #fff; font-size: 15px;
}
.hc-topbar-spacer { flex: 1; }
.hc-main { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 20px 16px 96px; }
.hc-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--hc-surface); border-top: 1px solid var(--hc-line);
  display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.hc-bottomnav a {
  flex: 1; text-align: center; color: var(--hc-muted); font-size: .72rem;
  padding: 6px 2px; border-radius: 12px; text-decoration: none;
}
.hc-bottomnav a .hc-nav-icon { display: block; font-size: 1.15rem; line-height: 1.2; }
.hc-bottomnav a.is-active { color: var(--hc-green); background: var(--hc-sage-soft); }
@media (min-width: 900px) {
  .hc-bottomnav { display: none; }
  .hc-main { padding-bottom: 40px; }
}
.hc-sidenav { display: none; }
@media (min-width: 900px) {
  .hc-sidenav {
    display: block; width: 210px; flex: 0 0 210px; padding: 20px 12px;
    border-right: 1px solid var(--hc-line); min-height: 100vh; background: var(--hc-cream-2);
  }
  .hc-sidenav a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--hc-charcoal); }
  .hc-sidenav a.is-active { background: var(--hc-sage-soft); color: var(--hc-green-dark); font-weight: 600; }
  .hc-layout { display: flex; align-items: flex-start; }
  .hc-layout .hc-main { padding-top: 24px; }
}

/* ---------- components ---------- */
.hc-card {
  background: var(--hc-surface); border: 1px solid var(--hc-line);
  border-radius: var(--hc-radius); padding: 16px; box-shadow: var(--hc-shadow); margin-bottom: 14px;
}
.hc-card-tight { padding: 12px; }
.hc-hero {
  background: linear-gradient(150deg, var(--hc-sage-soft), var(--hc-cream) 60%);
  border: 1px solid var(--hc-line); border-radius: 22px; padding: 22px;
}
.hc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--hc-green); color: #fff; border: 1px solid transparent;
  border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: .95rem;
  cursor: pointer; text-decoration: none; transition: filter .15s ease, transform .05s ease;
}
.hc-btn:hover { filter: brightness(1.06); text-decoration: none; color: #fff; }
.hc-btn:active { transform: translateY(1px); }
.hc-btn[disabled] { opacity: .55; cursor: not-allowed; }
.hc-btn-secondary { background: var(--hc-surface); color: var(--hc-green-dark); border-color: var(--hc-line); }
.hc-btn-ghost { background: transparent; color: var(--hc-green-dark); border-color: transparent; }
.hc-btn-danger { background: var(--hc-danger); }
.hc-btn-block { width: 100%; }
.hc-btn-sm { padding: 6px 12px; font-size: .85rem; }
.hc-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hc-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .hc-grid-2 { grid-template-columns: repeat(2, 1fr); } .hc-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.hc-pill {
  display: inline-block; background: var(--hc-sage-soft); color: var(--hc-green-dark);
  border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600;
}
.hc-pill-warn { background: #FBEEDC; color: var(--hc-amber); }
.hc-pill-danger { background: #F7E2E2; color: var(--hc-danger); }
.hc-pill-muted { background: var(--hc-cream-2); color: var(--hc-muted); }
.hc-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.hc-input, .hc-select, .hc-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--hc-line); border-radius: var(--hc-radius-sm);
  background: #fff; color: var(--hc-charcoal); font: inherit;
}
.hc-input:focus, .hc-select:focus, .hc-textarea:focus { outline: 2px solid var(--hc-sage); outline-offset: 1px; }
.hc-field { margin-bottom: 12px; }
.hc-error { color: var(--hc-danger); font-size: .85rem; margin-top: 4px; }
.hc-checkline { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--hc-line); border-radius: var(--hc-radius-sm); margin-bottom: 8px; background: #fff; }
.hc-checkline input { width: 20px; height: 20px; accent-color: var(--hc-green); }
.hc-checkline.is-done { background: var(--hc-sage-soft); border-color: var(--hc-sage); }
.hc-checkline.is-done .hc-task-title { text-decoration: line-through; color: var(--hc-muted); }
.hc-progress { height: 8px; background: var(--hc-cream-2); border-radius: 999px; overflow: hidden; }
.hc-progress > span { display: block; height: 100%; background: var(--hc-sage); }
.hc-banner {
  border-radius: var(--hc-radius-sm); padding: 10px 14px; margin-bottom: 14px; font-size: .9rem;
  border: 1px solid var(--hc-line); background: var(--hc-cream-2);
}
.hc-banner-warn { background: #FBEEDC; border-color: #EBD3A8; color: #6B4218; }
.hc-banner-danger { background: #F7E2E2; border-color: #E5B9BA; color: #76262A; }
.hc-banner-info { background: #E4EEF7; border-color: #B9D2E8; color: #1E4463; }
.hc-skeleton { background: linear-gradient(90deg, #EFE7DA, #F7F1E8, #EFE7DA); background-size: 200% 100%;
  animation: hc-shimmer 1.2s infinite; border-radius: var(--hc-radius-sm); height: 16px; margin-bottom: 8px; }
@keyframes hc-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.hc-empty { text-align: center; padding: 32px 16px; color: var(--hc-muted); }
.hc-empty .hc-empty-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.hc-adslot { border: 1px dashed var(--hc-line); border-radius: var(--hc-radius-sm); padding: 10px; text-align: center; color: var(--hc-muted); font-size: .8rem; background: var(--hc-cream-2); }
.hc-list { list-style: none; margin: 0; padding: 0; }
.hc-list li { padding: 10px 0; border-bottom: 1px solid var(--hc-line); }
.hc-list li:last-child { border-bottom: 0; }
.hc-step-dots { display: flex; gap: 4px; margin-bottom: 14px; }
.hc-step-dots span { height: 5px; flex: 1; background: var(--hc-cream-2); border-radius: 999px; }
.hc-step-dots span.is-done { background: var(--hc-sage); }
.hc-safety-card { border: 1px solid #E5B9BA; background: #FDF3F3; }
.hc-safety-card h3 { color: var(--hc-danger); }
.hc-photo-frame { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.hc-photo-frame img { width: 100%; border-radius: var(--hc-radius-sm); border: 1px solid var(--hc-line); }
.hc-disclosure { font-size: .8rem; color: var(--hc-muted); border-top: 1px dashed var(--hc-line); padding-top: 10px; margin-top: 10px; }
.hc-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hc-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.hc-table th, .hc-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--hc-line); }
[dir="rtl"] .hc-table th, [dir="rtl"] .hc-table td { text-align: right; }
.hc-table th { color: var(--hc-green-dark); }
.hc-toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 86px; z-index: 60;
  background: var(--hc-green-dark); color: #fff; padding: 10px 18px; border-radius: 999px;
  box-shadow: var(--hc-shadow-lg); font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.hc-toast.is-visible { opacity: 1; }
.hc-footer { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; color: var(--hc-muted); font-size: .85rem; }
.hc-footer a { color: var(--hc-muted); margin-inline-end: 12px; }
[dir="rtl"] .hc-btn .hc-icon:first-child { transform: scaleX(-1); }
@media print { .hc-topbar, .hc-bottomnav, .hc-sidenav, .hc-toast { display: none !important; } }
