/* ==========================================================================
   Persona 2026 — base reset + styles for the markup that is still shared with
   the old site (popups, form fields, donor questionnaire, patient steps).
   Replaces the legacy styles.css (260 KB) and rebuild.css.
   ========================================================================== */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; line-height: 1.15; }
body { margin: 0; font-size: 1rem; }
img, svg, video { max-width: 100%; }
img { border-style: none; }
a { color: inherit; text-decoration: none; background-color: transparent; }
b, strong { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
[hidden] { display: none !important; }
.img-responsive { display: block; max-width: 100%; height: auto; }
.wrapper { min-width: 320px; position: relative; overflow: hidden; background: var(--p-white); }

/* ---------- legacy buttons (popups, patient forms) ---------- */
.button {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    min-height: 52px; min-width: 160px; padding: 0 26px; border-radius: 999px; border: 2px solid transparent;
    font: 600 var(--p-fs-sm)/1.1 var(--p-font); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.button .text { display: block; text-transform: none; letter-spacing: .01em; color: inherit; }
.button .icon { display: inline-flex; margin-right: 8px; }
.button .icon svg { width: 16px; height: 16px; fill: currentColor; }
.button-green, .button-green-simple { background: var(--p-pine); border-color: var(--p-pine); color: var(--p-white); }
.button-green:hover, .button-green-simple:hover { background: var(--p-pine-deep); border-color: var(--p-pine-deep); }
.button-black, .button-white, .button-white-simple { background: transparent; border-color: var(--p-pine); color: var(--p-pine); }
.button-black:hover, .button-white:hover, .button-white-simple:hover { background: var(--p-pine); color: var(--p-white); }
.button-wrapper { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- popups (fancybox inline content) ---------- */
.simple-popup { display: none; }
.fancybox-container .fancybox-content.simple-popup {
    display: block; position: relative;
    width: min(520px, calc(100vw - 32px)); max-width: none; padding: clamp(28px, 4vw, 44px);
    border-radius: var(--p-radius-photo); background: var(--p-white);
    box-shadow: 0 30px 80px -30px rgba(15, 50, 42, .5);
    font-family: var(--p-font); color: var(--p-ink); text-align: left;
}
.fancybox-container .fancybox-content.questionary-popup { width: min(860px, calc(100vw - 32px)); }
.p-fb-inline .fancybox-toolbar, .p-fb-inline .fancybox-navigation { display: none !important; }
.fancybox-container .fancybox-bg { background: rgba(15, 50, 42, .55); }
.fancybox-container.fancybox-is-open .fancybox-bg { opacity: 1; }
.popup-title {
    margin: 0 48px 10px 0; font-size: var(--p-fs-lg); font-weight: 500; line-height: 1.2;
    letter-spacing: -0.015em; color: var(--p-pine);
}
.popup-text { margin: 0 0 20px; color: var(--p-muted); font-size: var(--p-fs-sm); line-height: 1.55; }
.close-popup-button {
    position: absolute; top: 16px; right: 16px; z-index: 2;
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--p-mist);
}
.close-popup-button .icon { display: grid; place-items: center; width: 18px; height: 18px; }
.close-popup-button svg { width: 25px; height: 25px; flex: none; transform: scale(.72); }
.close-popup-button path { fill: var(--p-pine); }
.close-popup-button:hover { background: var(--p-mint); }
.simple-popup .button-wrapper { margin-top: 8px; }
.simple-popup .button { width: 100%; }
.simple-popup .content-block, .questionary-tab-content { font-size: var(--p-fs-sm); line-height: 1.6; color: var(--p-ink); }
.simple-popup .content-block p, .questionary-tab-content p { margin: 0 0 .8em; }
.simple-popup .content-block ul, .questionary-tab-content ul { padding-left: 1.2em; margin: 0 0 .8em; }

/* ---------- legacy form fields: label above the field, error below ---------- */
.input-line { display: flex; flex-wrap: wrap; gap: 0 16px; margin: 0; }
.input-field { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; position: relative; }
.input-field > .label, .input-field > label {
    order: -1; position: static; font-size: var(--p-fs-sm); font-weight: 500; color: var(--p-ink); line-height: 1.3;
}
.input-field .input, .input-field select, .input-field textarea,
.input-line input[type="text"], .input-line input[type="tel"], .input-line input[type="email"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; min-height: 52px; padding: 12px 16px;
    border: 1px solid var(--p-line); border-radius: var(--p-radius-field); background: var(--p-white);
    font: 400 var(--p-fs-base)/1.3 var(--p-font); color: var(--p-ink);
    transition: border-color .2s, box-shadow .2s;
}
.input-field textarea { min-height: 120px; resize: vertical; }
.input-field .input:focus, .input-field select:focus, .input-field textarea:focus {
    outline: none; border-color: var(--p-teal); box-shadow: 0 0 0 3px rgba(67, 173, 148, .2);
}
.error-text, .input-field .help-block { font-size: var(--p-fs-xs); color: #b3261e; line-height: 1.35; }
.error-text:empty { display: none; }
.input-field.has-error .input, .input-field.has-error select, .input-field.has-error textarea { border-color: #d9776e; }

/* file input (review popup): the label becomes the drop target */
input.inputfile { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
input.inputfile + .label {
    order: 0; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px 16px;
    border: 1px dashed var(--p-mint); border-radius: var(--p-radius-field); background: var(--p-mist);
    color: var(--p-pine); cursor: pointer; text-align: center;
}
input.inputfile + .label:hover, input.inputfile:focus + .label { border-color: var(--p-teal); }

/* ---------- radio groups (donor questionnaire) ---------- */
.radio-field { flex: 1 1 100%; margin: 0 0 18px; }
.radio-field-title { margin: 0 0 8px; font-size: var(--p-fs-sm); font-weight: 600; color: var(--p-pine); }
.radio-field > div { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-label { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.radio-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-label .icon { display: none; }
.radio-label .text {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
    border: 1px solid var(--p-line); border-radius: 999px; background: var(--p-white);
    font-size: var(--p-fs-sm); color: var(--p-ink); transition: background-color .2s, border-color .2s, color .2s;
}
.radio-label:hover .text { border-color: var(--p-teal); }
.radio-input:checked + .icon + .text, .radio-input:checked ~ .text { background: var(--p-pine); border-color: var(--p-pine); color: var(--p-white); }
.radio-input:focus-visible ~ .text { outline: 3px solid var(--p-teal); outline-offset: 2px; }

/* ---------- donor questionnaire layout ---------- */
.questionary-tabs-wrapper ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.questionary-tabs-wrapper a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
    border: 1px solid var(--p-line); border-radius: 999px; font-size: var(--p-fs-sm); font-weight: 500; color: var(--p-ink);
}
.questionary-tabs-wrapper li.active a, .questionary-tabs-wrapper a[aria-selected="true"] { background: var(--p-pine); border-color: var(--p-pine); color: var(--p-white); }
.questionary-tabs-container { margin-bottom: 20px; padding: 18px 20px; border-radius: 16px; background: var(--p-mist); }
.questionary-form-content { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
@media (max-width: 767px) { .questionary-form-content { grid-template-columns: 1fr; } }
.two-thirds-line { flex: 1 1 100%; }

/* ---------- patient page steps (legacy markup inside the new page) ---------- */
.blockquote { margin: 0 0 16px; padding: 0; font-size: var(--p-fs-base); color: var(--p-muted); }

/* ---------- toastr sits above the sticky header ---------- */
#toast-container { z-index: 100000; }
#toast-container > div { font-family: var(--p-font); border-radius: 14px; opacity: 1; box-shadow: 0 16px 40px -16px rgba(15, 50, 42, .45); }
#toast-container > .toast-success { background-color: var(--p-pine); }
