@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  --navy: #102a43;
  --navy-2: #163f59;
  --ink: #172b3a;
  --muted: #667986;
  --line: #dbe6eb;
  --surface: #f4f8fa;
  --white: #fff;
  --mint: #51e3c2;
  --mint-dark: #0f806d;
  --cyan: #daf8f2;
  --danger: #a73543;
  --danger-bg: #fff0f2;
  --warning: #9d5b12;
  --warning-bg: #fff6df;
  --shadow: 0 20px 60px rgba(11, 42, 57, .12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--surface); font-family: 'DM Sans', system-ui, sans-serif; line-height: 1.55; }
button, input, select { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: 'Manrope', system-ui, sans-serif; line-height: 1.14; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 4vw, 3.7rem); }
h2 { font-size: 1.35rem; }
input, select { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: .8rem .9rem; min-height: 46px; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus { border-color: var(--mint-dark); box-shadow: 0 0 0 3px rgba(81, 227, 194, .24); }
label { display: grid; gap: .45rem; font-size: .9rem; font-weight: 600; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }

.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; font-family: 'Manrope', sans-serif; font-size: 1.02rem; }
.brand-mark { width: 2.2rem; height: 2.2rem; border-radius: 9px; display: inline-grid; place-items: center; color: var(--navy); background: var(--mint); font-weight: 800; }
.brand--light { color: #fff; }
.eyebrow { color: var(--mint-dark); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: .72rem; margin-bottom: 1rem; }
.eyebrow--light { color: var(--mint); }
.button { border: 0; border-radius: 10px; padding: .78rem 1.05rem; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: .6rem; font-weight: 700; text-decoration: none; transition: transform .15s, background .2s; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--navy); color: #fff; }
.button--primary:hover { background: var(--navy-2); }
.button--accent { background: var(--mint); color: var(--navy); }
.button--accent:hover { background: #74ead0; }
.button--ghost { background: #fff; border: 1px solid var(--line); }
.button--small { min-height: 36px; padding: .4rem .7rem; background: var(--navy); color: #fff; font-size: .8rem; }
.button--full { width: 100%; }
.flash { position: fixed; z-index: 20; top: 1rem; left: 50%; transform: translateX(-50%); max-width: min(92vw, 680px); padding: .9rem 1.1rem; border-radius: 10px; box-shadow: var(--shadow); background: var(--navy); color: #fff; font-weight: 600; }
.flash--error, .inline-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f2c8cf; }
.inline-error { padding: .8rem .9rem; border-radius: 10px; font-size: .9rem; margin-bottom: 1rem; }

.access-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .9fr) 1.1fr; }
.access-aside { min-height: 100%; background: var(--navy); color: #fff; padding: clamp(2rem, 5vw, 5.5rem); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.access-aside::after { content: ''; width: 360px; height: 360px; border: 72px solid rgba(81, 227, 194, .08); border-radius: 50%; position: absolute; right: -170px; bottom: 10%; }
.access-copy { max-width: 620px; position: relative; z-index: 1; }
.access-copy h1 { font-size: clamp(2.6rem, 5vw, 5.2rem); max-width: 9ch; margin-bottom: 1.6rem; }
.access-copy p { color: #c7d8e2; font-size: 1.12rem; max-width: 34rem; }
.privacy-note { display: flex; align-items: center; gap: .7rem; color: #d8e6ec; font-size: .9rem; position: relative; z-index: 1; }
.privacy-note span { color: var(--mint); font-size: .65rem; }
.access-form-wrap { display: grid; place-items: center; padding: 2rem; }
.access-form { width: min(100%, 470px); }
.access-form h2 { font-size: clamp(1.8rem, 3vw, 2.55rem); margin-bottom: .8rem; }
.access-form > p { color: var(--muted); margin-bottom: 2.2rem; }
.code-input { min-height: 58px; font-family: 'Manrope', sans-serif; letter-spacing: .12em; font-size: 1.05rem; margin-bottom: 1rem; text-transform: uppercase; }
.access-form .button { margin-top: .3rem; min-height: 54px; }
.trust-row { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; color: var(--muted); font-size: .78rem; }
.trust-row span::before { content: '✓'; color: var(--mint-dark); font-weight: 800; margin-right: .35rem; }

.booking-page { min-height: 100vh; background: var(--navy); }
.booking-header { max-width: 1240px; margin: auto; padding: 1.4rem 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.company-chip { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.13); border-radius: 999px; padding: .45rem .55rem .45rem .9rem; display: flex; align-items: center; gap: .8rem; color: #fff; font-size: .85rem; }
.company-chip a { background: #fff; color: var(--navy); border-radius: 999px; padding: .28rem .65rem; text-decoration: none; font-weight: 700; }
.booking-grid { max-width: 1240px; margin: auto; padding: clamp(2rem, 6vw, 5rem) 2rem 5rem; display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.booking-intro { color: #fff; padding-top: 1.2rem; position: sticky; top: 2rem; }
.booking-intro h1 { font-size: clamp(2.4rem, 4vw, 4.1rem); max-width: 11ch; }
.booking-intro > p { color: #c7d8e2; font-size: 1.08rem; max-width: 31rem; }
.privacy-panel { margin-top: 3rem; padding: 1.2rem 1.3rem; border-left: 3px solid var(--mint); background: rgba(255,255,255,.06); max-width: 29rem; }
.privacy-panel p { color: #c7d8e2; margin: .35rem 0 0; font-size: .88rem; }
.calendar-card { background: #fff; border-radius: 24px; padding: clamp(1.25rem, 4vw, 2.4rem); box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.slot-picker { padding: 0; margin: 0; border: 0; }
.slot-picker > legend { font-family: 'Manrope'; font-size: 1.15rem; font-weight: 700; margin-bottom: 1.5rem; }
.day-group { margin-bottom: 1.7rem; }
.day-group h2 { font: 700 .82rem/1.4 'DM Sans'; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .65rem; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.slot { cursor: pointer; display: block; }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot span { min-height: 50px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; padding: .5rem; font-weight: 700; transition: .18s; }
.slot small { color: var(--muted); font-weight: 500; }
.slot input:focus-visible + span { box-shadow: 0 0 0 3px rgba(81,227,194,.35); }
.slot input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.slot input:checked + span small { color: #c9d7df; }
.phone-step { border-top: 1px solid var(--line); padding-top: 1.6rem; display: grid; gap: .9rem; }
.phone-step label > span { display: block; color: var(--muted); font-weight: 400; font-size: .82rem; }
.phone-step input[type="tel"] { font-size: 1.05rem; }
.check-label { display: grid !important; grid-template-columns: auto 1fr; align-items: start; font-weight: 400; font-size: .82rem; color: var(--muted); }
.check-label input { width: 1.1rem; height: 1.1rem; min-height: 0; margin-top: .16rem; accent-color: var(--mint-dark); }
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state p { color: var(--muted); max-width: 28rem; margin: auto; }
.empty-icon { margin: 0 auto 1rem; width: 54px; height: 54px; border-radius: 50%; background: var(--cyan); display: grid; place-items: center; color: var(--mint-dark); font-size: 1.7rem; }

.success-page, .auth-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem; background: radial-gradient(circle at 80% 10%, #d9f9f2 0, transparent 32%), var(--surface); }
.success-card, .auth-card { width: min(100%, 520px); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 22px; padding: clamp(1.7rem, 5vw, 3rem); }
.success-card { text-align: center; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1.5rem; background: var(--cyan); color: var(--mint-dark); font-size: 1.7rem; font-weight: 800; }
.success-card p, .auth-card > p { color: var(--muted); }
.reference { margin: 1.5rem 0; padding: 1rem; border: 1px dashed #a6bac4; border-radius: 12px; display: grid; gap: .25rem; }
.reference span { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
.reference strong { font: 800 1.45rem 'Manrope'; letter-spacing: .12em; }
.auth-card .brand { margin-bottom: 3rem; }
.auth-card h1 { font-size: 2.1rem; }
.stack-form { display: grid; gap: 1rem; }
.label-help, .field-help { color: var(--muted); font-size: .74rem; font-weight: 400; }
.quiet-link { display: block; text-align: center; margin-top: 1.4rem; color: var(--muted); font-size: .85rem; }

.admin-shell { background: #f3f7f9; }
.topbar { min-height: 70px; background: var(--navy); color: #fff; padding: 0 max(1.2rem, calc((100vw - 1280px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.topbar nav { display: flex; align-items: stretch; align-self: stretch; }
.topbar nav a { display: flex; align-items: center; padding: 0 .9rem; text-decoration: none; color: #c9d7df; font-size: .86rem; border-bottom: 3px solid transparent; }
.topbar nav a:hover { color: #fff; border-color: var(--mint); }
.admin-main { max-width: 1280px; margin: auto; padding: 2.5rem 1.5rem 5rem; }
.admin-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.admin-title h1 { font-size: clamp(2rem, 3vw, 2.75rem); margin: 0; }
.admin-title .eyebrow { margin-bottom: .4rem; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; }
.stat-card span { color: var(--muted); font-size: .85rem; }
.stat-card strong { grid-row: span 2; font: 800 2.6rem 'Manrope'; }
.stat-card a { font-size: .8rem; color: var(--mint-dark); font-weight: 700; }
.stat-card--accent { background: var(--navy); color: #fff; border-color: var(--navy); }
.stat-card--accent span { color: #c7d8e2; }
.stat-card--accent a { color: var(--mint); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-heading { padding: 1.3rem 1.4rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin-bottom: .2rem; }
.panel-heading p, .form-panel > p { margin: 0; color: var(--muted); font-size: .84rem; }
.panel-heading > a { font-size: .82rem; color: var(--mint-dark); font-weight: 700; }
.admin-columns { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.form-panel { padding: 1.4rem; position: sticky; top: 1rem; }
.form-panel h2 { margin-bottom: .3rem; }
.form-panel > p { margin-bottom: 1.4rem; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-size: .68rem; text-align: left; padding: .85rem 1.1rem; background: #f8fafb; }
td { padding: .9rem 1.1rem; border-top: 1px solid #edf2f4; vertical-align: middle; }
td small { color: var(--muted); }
code { background: #edf3f5; padding: .22rem .45rem; border-radius: 5px; font-size: .78rem; }
.phone-link { color: var(--navy); font-weight: 700; text-decoration-color: var(--mint); text-underline-offset: 3px; }
.admin-empty { color: var(--muted); padding: 3rem 1.5rem; text-align: center; }
.company-list, .slot-admin-list { display: grid; }
.company-row, .slot-admin-list article { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.2rem; border-top: 1px solid #edf2f4; }
.company-row:first-child, .slot-admin-list article:first-child { border-top: 0; }
.company-avatar { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 10px; background: var(--cyan); color: var(--mint-dark); font-weight: 800; }
.grow { flex: 1; min-width: 0; display: grid; }
.grow span { color: var(--muted); font-size: .78rem; }
.status { background: #edf2f4; color: var(--muted); border-radius: 999px; padding: .3rem .62rem; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.status--active { background: #daf8f2; color: #08715f; }
.status--booked { background: var(--warning-bg); color: var(--warning); }
.icon-button { border: 0; background: transparent; color: var(--muted); font-weight: 800; letter-spacing: .08em; padding: .4rem; }
.date-box { width: 43px; height: 48px; flex: 0 0 43px; display: grid; place-items: center; align-content: center; border: 1px solid var(--line); border-radius: 9px; }
.date-box strong { line-height: 1; font: 800 1.15rem 'Manrope'; }
.date-box span { font-size: 0; }
.date-box span::first-letter { font-size: 0; }
.inline-filter select { min-height: 38px; padding: .4rem 2rem .4rem .7rem; font-size: .8rem; }
.status-form { display: flex; gap: .45rem; min-width: 220px; }
.status-form select { min-height: 36px; padding: .35rem .6rem; font-size: .78rem; }

@media (max-width: 900px) {
  .access-page { grid-template-columns: 1fr; }
  .access-aside { min-height: auto; padding: 2rem; gap: 4rem; }
  .access-copy h1 { font-size: 2.8rem; }
  .access-form-wrap { min-height: 55vh; }
  .booking-grid { grid-template-columns: 1fr; padding-top: 2rem; }
  .booking-intro { position: static; }
  .booking-intro h1 { max-width: 15ch; }
  .privacy-panel { margin-top: 1.5rem; }
  .topbar { flex-direction: column; align-items: flex-start; padding-top: 1rem; }
  .topbar nav { width: 100%; overflow-x: auto; }
  .topbar nav a { padding: .8rem .75rem; white-space: nowrap; }
  .admin-columns { grid-template-columns: 1fr; }
  .form-panel { position: static; order: -1; }
  .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .access-aside { gap: 2.5rem; }
  .access-copy h1 { font-size: 2.25rem; }
  .access-form-wrap { padding: 2rem 1.2rem; }
  .booking-header { padding: 1rem; align-items: flex-start; }
  .booking-header .brand span:last-child { display: none; }
  .company-chip { max-width: 78%; }
  .company-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .booking-grid { padding: 1.5rem 1rem 3rem; }
  .booking-intro h1 { font-size: 2.25rem; }
  .calendar-card { border-radius: 16px; }
  .slots { grid-template-columns: repeat(2, 1fr); }
  .admin-main { padding: 1.5rem .8rem 4rem; }
  .admin-title { align-items: flex-start; flex-direction: column; }
  .admin-title .button { width: 100%; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .company-row, .slot-admin-list article { flex-wrap: wrap; }
  .status-form { min-width: 180px; flex-direction: column; }
}

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