/* Base layer shared by the public site and the admin: tokens, reset, type, buttons, forms, badges.
   The --accent-* custom properties are injected per clinic from config/site.php (see accent_palette()). */

/* Archivo, self-hosted (SIL Open Font License 1.1, see ../fonts/OFL.txt): no visitor data goes to Google.
   One variable file per subset covers weights 400–700; latin-ext carries the Hungarian ő and ű. */
@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/archivo-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                   U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                   U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --page: #E6E7E5;
    --page-deep: #D9DBD9;
    --paper: #F7F7F5;
    --white: #FFFFFF;
    --line: #D3D5D1;
    --line-strong: #B2B5B1;
    --ink: #1B1D20;
    --ink-2: #4E5157;

    --danger: #A3352A;
    --danger-soft: #F8E5E2;
    --danger-line: #E4B2AB;
    --warn: #7A5300;
    --warn-soft: #FBF0D3;
    --warn-line: #E2C37A;

    /* Fallbacks; overridden inline from config. */
    --accent: #2C6E63;
    --accent-hover: #265F55;
    --accent-ink: #FFFFFF;
    --accent-text: #2C6E63;
    --accent-soft: #E6EEEC;
    --accent-line: #A0BEB9;

    --radius-btn: 6px;
    --radius: 8px;
    --shadow: 0 1px 2px rgb(27 29 32 / 0.04), 0 12px 32px -12px rgb(27 29 32 / 0.14);
    --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --container: 1120px;
    --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
.icon { display: inline-block; flex: none; vertical-align: middle; }

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 640;
    line-height: 1.15;
    letter-spacing: -0.015em;
    text-wrap: balance;
}
p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
:where(ul[class], ol[class], nav ul) { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a[href^="tel:"] { white-space: nowrap; }

.num, time, table { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
strong, b { font-weight: 640; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute;
    left: 12px; top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--white);
    border-radius: var(--radius-btn);
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-btn);
    background: var(--white);
    color: var(--ink);
    font: 600 15px/1.2 var(--font);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { border-color: var(--ink-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-quiet { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn-quiet:hover { border-color: transparent; text-decoration-thickness: 2px; }

.btn-danger { color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-soft); }

.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; gap: 6px; }
.btn-block { width: 100%; }

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
}
.link-button:hover { text-decoration-thickness: 2px; }

/* ---------------------------------------------------------------- forms */

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 20px; }
.field-label, .field > label { font-weight: 600; font-size: 15px; }
.field-optional { font-weight: 400; color: var(--ink-2); }
.field-hint { font-size: 14px; color: var(--ink-2); }
.field-error { font-size: 14px; font-weight: 600; color: var(--danger); }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="search"],
input[type="date"], input[type="time"], input[type="number"], select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
    font: 16px/1.4 var(--font);
    font-variant-numeric: tabular-nums;
}
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; padding-right: 36px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%234E5157' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
[aria-invalid="true"] { border-color: var(--danger) !important; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }

/* ---------------------------------------------------------------- alerts & badges */

.alert {
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--white);
}
.alert + .alert { margin-top: 8px; }
.alert-error { border-color: var(--danger-line); background: var(--danger-soft); }
.alert-success { border-color: var(--accent-line); background: var(--accent-soft); }
.alert-warn { border-color: var(--warn-line); background: var(--warn-soft); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}
.st-pending   { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.st-confirmed { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.st-completed { background: #ECEDEB; border-color: var(--line); color: var(--ink-2); }
.st-no_show   { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.st-cancelled { background: var(--white); border-color: var(--line); color: var(--ink-2); text-decoration: line-through; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
