/* Excelsior Clinic – система за записване */
:root {
  --ink: #1a2238;
  --ink-soft: #5a6478;
  --line: #dce3ec;
  --bg: #f4f7fa;
  --card: #ffffff;
  --brand: #212c64;
  --brand-dark: #161e4a;
  --brand-tint: #e6f4f9;
  --accent: #00a8cf;
  --accent-text: #007a99;
  --danger: #b4322b;
  --danger-tint: #fbeceb;
  --ok: #2f7d4a;
  --ok-tint: #e8f4ec;
  --warn: #8a6300;
  --warn-tint: #fbf2dc;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 34, 56, .06), 0 6px 20px rgba(26, 34, 56, .05);
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Montserrat", "Manrope", -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 var(--font-body);
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Заглавна част */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand-logo { max-height: 46px; width: auto; display: block; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.header-phone { font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-header .lang-switch { margin-left: auto; margin-right: -4px; font-weight: 600; font-size: .8rem; letter-spacing: .08em; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; }
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.admin-nav a:hover { background: var(--brand-tint); }

main.wrap { padding-top: 28px; padding-bottom: 48px; }
.site-footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--ink-soft); font-size: .875rem; background: var(--card); }

.intro { margin-bottom: 20px; }
.intro p { color: var(--ink-soft); margin: 0; }

/* Карти и стъпки */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px;
}
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.step h2 { display: flex; align-items: center; gap: 10px; }
.step-num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .9rem; flex: none;
}
.step.is-locked > *:not(h2):not(.locked-hint) { display: none; }
.step.is-locked { opacity: .65; }
.step.is-locked .step-num { background: var(--ink-soft); }
.locked-hint { display: none; color: var(--ink-soft); margin: 0; }
.step.is-locked .locked-hint { display: block; }
#step-details.is-locked::after { content: "Първо изберете ден и час."; color: var(--ink-soft); }

/* Процедури */
.service-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.service { position: relative; display: block; cursor: pointer; }
.service input { position: absolute; opacity: 0; inset: 0; }
.service-body {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; height: 100%;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; transition: border-color .15s, background .15s;
}
.service:hover .service-body { border-color: var(--brand); }
.service input:focus-visible + .service-body { outline: 3px solid rgba(0, 168, 207, .45); outline-offset: 2px; }
.service input:checked + .service-body { border-color: var(--brand); background: var(--brand-tint); }
.service-name { font-weight: 600; }
.service-dur { color: var(--ink-soft); font-size: .875rem; white-space: nowrap; }
.service-desc { grid-column: 1 / -1; color: var(--ink-soft); font-size: .875rem; }

/* Календар и часове */
.date-time { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 24px; align-items: start; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head strong { text-transform: capitalize; }
.cal-nav {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
  font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink);
}
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-weekdays span { font-size: .75rem; color: var(--ink-soft); font-weight: 600; padding: 4px 0; }
.cal-day {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; font-size: .95rem;
  color: #a9b2bb; border: 1px solid transparent; background: none; font: inherit;
}
button.cal-day { cursor: pointer; color: var(--ink); background: var(--brand-tint); font-weight: 600; }
button.cal-day:hover { border-color: var(--brand); }
.cal-day.is-today { box-shadow: inset 0 -2px 0 var(--accent); }
.cal-day.is-selected { background: var(--brand); color: #fff; }
.cal-loading { grid-column: 1 / -1; padding: 40px 0; color: var(--ink-soft); }
.slots-title { margin: 6px 0 12px; font-weight: 600; }
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot {
  padding: 10px 0; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card);
  font: inherit; font-weight: 600; cursor: pointer; color: var(--ink);
}
.slot:hover { border-color: var(--brand); }
.slot.is-selected { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Формуляри */
.chosen { background: var(--brand-tint); border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field-wide { grid-column: 1 / -1; }
.field label, .lbl { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 168, 207, .2); }
textarea { resize: vertical; }
.field-error { color: var(--danger); font-size: .875rem; margin: 4px 0 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 6px; font-size: .925rem; }
.consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Бутони */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: 1.5px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: .85rem; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; margin-top: 10px; }

/* Съобщения */
.alert { padding: 12px 16px; border-radius: 10px; background: var(--warn-tint); color: #5c4300; margin-bottom: 18px; }
.alert-error { background: var(--danger-tint); color: var(--danger); }
.alert-ok { background: var(--ok-tint); color: var(--ok); }

/* Потвърждение */
.success { text-align: center; max-width: 600px; margin: 0 auto; padding: 36px 24px; }
.success-icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--ok-tint); color: var(--ok);
  display: grid; place-items: center; font-size: 1.7rem; margin: 0 auto 14px; font-weight: 700;
}
.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; text-align: left; margin: 20px auto; max-width: 420px; }
.summary dt { color: var(--ink-soft); }
.summary dd { margin: 0; font-weight: 500; }

/* Администрация */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 16px; }
.toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=date] { width: auto; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--card); }
.tabs a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.day-group { margin-bottom: 22px; }
.day-group h3 { font-size: 1rem; text-transform: capitalize; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.bk {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
}
.bk.st-pending { border-left-color: var(--accent); }
.bk.st-cancelled, .bk.st-noshow { border-left-color: #b9c0c7; opacity: .7; }
.bk.st-done { border-left-color: var(--ok); }
.bk-time { font-weight: 700; font-size: 1.05rem; }
.bk-time small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .8rem; }
.bk-main strong { display: block; }
.bk-main .meta { color: var(--ink-soft); font-size: .9rem; }
.bk-main .note { font-size: .875rem; margin-top: 4px; background: var(--bg); padding: 4px 8px; border-radius: 6px; }
.bk-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.bk-actions form { margin: 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--ink-soft); }
.badge.st-pending { background: var(--warn-tint); color: var(--warn); }
.badge.st-confirmed { background: var(--brand-tint); color: var(--brand); }
.badge.st-done { background: var(--ok-tint); color: var(--ok); }
.badge.st-cancelled, .badge.st-noshow { background: var(--danger-tint); color: var(--danger); }
.empty { padding: 30px; text-align: center; color: var(--ink-soft); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { color: var(--ink-soft); font-size: .85rem; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: .8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }
.hours-row { display: grid; grid-template-columns: 120px 100px 1fr 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours-row .times { display: flex; gap: 6px; align-items: center; }
.hours-row input[type=time] { padding: 7px 8px; }
.check { display: flex; gap: 6px; align-items: center; font-weight: 500; }
.form-row { margin-bottom: 14px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline-form .field { flex: 1 1 140px; }

@media (max-width: 760px) {
  h1 { font-size: 1.45rem; }
  .card { padding: 18px 16px; }
  .date-time { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .bk { grid-template-columns: 70px 1fr; }
  .bk-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .hours-row { grid-template-columns: 1fr 1fr; }
  .btn-lg { width: 100%; }
  table.list .hide-sm { display: none; }
}

/* Текстови страници */
.prose { max-width: 760px; }
.prose h1 { font-family: var(--font-display); font-weight: 600; font-size: 2rem; }
.prose h2 { font-size: 1.1rem; margin-top: 1.6em; }
.prose p, .prose li { color: var(--ink); }
.card.narrow h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; }

/* Правни страници */
.legal { max-width: 820px; padding: clamp(24px, 4vw, 48px); }
.legal h1 { color: var(--brand); letter-spacing: -.02em; }
.legal h2 { color: var(--brand); font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; margin: 2em 0 .6em; }
.legal p, .legal li { line-height: 1.7; }
.legal ol, .legal ul { padding-left: 1.3em; }
.legal li + li { margin-top: .4em; }
.facts-list { list-style: none; padding: 0 !important; margin: 0 0 1em; border-top: 1px solid var(--line); }
.facts-list li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 9px 0; margin: 0 !important; border-bottom: 1px solid var(--line); }
.facts-list span { color: var(--ink-soft); font-size: .9rem; }
@media (max-width: 600px) { .facts-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.todo { background: #fff3c4; color: #6b4e00; padding: 0 4px; border-radius: 4px; }
