/* ============================================================
   УНГ кабинет — записване на часове
   Мобилно ориентиран дизайн. 92% от пациентите идват от телефон.
   ============================================================ */

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

:root {
    --ink:        #14283C;
    --ink-soft:   #4A5D72;
    --primary:    #2C5F9E;
    --primary-dk: #1E4574;
    --teal:       #3FA9A0;
    --teal-soft:  #E6F4F3;
    --surface:    #FBFCFD;
    --card:       #FFFFFF;
    --muted:      #E8EDF2;
    --line:       #D5DEE7;
    --alert:      #B4453C;
    --alert-soft: #FBEEED;
    --ok:         #2E7D5B;
    --radius:     14px;
    --shadow:     0 1px 2px rgba(20,40,60,.06), 0 4px 16px rgba(20,40,60,.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--surface);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }

/* ---------- Header ---------- */
.site-head {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 18px 16px;
    text-align: center;
}
.site-head h1 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -.01em;
}
.site-head p {
    margin: 4px 0 0;
    font-size: .85rem;
    color: var(--ink-soft);
}
.site-head a { color: var(--primary); text-decoration: none; }

/* ---------- Типография ---------- */
h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 28px 0 6px;
}
.lede { color: var(--ink-soft); margin: 0 0 20px; font-size: .95rem; }

.eyebrow {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--teal);
    margin: 24px 0 8px;
}

/* ---------- Лента с дни (сигнатурен елемент) ---------- */
.daystrip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.daystrip::-webkit-scrollbar { height: 0; }

.day {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-width: 78px;
    padding: 10px 8px 9px;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--ink);
    transition: border-color .15s, transform .15s;
}
.day:hover { border-color: var(--teal); }
.day.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow);
}
.day .dow { display: block; font-size: .72rem; font-weight: 500; opacity: .75; }
.day .dnum { display: block; font-size: 1.3rem; font-weight: 700; line-height: 1.15; }
.day .cnt { display: block; font-size: .68rem; font-weight: 500; color: var(--teal); }
.day.is-active .cnt { color: rgba(255,255,255,.85); }

/* ---------- Часове ---------- */
.slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
    margin-top: 4px;
}
.slot {
    display: block;
    padding: 15px 8px;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    transition: border-color .15s, background .15s;
}
.slot:hover, .slot:focus-visible {
    border-color: var(--teal);
    background: var(--teal-soft);
}

/* ---------- Карти и форми ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.chosen {
    background: var(--teal-soft);
    border: 1px solid var(--teal);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
}
.chosen strong { display: block; font-size: 1.1rem; }
.chosen a { font-size: .85rem; color: var(--primary-dk); }

label {
    display: block;
    font-weight: 600;
    font-size: .88rem;
    margin: 16px 0 6px;
}
label .opt { font-weight: 400; color: var(--ink-soft); }

input[type=text], input[type=tel], input[type=email], textarea, select {
    width: 100%;
    padding: 13px 14px;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: 10px;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44,95,158,.14);
}
textarea { min-height: 110px; resize: vertical; }
.hint { font-size: .82rem; color: var(--ink-soft); margin: 6px 0 0; }

.radio-row { display: flex; gap: 10px; margin-top: 6px; }
.radio-row label {
    flex: 1;
    margin: 0;
    padding: 12px;
    text-align: center;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    background: var(--card);
}
.radio-row input { position: absolute; opacity: 0; }
.radio-row input:checked + span { color: var(--primary-dk); font-weight: 700; }
.radio-row label:has(input:checked) {
    border-color: var(--primary);
    background: #F0F5FB;
}

.consent {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin: 20px 0 4px;
    font-size: .87rem;
    line-height: 1.45;
}
.consent input { margin-top: 3px; width: 19px; height: 19px; flex: 0 0 auto; }

/* ---------- Бутони ---------- */
.btn {
    display: block;
    width: 100%;
    padding: 15px;
    font: inherit;
    font-size: 1.02rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 11px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    margin-top: 18px;
}
.btn:hover { background: var(--primary-dk); }
.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--line);
}
.btn-ghost:hover { background: var(--muted); }
.btn-danger { background: var(--alert); }
.btn-sm { padding: 9px 14px; font-size: .9rem; width: auto; display: inline-block; margin: 0; }

/* ---------- Съобщения ---------- */
.msg { padding: 14px 16px; border-radius: var(--radius); margin: 18px 0; font-size: .93rem; }
.msg-ok    { background: #EAF6F0; border: 1px solid #9BCBB4; color: #1D5C42; }
.msg-error { background: var(--alert-soft); border: 1px solid #E3AFAB; color: #8E332C; }
.msg-info  { background: #F0F5FB; border: 1px solid #B9CFE6; color: var(--primary-dk); }

.empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--ink-soft);
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

/* ---------- Долен блок ---------- */
.foot {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: .85rem;
    color: var(--ink-soft);
    text-align: center;
}
.foot a { color: var(--primary); }
.callbar {
    display: block;
    padding: 14px;
    background: var(--teal-soft);
    border: 1.5px solid var(--teal);
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    margin-top: 18px;
}

/* ---------- Админ ---------- */
.admin-head {
    background: var(--ink);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-head a { color: #A9C4E0; text-decoration: none; font-size: .88rem; }
.admin-head strong { font-size: .98rem; }
.tabs { display: flex; gap: 6px; margin: 18px 0; flex-wrap: wrap; }
.tab {
    padding: 9px 15px;
    border-radius: 999px;
    background: var(--card);
    border: 1.5px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 500;
}
.tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge {
    display: inline-block;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--alert);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    margin-left: 5px;
}

.req { border-left: 4px solid var(--primary); }
.req .when { font-weight: 700; font-size: 1.05rem; }
.req .who  { margin-top: 3px; font-size: .95rem; }
.req .who a { color: var(--primary); text-decoration: none; }
.req .complaint {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 13px;
    margin: 12px 0;
    font-size: .92rem;
    white-space: pre-wrap;
}
.req .meta { font-size: .8rem; color: var(--ink-soft); }
.actions { display: flex; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.actions form { flex: 1; min-width: 130px; }
.actions .btn { margin-top: 0; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }

.pill { display:inline-block; padding:2px 9px; border-radius:999px; font-size:.75rem; font-weight:600; }
.pill-ok { background:#EAF6F0; color:var(--ok); }
.pill-no { background:var(--alert-soft); color:var(--alert); }
.pill-wait { background:#FFF4E0; color:#8A5A12; }

@media (min-width: 700px) {
    .site-head h1 { font-size: 1.15rem; }
    h2 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
/* Предупреждение за направления */
.notice-nzok {
    background: #FDF3E3;
    border: 1px solid #F0DCB8;
    border-radius: var(--radius);
    padding: 16px 18px;
    margin: 18px 0;
    font-size: .92rem;
    line-height: 1.55;
    color: #C0392B;
}
.notice-nzok .notice-title {
    display: block;
    font-weight: 700;
    font-size: .95rem;
    color: #B8621B;
    margin-bottom: 6px;
}
.notice-nzok a {
    color: #C0392B;
    font-weight: 700;
    text-decoration: underline;
}
.notice-nzok a:hover { color: #96271A; }

/* Центриране */
.wrap > h2 { text-align: center; }
.wrap > .lede { text-align: center; }
.notice-nzok .notice-title { text-align: center; }