/* ---------- Design tokens & theming ---------- */
:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #eef1f5;
    --text: #1c2530;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #4f8a8b;      /* calm teal */
    --primary-dark: #3c6d6e;
    --primary-soft: #e4f0f0;
    --accent: #e6a15c;
    --danger: #d16565;
    --radius: 14px;
    --shadow: 0 4px 20px rgba(20, 40, 60, 0.06);
    --maxw: 1080px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-theme="dark"] {
    --bg: #10151b;
    --surface: #1a222c;
    --surface-2: #232d39;
    --text: #e6edf3;
    --muted: #94a3b8;
    --border: #2b3846;
    --primary: #6fb0b1;
    --primary-dark: #5b9899;
    --primary-soft: #1e2e2e;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.page { padding-top: 32px; padding-bottom: 64px; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Header ---------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { font-weight: 700; font-size: 1.25rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--primary); }
.main-nav { display: flex; gap: 18px; margin-left: 12px; flex: 1; }
.main-nav a { color: var(--muted); font-weight: 500; }
.main-nav a:hover { color: var(--text); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem;
    border: 1px solid transparent; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-icon { background: transparent; border: none; font-size: 1.2rem; cursor: pointer; padding: 6px; border-radius: 8px; }
.btn-icon:hover { background: var(--surface-2); }

/* ---------- Cards & layout ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .main-nav { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 14px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Role chooser ---------- */
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 12px; }
@media (max-width: 820px) { .role-grid { grid-template-columns: 1fr; } }
.role-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.role-card .emoji { font-size: 2.4rem; }
.role-card h3 { margin: 12px 0 6px; }
.role-card p { color: var(--muted); flex: 1; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], input[type=date], select, textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--surface); color: var(--text); font-size: 1rem;
    font-family: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0 8px; }
.checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }
.radio-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pills label {
    border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; cursor: pointer;
    margin: 0; font-weight: 500; display: flex; align-items: center; gap: 8px;
}
.radio-pills input { width: auto; }
.radio-pills input:checked + span { font-weight: 700; }

/* ---------- Flash & alerts ---------- */
.flash {
    background: var(--primary-soft); border: 1px solid var(--primary);
    color: var(--primary-dark); padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
}
.alert-error { background: #fdecec; border: 1px solid var(--danger); color: #a13c3c; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
[data-theme="dark"] .alert-error { background: #2a1a1a; }

/* ---------- Therapist cards ---------- */
.therapist { display: flex; gap: 16px; }
.avatar {
    width: 64px; height: 64px; border-radius: 50%; background: var(--primary-soft);
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
    font-weight: 700; color: var(--primary-dark); flex-shrink: 0;
}
.avatar.lg { width: 96px; height: 96px; font-size: 2rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: .8rem; }
.tag.primary { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- Pills / steps ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.step { flex: 1; text-align: center; padding: 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: .85rem; font-weight: 600; }
.step.active { background: var(--primary); color: #fff; }
.step.done { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- Calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.cal-day { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); }
.cal-day h4 { margin: 0 0 8px; font-size: .9rem; }
.slot { display: block; width: 100%; margin-bottom: 6px; padding: 7px; border: 1px solid var(--primary); background: transparent; color: var(--primary-dark); border-radius: 8px; cursor: pointer; font-weight: 600; }
.slot:hover { background: var(--primary-soft); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

/* ---------- Misc ---------- */
.section { margin: 48px 0; }
.section h2 { margin-bottom: 4px; }
.divider { height: 1px; background: var(--border); margin: 24px 0; border: 0; }
.badge { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; }
.badge.ok { background: var(--primary); }
.badge.warn { background: var(--accent); }
.list-reset { list-style: none; padding: 0; margin: 0; }
.stack > * + * { margin-top: 14px; }
.center { text-align: center; }
.auth-wrap { max-width: 420px; margin: 40px auto; }
.notice-box { background: var(--surface-2); border-radius: 12px; padding: 16px; }
