/* ============================================================
   Мята — личный кабинет клиента.
   Отдельная дизайн-система клиентского контура: мягкая «студийная»
   палитра, mobile-first, нижняя таб-навигация на телефоне.
   Никаких стилей операционного кабинета здесь нет.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --cp-accent: #157a5c;
    --cp-accent-strong: #0f5c45;
    --cp-accent-soft: #e3f2ec;
    --cp-accent-soft-2: #d2e9df;
    --cp-bg: #f7f5f0;
    --cp-card: #ffffff;
    --cp-ink: #24312a;
    --cp-muted: #6d7a72;
    --cp-faint: #a3ada6;
    --cp-border: #e6e3da;
    --cp-warn-bg: #fdf3e0;
    --cp-warn-ink: #8a6210;
    --cp-danger: #b3442f;
    --cp-danger-soft: #fbeae6;
    --cp-ok-bg: #e3f2ec;
    --cp-ok-ink: #0f5c45;
    --cp-radius: 18px;
    --cp-radius-sm: 12px;
    --cp-shadow: 0 8px 28px rgba(36, 49, 42, 0.07);
    --cp-tabbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --cp-bg: #161b18;
        --cp-card: #1f2621;
        --cp-ink: #ecf1ed;
        --cp-muted: #9fada4;
        --cp-faint: #6c776f;
        --cp-border: #2c352f;
        --cp-accent-soft: #1c3a30;
        --cp-accent-soft-2: #234739;
        --cp-warn-bg: #3a300f;
        --cp-warn-ink: #e4c46a;
        --cp-danger-soft: #43231c;
        --cp-ok-bg: #1c3a30;
        --cp-ok-ink: #8fd4bb;
        --cp-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    }
}

* { box-sizing: border-box; }
*:focus-visible { outline: 2px solid var(--cp-accent); outline-offset: 2px; border-radius: 4px; }
html { scroll-behavior: smooth; }
body.cp-body {
    margin: 0;
    font-family: "Manrope", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--cp-bg);
    color: var(--cp-ink);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
}
a { color: var(--cp-accent-strong); }

/* ---------- shell ---------- */
.cp-shell { max-width: 720px; margin: 0 auto; padding: 0 16px calc(var(--cp-tabbar-h) + 28px); }
@media (min-width: 900px) { .cp-shell { max-width: 860px; padding-bottom: 48px; } }

.cp-header {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 4px 12px;
    background: color-mix(in srgb, var(--cp-bg) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.cp-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cp-ink); }
.cp-brand-logo {
    display: block;
    width: 132px;
    height: auto;
    max-height: 55px;
    object-fit: contain;
    flex: none;
}
.cp-brand-mark {
    width: 38px; height: 38px; border-radius: 13px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--cp-accent), #2ea27f);
    color: #fff; font-weight: 800; font-size: 19px;
    box-shadow: 0 4px 12px rgba(21, 122, 92, .35);
}
.cp-brand-name { font-weight: 800; font-size: 20px; line-height: 1.05; letter-spacing: -.01em; }
.cp-brand-sub { display: block; color: var(--cp-muted); font-size: 12px; font-weight: 500; }

.cp-topnav { display: none; gap: 4px; }
@media (min-width: 900px) {
    .cp-topnav { display: flex; }
    .cp-topnav a {
        padding: 9px 16px; border-radius: 999px; text-decoration: none;
        color: var(--cp-muted); font-weight: 600; font-size: 14.5px;
    }
    .cp-topnav a:hover { color: var(--cp-ink); background: var(--cp-accent-soft); }
    .cp-topnav a.active { color: #fff; background: var(--cp-accent); }
}
.cp-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: none; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--cp-accent-soft-2); color: var(--cp-accent-strong);
    font-weight: 800; font-size: 16px; border: none; cursor: pointer;
}

/* ---------- bottom tab bar (mobile) ---------- */
.cp-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: flex; justify-content: space-around; align-items: stretch;
    height: calc(var(--cp-tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--cp-card) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--cp-border);
}
.cp-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; text-decoration: none; color: var(--cp-faint); font-size: 11px; font-weight: 600;
}
.cp-tab-icon { font-size: 21px; line-height: 1; }
.cp-tab.active { color: var(--cp-accent-strong); }
.cp-tab.active .cp-tab-icon { transform: translateY(-1px); }
@media (min-width: 900px) { .cp-tabbar { display: none; } }

/* ---------- flashes ---------- */
.cp-flash {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 10px 0; padding: 12px 16px; border-radius: var(--cp-radius-sm);
    font-weight: 600; font-size: 14.5px;
    animation: cp-flash-in .25s ease;
}
.cp-flash.ok { background: var(--cp-ok-bg); color: var(--cp-ok-ink); }
.cp-flash.err { background: var(--cp-danger-soft); color: var(--cp-danger); }
@keyframes cp-flash-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- typography / sections ---------- */
.cp-h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 18px 0 4px; }
.cp-h1 .wave { display: inline-block; }
.cp-lead { color: var(--cp-muted); margin: 0 0 18px; font-size: 15px; }
.cp-section-title {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    margin: 26px 0 12px; font-size: 18px; font-weight: 800; letter-spacing: -.01em;
}
.cp-section-title .link { font-size: 13.5px; font-weight: 600; }

/* ---------- cards ---------- */
.cp-card {
    background: var(--cp-card); border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow); padding: 18px;
    border: 1px solid color-mix(in srgb, var(--cp-border) 55%, transparent);
}
.cp-card + .cp-card { margin-top: 12px; }

/* hero: next class */
.cp-hero {
    position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(120% 160% at 100% 0%, rgba(255,255,255,.14) 0%, transparent 45%),
        linear-gradient(135deg, var(--cp-accent-strong), var(--cp-accent) 55%, #2ea27f);
    border: none;
}
.cp-hero .cp-hero-label {
    font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: rgba(255, 255, 255, .75); margin-bottom: 6px;
}
.cp-hero .cp-hero-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.cp-hero .cp-hero-meta { color: rgba(255, 255, 255, .85); font-size: 14.5px; margin-top: 4px; }
.cp-hero .cp-hero-when {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
    background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 7px 14px;
    font-weight: 700; font-size: 14px;
}
.cp-hero-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

/* pass card */
.cp-pass { display: flex; flex-direction: column; gap: 10px; }
.cp-pass-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cp-pass-name { font-weight: 800; font-size: 16.5px; }
.cp-pass-branch { color: var(--cp-muted); font-size: 13px; margin-top: 1px; }
.cp-progress { height: 8px; border-radius: 999px; background: var(--cp-accent-soft-2); overflow: hidden; }
.cp-progress > span {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--cp-accent), #2ea27f);
    transition: width .4s ease;
}
.cp-progress.low > span { background: linear-gradient(90deg, #c9762c, #d9974e); }
.cp-pass-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--cp-muted); font-size: 13.5px; }
.cp-pass-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* generic list rows */
.cp-list { display: flex; flex-direction: column; }
.cp-row {
    display: flex; align-items: center; gap: 14px; padding: 13px 2px;
    border-bottom: 1px solid color-mix(in srgb, var(--cp-border) 70%, transparent);
}
.cp-row:last-child { border-bottom: none; }
.cp-row-when { flex: none; width: 62px; text-align: center; }
.cp-row-when .d { font-weight: 800; font-size: 17px; line-height: 1.1; }
.cp-row-when .m { color: var(--cp-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.cp-row-when .t { color: var(--cp-accent-strong); font-weight: 700; font-size: 13px; margin-top: 2px; }
.cp-row-main { flex: 1; min-width: 0; }
.cp-row-title { font-weight: 700; font-size: 15.5px; }
.cp-row-sub { color: var(--cp-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* ---------- chips, badges ---------- */
.cp-chip {
    display: inline-flex; align-items: center; gap: 5px;
    border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700;
    background: var(--cp-accent-soft); color: var(--cp-accent-strong);
}
.cp-chip.warn { background: var(--cp-warn-bg); color: var(--cp-warn-ink); }
.cp-chip.danger { background: var(--cp-danger-soft); color: var(--cp-danger); }
.cp-chip.neutral { background: color-mix(in srgb, var(--cp-border) 45%, transparent); color: var(--cp-muted); }

/* filter chips (schedule) */
.cp-filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.cp-filters::-webkit-scrollbar { display: none; }
.cp-filter {
    flex: none; padding: 8px 16px; border-radius: 999px; text-decoration: none;
    background: var(--cp-card); color: var(--cp-muted); font-weight: 700; font-size: 14px;
    border: 1px solid var(--cp-border);
}
.cp-filter.active { background: var(--cp-accent); color: #fff; border-color: var(--cp-accent); }

/* ---------- buttons ---------- */
.cp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: none; cursor: pointer; text-decoration: none;
    border-radius: 999px; padding: 11px 20px;
    font: inherit; font-weight: 700; font-size: 14.5px;
    background: var(--cp-accent-soft); color: var(--cp-accent-strong);
    transition: transform .06s ease, box-shadow .15s ease;
}
.cp-btn:active { transform: scale(.97); }
.cp-btn.primary { background: var(--cp-accent); color: #fff; box-shadow: 0 6px 16px rgba(21, 122, 92, .3); }
.cp-btn.primary:hover { background: var(--cp-accent-strong); }
.cp-btn.light { background: rgba(255, 255, 255, .18); color: #fff; }
.cp-btn.ghost { background: transparent; color: var(--cp-accent-strong); border: 1.5px solid var(--cp-accent-soft-2); }
.cp-btn.danger-ghost { background: transparent; color: var(--cp-danger); border: 1.5px solid color-mix(in srgb, var(--cp-danger) 30%, transparent); }
.cp-btn.small { padding: 7px 14px; font-size: 13px; }
.cp-btn.block { width: 100%; }
.cp-btn[disabled] { opacity: .5; cursor: default; }

/* ---------- forms ---------- */
.cp-form { display: flex; flex-direction: column; gap: 14px; }
.cp-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 13.5px; color: var(--cp-muted); }
.cp-form input, .cp-form select, .cp-form textarea {
    font: inherit; color: var(--cp-ink);
    background: var(--cp-bg); border: 1.5px solid var(--cp-border);
    border-radius: var(--cp-radius-sm); padding: 12px 14px;
}
.cp-form input:focus, .cp-form select:focus, .cp-form textarea:focus {
    outline: none; border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cp-accent) 18%, transparent);
}
.cp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .cp-form-grid { grid-template-columns: 1fr; } }
.cp-hint { color: var(--cp-faint); font-size: 13px; margin: 0; }

/* ---------- details-based sheet (freeze etc.) ---------- */
.cp-sheet { border-radius: var(--cp-radius-sm); }
.cp-sheet > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    color: var(--cp-accent-strong); font-weight: 700; font-size: 13.5px;
}
.cp-sheet > summary::-webkit-details-marker { display: none; }
.cp-sheet > summary::after { content: "›"; transform: rotate(90deg); transition: transform .15s; font-size: 15px; }
.cp-sheet[open] > summary::after { transform: rotate(-90deg); }
.cp-sheet-body {
    margin-top: 12px; padding: 14px; border-radius: var(--cp-radius-sm);
    background: var(--cp-bg); border: 1px dashed var(--cp-border);
}

/* ---------- schedule ---------- */
.cp-day {
    position: sticky; top: 64px; z-index: 5;
    margin: 20px 0 6px; padding: 6px 2px;
    font-weight: 800; font-size: 14px; letter-spacing: .02em; text-transform: capitalize;
    color: var(--cp-muted);
    background: color-mix(in srgb, var(--cp-bg) 92%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.cp-day.today { color: var(--cp-accent-strong); }
.cp-spots { font-size: 12.5px; color: var(--cp-muted); }
.cp-spots.few { color: var(--cp-warn-ink); font-weight: 700; }
.cp-spots.none { color: var(--cp-danger); font-weight: 700; }

/* ---------- history ---------- */
.cp-tabs { display: flex; gap: 8px; margin: 4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.cp-tabs::-webkit-scrollbar { display: none; }

/* ---------- empty state ---------- */
.cp-empty { text-align: center; padding: 34px 18px; color: var(--cp-muted); }
.cp-empty .icon { font-size: 40px; display: block; margin-bottom: 10px; }
.cp-empty .title { font-weight: 800; color: var(--cp-ink); font-size: 16px; margin-bottom: 4px; }
.cp-empty p { margin: 0 0 14px; font-size: 14px; }

/* ---------- auth screens ---------- */
.cp-auth-body {
    display: flex; align-items: center; justify-content: center; min-height: 100dvh;
    padding: 20px;
    background:
        radial-gradient(80% 60% at 100% 0%, var(--cp-accent-soft) 0%, transparent 60%),
        radial-gradient(70% 50% at 0% 100%, var(--cp-accent-soft-2) 0%, transparent 55%),
        var(--cp-bg);
}
.cp-auth-card {
    width: 100%; max-width: 400px;
    background: var(--cp-card); border-radius: 24px; box-shadow: var(--cp-shadow);
    padding: 30px 26px;
}
.cp-auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cp-brand-logo-auth { width: 170px; max-width: 72%; max-height: 71px; }
.cp-auth-title { font-size: 21px; font-weight: 800; margin: 14px 0 2px; letter-spacing: -.01em; }
.cp-auth-sub { color: var(--cp-muted); font-size: 14px; margin: 0 0 18px; }
.cp-auth-foot { margin-top: 18px; text-align: center; color: var(--cp-muted); font-size: 13.5px; }
.cp-auth-foot + .cp-auth-foot { margin-top: 8px; }

/* ---------- misc ---------- */
.cp-grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .cp-grid-2 { grid-template-columns: 1fr 1fr; } }
.cp-muted { color: var(--cp-muted); }
.cp-small { font-size: 13px; }
.cp-inline-form { display: inline; }
.cp-preview-note {
    margin: 10px 0; padding: 9px 14px; border-radius: var(--cp-radius-sm);
    background: var(--cp-warn-bg); color: var(--cp-warn-ink);
    font-size: 13px; font-weight: 600;
}
