/* ==========================================================================
   Limitless Tress — brand stylesheet
   Palette pulled directly from the practice's existing intake form:
   brown  #6b3725  |  gold #c9a96a  |  cream #f7f1e6
   ========================================================================== */

:root {
  --brown-900: #43220f;
  --brown-700: #6b3725;
  --brown-600: #7d4530;
  --gold-500: #c9a96a;
  --gold-300: #dec99f;
  --gold-100: #f2e6cd;
  --cream-50: #faf6ee;
  --cream-100: #f2ebdd;
  --ink-900: #2a211b;
  --ink-600: #5b4d43;
  --line: #e2d3bd;
  --white: #fffdfa;
  --error: #a3372a;
  --success: #3f6b3a;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-w: 1120px;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink-900);
  background: var(--cream-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--brown-900);
}

h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; max-width: 62ch; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--gold-500);
  margin: 0 0 0.6em;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 500;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--brown-700);
  color: var(--white);
}

#btn-primary-color {
  color: var(--white);
  word-wrap: break-word;
  padding: 13px 26px;
  border-radius: var(--radius);
}

.btn-primary:hover { background: var(--brown-900); }
.btn-primary:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

.btn-outline {
  background: transparent;
  color: var(--brown-700);
  border-color: var(--brown-700);
}
.btn-outline:hover { background: var(--brown-700); color: var(--white); }
.btn-outline:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

.btn-gold {
  background: var(--gold-500);
  color: var(--brown-900);
}
.btn-gold:hover { background: var(--gold-300); }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- header / nav ---------- */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img { height: 34px; width: auto; }

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--brown-900);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-600);
  font-size: 0.96rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--brown-700);
  border-bottom-color: var(--gold-500);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--brown-700);
  cursor: pointer;
}

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 24px; border-bottom: 1px solid var(--cream-100); }
  .nav-links .btn { margin: 14px 24px; }
}

/* ---------- hero ---------- */

.hero {
  background: var(--brown-700);
  color: var(--cream-50);
  padding: 70px 24px 84px;
  text-align: center;
}

.hero .emblem {
  height: 64px;
  width: auto;
  margin: 0 auto 22px;
  filter: brightness(0) invert(1) sepia(0.35) saturate(3) hue-rotate(-10deg);
}

.hero h1 { color: var(--white); max-width: 16ch; margin-left: auto; margin-right: auto; }

.hero .lede {
  color: var(--gold-100);
  max-width: 52ch;
  margin: 18px auto 32px;
  font-size: 1.08rem;
}

.hero .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- sections ---------- */

.section { padding: 72px 24px; }
.section-tight { padding: 48px 24px; }
.section-alt { background: var(--cream-100); }
.section-dark { background: var(--brown-900); color: var(--gold-100); }
.section-dark h2 { color: var(--white); }

.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head p { margin: 0 auto; }

/* concern grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
}

.card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.card p { font-size: 0.95rem; color: var(--ink-600); margin: 0; }

/* steps (genuine sequence) */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  counter-reset: step;
}

.step {
  position: relative;
  padding-left: 46px;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gold-500);
  color: var(--gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 0.95rem;
}

.step h3 { font-size: 1.05rem; }
.step p { font-size: 0.94rem; }

/* ---------- forms ---------- */

.form-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 26px;
}

.form-section h2 {
  font-size: 1.25rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 22px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.form-row .field { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-600);
  margin-bottom: 6px;
}

.field .hint { font-size: 0.82rem; color: var(--ink-600); opacity: 0.8; margin-top: 5px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.98rem;
  color: var(--ink-900);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
}

textarea { resize: vertical; min-height: 90px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 169, 106, 0.28);
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

fieldset legend {
  font-size: 0.9rem;
  color: var(--ink-600);
  margin-bottom: 10px;
  padding: 0;
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.choice span {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--ink-600);
  background: var(--white);
  transition: all 0.12s ease;
}

.choice input:checked + span {
  background: var(--brown-700);
  border-color: var(--brown-700);
  color: var(--white);
}

.choice input:focus-visible + span {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

.consent-box {
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 0.92rem;
  color: var(--ink-600);
  margin-bottom: 20px;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-line input { margin-top: 4px; width: 17px; height: 17px; flex-shrink: 0; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
}

.form-msg {
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 0.95rem;
  margin-bottom: 24px;
  display: none;
}

.form-msg.show { display: block; }
.form-msg.success { background: #eaf3e8; color: var(--success); border: 1px solid #c7ddc3; }
.form-msg.error { background: #fbeae7; color: var(--error); border: 1px solid #edc8c1; }

.field.has-error > label,
.field.has-error legend {
  color: var(--error);
}

.field.has-error input[type="text"],
.field.has-error input[type="tel"],
.field.has-error input[type="email"],
.field.has-error input[type="date"] {
  border-color: var(--error);
}

.field.has-error input[type="text"]:focus,
.field.has-error input[type="tel"]:focus,
.field.has-error input[type="email"]:focus,
.field.has-error input[type="date"]:focus {
  box-shadow: 0 0 0 3px rgba(163, 55, 42, 0.22);
}

.field.has-error input[type="checkbox"] {
  outline: 2px solid var(--error);
  outline-offset: 2px;
}

.field-error {
  color: var(--error);
  font-size: 0.82rem;
  margin-top: 6px;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--brown-900);
  color: var(--gold-100);
  padding: 52px 24px 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  max-width: var(--max-w);
  margin: 0 auto 30px;
}

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.site-footer h4 {
  color: var(--white);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.site-footer p, .site-footer a { color: var(--gold-100); font-size: 0.92rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--white); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid rgba(242, 230, 205, 0.18);
  font-size: 0.82rem;
  color: rgba(242, 230, 205, 0.7);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- page header (non-home pages) ---------- */

.page-head {
  background: var(--cream-100);
  padding: 48px 24px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

/* ---------- admin ---------- */

.admin-shell { max-width: 780px; margin: 60px auto; padding: 0 24px; }

.admin-login {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 380px;
  margin: 90px auto;
}

table.submissions {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
}

table.submissions th, table.submissions td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

table.submissions th { color: var(--ink-600); font-weight: 500; background: var(--cream-100); }
table.submissions tr:last-child td { border-bottom: none; }
table.submissions tbody tr { cursor: pointer; }
table.submissions tbody tr:hover { background: var(--cream-50); }

.status-pill {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--gold-100);
  color: var(--brown-900);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 33, 27, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  z-index: 100;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  padding: 32px;
}

.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--ink-600);
}

.detail-grid dt {
  font-size: 0.8rem;
  color: var(--ink-600);
  margin-top: 14px;
}
.detail-grid dd { margin: 3px 0 0; font-size: 0.96rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--brown-700);
  color: var(--white);
  padding: 10px 16px;
  z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
