/* ============================================================
   Life Code — Shared Design System
   seemantmaharana.com
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Lato:wght@300;400;600&display=swap');

/* ── Design Tokens ── */
:root {
  /* Backgrounds */
  --bg-deep:    #0A0A0F;
  --bg-card:    #12121A;
  --bg-form:    #1e1c18;
  --bg-field:   #2a2820;

  /* Gold palette */
  --gold:       #C9A84C;
  --gold-light: #E8CB7A;
  --gold-dim:   #8a6f32;
  --gold-faint: rgba(201,168,76,0.12);

  /* Text */
  --text-main:  #F0EDE8;
  --text-body:  #e8e0d0;
  --text-muted: #9A9580;
  --text-faint: #5A5750;

  /* Parchment (report surfaces) */
  --ink:        #1a1410;
  --parchment:  #F5EDD8;
  --parchment-dark: #EAD9B8;
  --cream:      #FBF5E6;
  --rust:       #8B3A2A;
  --sage:       #4A5E4A;

  /* Borders & shadows */
  --border:     rgba(201,168,76,0.25);
  --border-dim: rgba(201,168,76,0.12);
  --shadow:     rgba(26,20,16,0.15);

  /* Shape */
  --radius-card: 16px;
  --radius-btn:  8px;
  --radius-sm:   6px;

  /* Typography */
  --font-display: 'Cinzel', serif;
  --font-serif:   'Cormorant Garamond', serif;
  --font-ui:      'Lato', sans-serif;

  /* Spacing */
  --page-pad: 1rem;
  --card-pad: 24px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ── */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-weight: 300;
  background: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Page wrapper ── */
.page {
  padding: 1.5rem var(--page-pad) 3rem;
}
@media (max-width: 420px) {
  .page { padding: 1rem 0.75rem 3rem; }
}

/* ── Tool card container ── */
.card {
  max-width: 540px;
  margin: 0 auto;
  background: var(--bg-form);
  border: 0.5px solid rgba(58,56,48,0.8);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
}
@media (max-width: 600px) {
  .card { padding: 20px; border-radius: 14px; }
}
@media (max-width: 420px) {
  .card { padding: 16px; border-radius: 12px; }
}

/* ── Back link ── */
.back-link {
  display: block;
  max-width: 540px;
  margin: 0 auto 0.5rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  text-decoration: none;
  letter-spacing: 0.06em;
}
.back-link:hover { color: var(--gold); }

/* ── Page title & description ── */
.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  color: var(--gold);
  letter-spacing: 0.08em;
  text-align: center;
  margin-bottom: 6px;
}
.page-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
  font-family: var(--font-ui);
  text-align: center;
}

/* ── Section labels ── */
.section-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
  font-family: var(--font-ui);
  padding-bottom: 6px;
  border-bottom: 0.5px solid var(--border-dim);
}

/* ── Field labels ── */
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: var(--font-ui);
}
.field-optional {
  font-size: 0.67rem;
  color: var(--text-faint);
  font-family: var(--font-ui);
  font-style: italic;
}

/* ── Text inputs ── */
input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  background: var(--bg-field);
  border: 0.5px solid rgba(58,56,48,0.9);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 300;
  color: var(--text-body);
  outline: none;
  display: block;
  margin-bottom: 20px;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus { border-color: #a08030; }
input[type="text"]::placeholder,
input[type="tel"]::placeholder,
input[type="email"]::placeholder { color: #444; }

/* ── DOB row ── */
.dob-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.dob-row input[type="number"] {
  width: 100%;
  background: var(--bg-field);
  border: 0.5px solid rgba(58,56,48,0.9);
  border-radius: var(--radius-sm);
  padding: 11px 8px;
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 300;
  color: var(--text-body);
  outline: none;
  display: block;
  -moz-appearance: textfield;
  text-align: center;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.dob-row input[type="number"]::-webkit-inner-spin-button,
.dob-row input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.dob-row input[type="number"]:focus { border-color: #a08030; }
.dob-row input[type="number"].filled { border-color: rgba(201,168,76,0.6); box-shadow: 0 0 0 2px rgba(201,168,76,0.12); }
.dob-row input[type="number"].invalid { border-color: #e07070; background: rgba(224,112,112,0.1); box-shadow: 0 0 0 2px rgba(224,112,112,0.25); }
.dob-row input[type="number"]::placeholder { color: #444; font-size: 14px; }
.dob-sublabel {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-ui);
  text-align: center;
}
.dob-hint {
  font-size: 11px;
  color: #e07070;
  font-family: var(--font-ui);
  min-height: 18px;
  margin-bottom: 12px;
}

/* ── Toggle buttons ── */
.toggle-group {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}
.toggle-btn {
  background: #1A1A26;
  border: 0.5px solid rgba(58,56,48,0.8);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-ui);
  transition: all 0.2s;
  min-height: 48px;
  padding: 10px 12px;
}
.toggle-btn.active {
  background: rgba(201,168,76,0.12);
  border: 1px solid var(--gold);
  color: var(--gold);
}
.toggle-btn .sub  { font-size: 0.58rem; margin-bottom: 0.1rem; }
.toggle-btn .main { font-size: 0.76rem; font-weight: 600; }
.toggle-btn .main2{ font-size: 0.8rem;  font-weight: 600; margin-bottom: 0.12rem; }
.toggle-btn .desc { font-size: 0.65rem; }

/* ── Primary CTA button ── */
.generate-btn {
  width: 100%;
  background: transparent;
  border: 0.5px solid #a08030;
  border-radius: var(--radius-btn);
  padding: 14px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.06em;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: background 0.2s, border-color 0.2s;
  min-height: 48px;
}
.generate-btn:hover { background: rgba(201,168,76,0.08); border-color: var(--gold); }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Price tag ── */
.price-tag {
  background: transparent;
  border: 0.5px solid rgba(201,168,76,0.4);
  border-radius: var(--radius-btn);
  padding: 0 16px;
  font-family: Georgia, serif;
  font-size: 16px;
  color: var(--gold);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.price-tag .mrp  { text-decoration: line-through; color: var(--text-muted); margin-right: 5px; font-size: 13px; }
.price-tag .save { font-size: 12px; color: #5dc85d; margin-left: 4px; }

/* ── Trust bar ── */
.trust-bar {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-ui);
  letter-spacing: 0.06em;
  margin-top: 1rem;
}

/* ── Card title & subtitle ── */
.card-title {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 6px;
  font-family: var(--font-serif);
  font-weight: 400;
}
.card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
  font-family: var(--font-ui);
  font-weight: 300;
}

/* ── Brand block (shared header) ── */
.brand-symbol { font-size: 1.4rem; color: var(--gold); letter-spacing: 0.3em; margin-bottom: 10px; display: block; }
.brand-name   { font-size: 1.5rem; color: var(--text-main); letter-spacing: 0.14em; text-transform: uppercase; font-family: var(--font-serif); font-weight: 600; line-height: 1.1; margin-bottom: 8px; }
.brand-tagline{ font-size: 0.88rem; color: var(--gold); font-style: italic; font-family: var(--font-ui); font-weight: 300; letter-spacing: 0.04em; }

/* ── Nav back link (top of tool pages) ── */
.nav { max-width: 540px; margin: 0 auto; padding: 1rem var(--page-pad) 0; }

/* ── Progress bar ── */
.progress-bar-wrap { height: 3px; background: rgba(201,168,76,0.1); margin-bottom: 1.5rem; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); transition: width 0.4s ease; }

/* ── Error / hint text ── */
.error-msg { font-size: 12px; color: #e07070; font-family: var(--font-ui); margin-top: -14px; margin-bottom: 12px; min-height: 16px; }

/* ── Print utilities ── */
@media print {
  .nav, .card, .generate-btn, .trust-bar, .progress-bar-wrap, .back-link { display: none !important; }
  body { background: #fff; color: #111; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── International visitor / currency notice ── */
.intl-notice {
  background: rgba(201,168,76,0.08);
  border: 0.5px solid var(--gold-dim);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}
.intl-notice strong { color: var(--gold); }
.intl-notice a {
  color: var(--gold-dim);
  font-size: 12px;
  margin-left: 8px;
  text-decoration: underline;
}

/* ── Admin session-alert banner ── */
.session-alert-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--gold);
  color: #1a1a2e;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 10px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  cursor: pointer;
}

/* ── Consult calendar — admin-blocked days ── */
.day-blocked {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  position: relative;
}
.day-blocked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 3px,
    rgba(255,255,255,0.06) 3px,
    rgba(255,255,255,0.06) 6px
  );
  border-radius: inherit;
}

/* ── Admin Consult Calendar (month + week strip) ──
   These vars (--card, --border, --text, --muted, --red) are admin.html's own
   local :root tokens, defined in admin.html's inline <style> — the only page
   that uses these classes. Fallbacks match admin.html's actual values. */
.admin-cal-widget { display: flex; flex-direction: column; gap: 14px; }
.admin-cal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.admin-cal-title {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--gold);
}
.admin-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.admin-cal-dow {
  font-size: 10px;
  color: var(--muted, #9a9580);
  text-transform: uppercase;
  padding: 2px 0 4px;
}
.admin-cal-day {
  font-size: 12px;
  padding: 8px 0;
  border-radius: 8px;
  color: var(--muted, #9a9580);
  cursor: pointer;
  border: 1px solid transparent;
}
.admin-cal-day:hover { border-color: var(--border); }
.admin-cal-day.pad { visibility: hidden; cursor: default; } /* leading blank cells before month's day 1 */
.admin-cal-day.empty { color: var(--muted, #9a9580); opacity: 0.55; } /* real day, zero slots — muted but still clickable */
.admin-cal-day.available { color: var(--text, #e8e0d0); }
.admin-cal-day.booked { color: var(--gold); font-weight: 700; background: rgba(201,168,76,0.1); }
.admin-cal-day.blocked { color: var(--red, #e07070); }
.admin-cal-day.other { color: var(--muted, #9a9580); text-decoration: line-through; }
.admin-cal-day.selected { background: var(--gold); color: #0f0e0c; font-weight: 700; }

.admin-cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.admin-cal-week-col {
  text-align: center;
  padding: 8px 2px;
  border-radius: 8px;
  color: var(--muted, #9a9580);
  cursor: pointer;
  border: 1px solid transparent;
}
.admin-cal-week-col .dow { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-cal-week-col .dnum { font-size: 14px; margin-top: 2px; }
.admin-cal-week-col:hover { border-color: var(--border); }
.admin-cal-week-col.available { color: var(--text, #e8e0d0); }
.admin-cal-week-col.booked { color: var(--gold); font-weight: 700; background: rgba(201,168,76,0.1); }
.admin-cal-week-col.blocked { color: var(--red, #e07070); }
.admin-cal-week-col.other { color: var(--muted, #9a9580); text-decoration: line-through; }
.admin-cal-week-col.selected { background: rgba(201,168,76,0.15); border-color: var(--gold); color: var(--gold); }

/* ── Admin Day View Panel ── */
.day-view-panel {
  position: fixed;
  top: 0; right: -420px;
  width: 420px; height: 100vh;
  background: var(--card, #22201c);
  border-left: 1px solid var(--border);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}
.day-view-panel.open { right: 0; }

.day-view-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card, #22201c);
  z-index: 1;
}
.day-view-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--gold);
  text-align: center;
}
.day-nav-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text, #e8e0d0);
  border-radius: 6px;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.day-view-close {
  background: none;
  border: none;
  color: var(--muted, #9a9580);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  margin-left: auto;
}
.day-view-body { padding: 12px 16px; flex: 1; }

/* Slot rows in day view */
.dv-slot {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  position: relative;
}
.dv-slot.available { border-color: var(--border); opacity: 0.6; }
.dv-slot.booked    { border-color: var(--gold); background: rgba(201,168,76,0.06); }
.dv-slot.blocked   { border-color: #7B1D22; background: rgba(123,29,34,0.08); opacity: 0.7; }
.dv-slot.cancelled { opacity: 0.4; text-decoration: line-through; }

.dv-time {
  font-size: 12px;
  color: var(--muted, #9a9580);
  font-weight: 600;
  margin-bottom: 4px;
}
.dv-client {
  font-size: 14px;
  color: var(--text, #e8e0d0);
  font-weight: 600;
}
.dv-meta {
  font-size: 11px;
  color: var(--muted, #9a9580);
  margin-top: 2px;
}
.dv-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.wa-btn {
  background: rgba(37,211,102,0.12);
  border-color: #25D366;
  color: #25D366;
  text-decoration: none;
}
.wa-btn:hover { background: rgba(37,211,102,0.22); }

/* Day view panel — bottom sheet on mobile instead of right-edge slide-in */
@media (max-width: 768px) {
  .day-view-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: -70vh;
    width: auto;
    height: 70vh;
    border-left: none;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
    transition: bottom 0.3s ease;
  }
  .day-view-panel.open { bottom: 0; }
}

/* ── CRM List View ──
   --muted isn't defined in this file's own :root (only in admin.html's
   local :root, the only page using these classes) — literal fallbacks
   match admin.html's actual value, same pattern as the admin-cal-* rules. */
.crm-list-hdr {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: nowrap; /* keep search/sort/Add Client on one row on desktop --
                        see the mobile override below for narrow screens */
}
/* min-width:0 overrides the flex-item default of min-width:auto (which is
   based on content size and was the actual cause of the Add Client button
   wrapping onto its own line -- two 180px-min fields plus the button could
   exceed the row's width at plenty of realistic window sizes). */
.crm-list-hdr .field-input { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.crm-list-hdr .btn-gold { flex-shrink: 0; white-space: nowrap; }

.crm-client-row {
  display: grid;
  grid-template-columns: 2fr 40px 40px 1.3fr 1.2fr 90px 80px;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.crm-client-row:hover { background: rgba(201,168,76,0.05); }
.crm-client-row.birthday { border-left: 3px solid var(--gold); }
/* The header row also carries .tbl-hdr (for its uppercase-label styling).
   .tbl-hdr sets its own grid-template-columns (a different, 6-column
   template for other admin tables) in admin.html's inline <style>, which
   comes after this linked stylesheet in the cascade -- so with equal
   (single-class) specificity it was winning over .crm-client-row's grid
   entirely, misaligning the header against the data rows below it. This
   two-class selector has higher specificity than either alone, so it
   always wins regardless of source order. */
.crm-client-row.tbl-hdr { grid-template-columns: 2fr 40px 40px 1.3fr 1.2fr 90px 80px; }

/* Status pills */
.status-active   { color: #5DC8A0; }
.status-followup { color: var(--gold); }
.status-dormant  { color: var(--muted, #9a9580); }
.status-new      { color: #7B9FE0; }

/* ── CRM Profile View ── */
.crm-profile-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.crm-profile-name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold);
}
.crm-profile-id {
  font-size: 11px;
  color: var(--muted, #9a9580);
  margin-top: 2px;
}
.crm-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* WhatsApp dropdown menu (profile header + per-session) */
.crm-wa-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--card, #22201c);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  z-index: 50;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

@media (max-width: 768px) {
  .crm-two-col { grid-template-columns: 1fr; }
  .crm-client-row {
    grid-template-columns: 1fr 1fr;
    font-size: 12px;
  }
  /* .crm-client-row.tbl-hdr's own override normally beats the plain
     .crm-client-row rule above regardless of viewport (higher specificity,
     no media query) -- this re-asserts the 2-column mobile layout for the
     header specifically, keeping it in sync with the data rows. */
  .crm-client-row.tbl-hdr { grid-template-columns: 1fr 1fr; }
  .crm-list-hdr { flex-wrap: wrap; }
  .crm-list-hdr .field-input { flex: 1 1 100%; }
  .crm-list-hdr .btn-gold { flex: 1 1 100%; }
}
