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

:root {
  --primary: #7C3AED;
  --primary-dark: #6D28D9;
  --secondary: #34a853;
  --danger: #d93025;
  --warning: #f9ab00;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #dadce0;
  --text: #202124;
  --text-secondary: #5f6368;
  --shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --radius: 8px;
}

html { font-size: 16px; scroll-padding-top: 72px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.75rem; font-weight: 600; }
h2 { font-size: 1.375rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 1.5rem; }

/* ── HEADER ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.logo span { color: var(--text-secondary); font-weight: 400; font-size: .875rem; }

.nav { display: flex; align-items: center; gap: 1rem; }
.nav a { color: var(--text-secondary); font-size: .9375rem; padding: .375rem .75rem; border-radius: var(--radius); transition: background .15s; }
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--primary); }

/* ── MAIN CONTENT ── */
main { flex: 1; padding: 2rem 0; }

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.card-title { margin-bottom: 1.25rem; color: var(--text); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary { background: var(--primary); color: #ffffff !important; }
.btn-primary:hover { background: var(--primary-dark) !important; box-shadow: var(--shadow-md); color: #ffffff !important; }

.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b7271d; }

.btn-success { background: var(--secondary); color: #fff; }
.btn-success:hover { background: #2d9144; }

.btn-sm { padding: .3125rem .875rem; font-size: .875rem; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1.0625rem; }

/* ── FORM ── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: .375rem; font-weight: 500; font-size: .9375rem; }
.form-label .required { color: var(--danger); margin-left: .2rem; }

.form-control {
  width: 100%;
  padding: .5625rem .875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9375rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

.form-control::placeholder { color: #9aa0a6; }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 96px; }

.form-text { font-size: .8125rem; color: var(--text-secondary); margin-top: .25rem; }
.form-error { font-size: .8125rem; color: var(--danger); margin-top: .25rem; }

/* ── ALERT ── */
.alert { padding: .875rem 1.125rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9375rem; }
.alert-info { background: #EDE9FE; color: #6D28D9; border: 1px solid #c5d7fc; }
.alert-success { background: #e6f4ea; color: #1e7e34; border: 1px solid #b5dfc0; }
.alert-warning { background: #fef7e0; color: #b06b00; border: 1px solid #fde594; }
.alert-danger { background: #fce8e6; color: #c5221f; border: 1px solid #f5c6c4; }

/* ── TABLE ── */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th { text-align: left; padding: .75rem 1rem; font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8f9fa; }

/* ── BADGE ── */
.badge { display: inline-block; padding: .2rem .625rem; border-radius: 9999px; font-size: .75rem; font-weight: 500; }
.badge-scheduled { background: #EDE9FE; color: #6D28D9; }
.badge-completed { background: #e6f4ea; color: #1e7e34; }
.badge-cancelled { background: #fce8e6; color: #c5221f; }
.badge-noshow { background: #fef7e0; color: #b06b00; }
.badge-archived { background: #f1f3f4; color: #80868b; }
.badge-draft { background: #f1f3f4; color: #5f6368; }
.badge-paid { background: #e6f4ea; color: #1e7e34; }
.badge-pending { background: #fef7e0; color: #b06b00; }

/* ── STATS GRID ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: .8125rem; color: var(--text-secondary); margin-top: .375rem; }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }

/* ── FOOTER ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.footer-disclaimer { font-size: .8rem; color: var(--text-secondary); max-width: 700px; line-height: 1.5; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { font-size: .875rem; color: var(--text-secondary); }

/* ── HERO (public landing) ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0d47a1 100%);
  color: #fff;
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero p { font-size: 1.1875rem; opacity: .9; max-width: 560px; margin: 0 auto 2rem; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin: 3rem 0; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature-title { font-weight: 600; margin-bottom: .5rem; }
.feature-desc { color: var(--text-secondary); font-size: .9375rem; line-height: 1.5; }

/* ── AUTH PAGES ── */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-container { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 440px; box-shadow: var(--shadow-md); }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo-text { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.auth-logo .logo-sub { font-size: .875rem; color: var(--text-secondary); }
.auth-logo-link { display: inline-block; text-decoration: none; cursor: pointer; border-radius: var(--radius); padding: .25rem .5rem; margin: -.25rem -.5rem; transition: opacity .15s; }
.auth-logo-link:hover { opacity: .75; }

/* ── SIDEBAR LAYOUT ── */
.app-layout { display: flex; min-height: calc(100vh - 64px); }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .625rem 1.5rem;
  color: var(--text-secondary);
  font-size: .9375rem;
  transition: background .15s, color .15s;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: #EDE9FE;
  color: var(--primary);
  text-decoration: none;
}

.sidebar-nav li a .nav-icon { font-size: 1.125rem; width: 1.25rem; text-align: center; }

.app-content { flex: 1; padding: 2rem; overflow-y: auto; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-secondary); line-height: 1; }
.modal-footer { margin-top: 1.5rem; display: flex; justify-content: flex-end; gap: .75rem; }

/* ── STAR RATING ── */
.star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .25rem; }
.star-rating input { display: none; }
.star-rating label { font-size: 1.75rem; color: #dadce0; cursor: pointer; transition: color .1s; }
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: #f9ab00; }

/* ── BOOKING CALENDAR ── */
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: .5rem; margin-top: .75rem; }
.slot-btn {
  padding: .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-size: .875rem;
  text-align: center;
  transition: background .15s, border-color .15s;
}

.slot-btn:hover { background: #EDE9FE; border-color: var(--primary); }
.slot-btn.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── CALENDAR ── */
.cal-controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.cal-title {
  font-size: 1.125rem;
  font-weight: 600;
  min-width: 200px;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-header-cell {
  background: var(--surface);
  padding: .5rem;
  text-align: center;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cal-cell {
  background: var(--surface);
  min-height: 90px;
  padding: .375rem .5rem;
  cursor: pointer;
  transition: background .1s;
  vertical-align: top;
}

.cal-cell:hover { background: #f0f4ff; }
.cal-cell.other-month { background: #fafafa; }
.cal-cell.other-month .cal-day-num { color: #c8cacc; }
.cal-cell.today { background: #EDE9FE; }
.cal-cell.today .cal-day-num { color: var(--primary); font-weight: 700; }
.cal-cell.selected { outline: 2px solid var(--primary); outline-offset: -2px; }

.cal-day-num { font-size: .8125rem; font-weight: 500; margin-bottom: .25rem; }

.cal-apt {
  font-size: .7rem;
  padding: .1rem .3rem;
  border-radius: 3px;
  margin-bottom: .125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  line-height: 1.5;
}

.cal-apt.status-scheduled { background: #EDE9FE; color: #6D28D9; }
.cal-apt.status-completed { background: #e6f4ea; color: #1e7e34; }
.cal-apt.status-cancelled { background: #f1f3f4; color: #9aa0a6; text-decoration: line-through; }
.cal-apt.status-noshow { background: #fef7e0; color: #b06b00; }
.cal-apt.status-archived { background: #f1f3f4; color: #80868b; opacity: .6; }

.cal-apt-more { font-size: .7rem; color: var(--primary); padding: .1rem .3rem; }

/* ── DAY VIEW ── */
.day-view-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.day-apt-list { display: flex; flex-direction: column; gap: .75rem; }

.day-apt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  cursor: pointer;
  transition: box-shadow .15s;
}

.day-apt-card:hover { box-shadow: var(--shadow-md); }
.day-apt-card.status-completed { border-left-color: var(--secondary); }
.day-apt-card.status-cancelled { border-left-color: #dadce0; opacity: .6; }
.day-apt-card.status-noshow { border-left-color: var(--warning); }
.day-apt-card.status-archived { border-left-color: #dadce0; opacity: .5; }

.day-apt-time {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  min-width: 56px;
}

.day-apt-info { flex: 1; }
.day-apt-patient { font-weight: 600; font-size: .9375rem; }
.day-apt-meta { font-size: .875rem; color: var(--text-secondary); margin-top: .2rem; }

/* ── LIMIT BAR ── */
.limit-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .875rem;
}

.limit-bar.warning { background: #fef7e0; color: #b06b00; border: 1px solid #fde594; }
.limit-bar.danger  { background: #fce8e6; color: #c5221f; border: 1px solid #f5c6c4; }

.limit-progress {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
  max-width: 200px;
}

.limit-progress-inner {
  height: 100%;
  border-radius: 9999px;
  transition: width .3s;
}

/* ── PACKAGE SELECTION ── */
.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 1rem; margin-bottom: 1rem; }

.package-card { cursor: pointer; display: block; }

.package-card input[type="radio"] { display: none; }

.package-inner {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color .15s, background .15s;
}

.package-card input[type="radio"]:checked + .package-inner {
  border-color: var(--primary);
  background: #EDE9FE;
}

.package-card:hover .package-inner { border-color: var(--primary); }

.package-name { font-weight: 700; font-size: .9375rem; color: var(--text); margin-bottom: .2rem; }
.package-price { font-size: .8125rem; font-weight: 600; color: var(--primary); margin-bottom: .5rem; }
.package-badge { display: inline-block; font-size: .625rem; font-weight: 700; background: var(--primary); color: #fff; padding: .1rem .4rem; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4rem; }

.package-features { list-style: none; padding: 0; margin: 0; }

.package-features li {
  font-size: .875rem;
  color: var(--text-secondary);
  padding: .2rem 0;
}

.package-features li::before { content: '✓ '; color: var(--secondary); }

/* ── FORM GRID ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem 1.25rem; }

/* ── FORM SECTION TITLES ── */
.form-section-title {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}

/* ── EXTRA BADGES ── */
.badge-basic { background: #EDE9FE; color: #6D28D9; }
.badge-unlimited { background: #e6f4ea; color: #1e7e34; }
.badge-waiting { background: #fef7e0; color: #b06b00; }

/* ── FILTER TABS ── */
.filter-tabs { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

.filter-tab {
  padding: .375rem .875rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--surface);
  font-size: .875rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background .15s, color .15s, border-color .15s;
}

.filter-tab:hover { background: #EDE9FE; color: var(--primary); border-color: var(--primary); }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── INVOICE ITEMS ── */
.items-table { width: 100%; border-collapse: collapse; margin-bottom: .75rem; }
.items-table th { font-size: .8125rem; color: var(--text-secondary); font-weight: 600; padding: .375rem .5rem; border-bottom: 1px solid var(--border); }
.items-table td { padding: .375rem .5rem; vertical-align: top; }
.items-table input { margin: 0; }

.invoice-totals {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  margin-top: .5rem;
  font-size: .9375rem;
}

.invoice-totals-row { display: flex; justify-content: space-between; padding: .2rem 0; }
.invoice-totals-row.total { font-weight: 700; border-top: 1px solid var(--border); margin-top: .375rem; padding-top: .5rem; font-size: 1rem; }

/* ── RECIPE LOG ── */
.recipe-info-banner {
  background: #EDE9FE;
  border: 1px solid #c5d7fc;
  border-radius: var(--radius);
  padding: .875rem 1.125rem;
  font-size: .875rem;
  color: #6D28D9;
  margin-bottom: 1.25rem;
}

/* ── PRACTITIONER / PATIENT TABLES ── */
tr td .btn + .btn { margin-left: .375rem; }
code { font-family: 'SFMono-Regular', Consolas, monospace; }

/* ── RESPONSIVE ── */
/* ── STEP INDICATOR ── */
.step-indicator { display: flex; align-items: center; margin-bottom: 1.25rem; }
.step { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.step-num { width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .8125rem; font-weight: 600; color: var(--text-secondary); background: var(--surface); }
.step-label { font-size: .875rem; color: var(--text-secondary); }
.step.active .step-num { border-color: var(--primary); background: var(--primary); color: #fff; }
.step.active .step-label { color: var(--primary); font-weight: 600; }
.step.done .step-num { border-color: var(--secondary); background: var(--secondary); color: #fff; }
.step.done .step-label { color: var(--secondary); }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 .5rem; }

/* ── BOOKING CALENDAR ── */
.booking-cal { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.booking-cal-header { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: var(--bg); border-bottom: 1px solid var(--border); }
.cal-nav-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius); width: 2rem; height: 2rem; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; color: var(--text); }
.cal-nav-btn:hover { background: var(--border); }
.booking-cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg); border-bottom: 1px solid var(--border); }
.cal-wd { text-align: center; padding: .4rem 0; font-size: .75rem; font-weight: 600; color: var(--text-secondary); }
.booking-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: .5rem; gap: .25rem; }
.cal-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); font-size: .9375rem; cursor: default; }
.cal-empty { }
.cal-past { color: var(--border); }
.cal-avail { cursor: pointer; font-weight: 600; color: var(--secondary); background: rgba(52,168,83,.08); }
.cal-avail:hover { background: rgba(52,168,83,.2); }
.cal-selected { background: var(--primary) !important; color: #fff !important; }
.cal-loading { grid-column: span 7; text-align: center; padding: 1.5rem; color: var(--text-secondary); font-size: .875rem; }

/* ── PRACTITIONER CARDS ── */
.prac-cards { display: flex; flex-wrap: wrap; gap: .625rem; }
.prac-card { border: 2px solid var(--border); border-radius: var(--radius); padding: .625rem .875rem; cursor: pointer; transition: border-color .15s, background .15s; }
.prac-card:hover { border-color: var(--primary); background: rgba(26,115,232,.04); }
.prac-card.selected { border-color: var(--primary); background: rgba(26,115,232,.08); }
.prac-name { font-weight: 600; font-size: .9375rem; }
.prac-specialty { font-size: .8125rem; color: var(--text-secondary); margin-top: .125rem; }

/* ── AUTOMATION CARD ── */
.automation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.automation-item { text-align: center; padding: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.automation-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.automation-value-sm { font-size: 1rem; font-weight: 600; }
.automation-label { font-size: .8125rem; color: var(--text-secondary); margin-top: .25rem; }

/* ── WAITLIST FORM (public) ── */
.waitlist-form-card { max-width: 560px; margin: 2rem auto; }
.star-rating { display: flex; flex-direction: row-reverse; gap: .25rem; justify-content: flex-end; }
.star-rating input { display: none; }
.star-rating label { font-size: 2rem; color: var(--border); cursor: pointer; }
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: var(--warning); }

/* ── LANGUAGE SWITCHER ── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: .375rem;
}

.lang-switcher select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .25rem .5rem;
  font-size: .8125rem;
  color: var(--text-secondary);
  background: var(--surface);
  cursor: pointer;
}

.lang-switcher select:focus { outline: none; border-color: var(--primary); }

/* ── SUBSCRIPTION CARD ── */
.subscription-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: .75rem;
}

.subscription-plan-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  transition: border-color .15s;
}

.subscription-plan-card.current {
  border-color: var(--primary);
  background: #EDE9FE;
}

.subscription-plan-card.upgrade {
  border-color: var(--secondary);
}

.subscription-plan-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.subscription-plan-price {
  font-size: .875rem;
  color: var(--text-secondary);
  margin-bottom: .75rem;
}

/* ── PAUSED BANNER ── */
#paused-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--danger);
  color: #fff;
  text-align: center;
  padding: .875rem 1rem;
  font-size: .9375rem;
  font-weight: 500;
}

/* ── TRIAL BANNER ── */
.trial-banner {
  background: #fef7e0;
  border: 1px solid #fde594;
  border-radius: var(--radius);
  padding: .75rem 1.125rem;
  font-size: .875rem;
  color: #b06b00;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.trial-banner.expired {
  background: #fce8e6;
  border-color: #f5c6c4;
  color: #c5221f;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .app-content { padding: 1.25rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .logo span { display: none; }
}

/* ── HAMBURGER MENU ── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  transition: background .15s;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--bg); }
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--surface);
  z-index: 400;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
  box-shadow: 4px 0 16px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  visibility: hidden;
}
.mobile-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

/* RTL: drawer slides from right */
[dir="rtl"] .mobile-drawer {
  left: auto;
  right: 0;
  transform: translateX(100%);
  box-shadow: -4px 0 16px rgba(0,0,0,.15);
}
[dir="rtl"] .mobile-drawer.open { transform: translateX(0); }

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  min-height: 64px;
  flex-shrink: 0;
}

.mobile-drawer-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  border-radius: var(--radius);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.mobile-drawer-close:hover { background: var(--bg); color: var(--text); }

.mobile-drawer .sidebar-nav { padding: .5rem 0; }
.mobile-drawer .sidebar-nav li a {
  padding: .875rem 1.5rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .625rem;
  color: var(--text-secondary);
  font-size: .9375rem;
  transition: background .15s, color .15s;
}
.mobile-drawer .sidebar-nav li a:hover,
.mobile-drawer .sidebar-nav li a.active {
  background: #EDE9FE;
  color: var(--primary);
  text-decoration: none;
}
.mobile-drawer .sidebar-nav li a .nav-icon { font-size: 1.125rem; width: 1.25rem; text-align: center; }

/* Mobile-only rules */
@media (max-width: 768px) {
  .hamburger-btn { display: flex; }
  .sidebar { display: none !important; }
  .app-layout { flex-direction: column; }
  .app-content { padding: 1rem; }
  #user-name { display: none; }
  /* Public page nav links moved into hamburger drawer on mobile */
  .nav-hide-mobile { display: none !important; }
}

/* ── HERO WITH IMAGE ── */
.hero { text-align: left; padding: 5rem 0; }
.hero p { margin: 0 0 2rem; max-width: none; }

.hero-inner {
  display: flex;
  align-items: center;
  gap: 3.5rem;
}

.hero-content { flex: 1; min-width: 0; }

.hero-image-col {
  flex: 0 0 560px;
  max-width: 560px;
}

.hero-img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,.32);
  display: block;
}

/* ── FEATURES SECTION ── */
.features-section {
  padding: 3.5rem 0 4rem;
}

.features-heading {
  text-align: center;
  margin-bottom: 2rem;
}

.features-banner-wrap {
  width: 100%;
  margin-bottom: 2.75rem;
}

/* Natürliches Seitenverhältnis (1.73:1) – kein Crop auf Mobile/Tablet */
.features-banner-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.07);
}

/* Desktop: max-height begrenzt Höhe – object-fit:cover schneidet nur minimal
   Decke/Boden (je ~10%), alle Personen bleiben vollständig sichtbar */
@media (min-width: 1024px) {
  .features-banner-img {
    max-height: 620px;
    object-fit: cover;
    object-position: center center;
  }
}

@media (max-width: 1200px) {
  .hero-image-col { flex: 0 0 460px; max-width: 460px; }
  .hero-img { height: 420px; }
}

@media (max-width: 1024px) {
  .hero-image-col { flex: 0 0 380px; max-width: 380px; }
  .hero-img { height: 360px; }
}

@media (max-width: 768px) {
  .hero { text-align: center; padding: 3.5rem 0; }
  .hero p { margin: 0 auto 2rem; max-width: 560px; }
  .hero-inner { flex-direction: column; gap: 2rem; }
  .hero-image-col { flex: none; max-width: 100%; width: 100%; }
  .hero-img { height: 260px; }
  .features-section { padding: 2.5rem 0 3rem; }
}

/* ── PASSWORD TOGGLE ── */
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 2.75rem; }
.pw-toggle {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  padding: 0;
  transition: color .15s, background .15s;
}
.pw-toggle:hover { color: var(--primary); background: var(--bg); }
.pw-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
