:root {
    --site-ink: var(--brand-primary, #053f5c);
    --site-teal: var(--brand-secondary, #429ebd);
    --site-aqua: var(--brand-surface, #9fe7f5);
    --site-gold: var(--brand-accent, #f7ad19);
    --site-copy: #173f50;
    --site-muted: #596f78;
    --site-line: #d5e4e9;
    --site-paper: #fff;
    --site-shadow: 0 18px 44px rgb(5 63 92 / .09);
    --bs-font-sans-serif: 'Manrope', system-ui, sans-serif;
}

body.welcome-page,
body.guest-body,
body.clinic-body {
    font-family: 'Manrope', system-ui, sans-serif;
    color-scheme: light;
}

body.guest-body {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    padding: clamp(1rem, 3.2vw, 2.8rem);
    color: var(--site-copy);
    background: linear-gradient(180deg, #fbfefe 0%, #f3fafb 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.guest-body::before {
    position: fixed;
    z-index: -1;
    inset: -15%;
    content: '';
    pointer-events: none;
    opacity: .72;
    filter: blur(clamp(3.5rem, 8vw, 7rem));
    background:
        radial-gradient(ellipse at 15% 18%, rgb(159 231 245 / .56) 0%, rgb(159 231 245 / .16) 35%, transparent 62%),
        radial-gradient(ellipse at 84% 78%, rgb(176 238 214 / .48) 0%, rgb(176 238 214 / .14) 37%, transparent 64%),
        radial-gradient(ellipse at 65% 30%, rgb(188 228 247 / .4) 0%, rgb(188 228 247 / .12) 36%, transparent 62%);
    animation: site-atmosphere 18s ease-in-out infinite alternate;
}

.guest-main {
    z-index: 1;
    display: grid;
    min-width: 0;
    place-items: center;
    padding-block: clamp(.75rem, 2vh, 1.5rem);
}

.guest-body .auth-card {
    box-sizing: border-box;
    width: min(100%, 30rem);
    margin: auto;
    padding: clamp(1.5rem, 4vw, 2.6rem);
    border: 1px solid rgb(5 63 92 / .12);
    border-radius: 1.5rem;
    color: var(--site-copy);
    background: rgb(255 255 255 / .84);
    box-shadow: var(--site-shadow);
    -webkit-backdrop-filter: blur(16px) saturate(115%);
    backdrop-filter: blur(16px) saturate(115%);
    animation: site-enter 760ms cubic-bezier(.16, 1, .3, 1) both;
}

.guest-body .auth-card > img {
    display: block;
    width: min(100%, 10.5rem);
    height: auto;
    margin: 0 auto 1.4rem;
}

.guest-body .auth-card :is(h1, h2, h3, h4) {
    margin-top: 0;
    color: var(--site-ink);
    font-family: inherit;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.2;
}

.guest-body .auth-card h4 { font-size: clamp(1.4rem, 4vw, 1.7rem); }
.guest-body .auth-card p { color: var(--site-muted); line-height: 1.6; }
.guest-body .auth-card form { text-align: left; }
.guest-body .auth-card .form-label { margin-bottom: .45rem; color: var(--site-ink); font-size: .9rem; font-weight: 650; }

.guest-body .auth-card .form-control,
.guest-body .auth-card .form-select {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    padding: .65rem .85rem;
    border: 1px solid #b9cfd7;
    border-radius: 12px;
    color: var(--site-copy);
    background-color: rgb(255 255 255 / .9);
    font: inherit;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.guest-body .auth-card .form-control::placeholder { color: #738891; opacity: 1; }
.guest-body .auth-card .form-control:focus,
.guest-body .auth-card .form-select:focus {
    border-color: var(--site-teal);
    outline: 0;
    box-shadow: 0 0 0 .2rem rgb(66 158 189 / .2);
}

.guest-body .auth-card input[type='checkbox'] { accent-color: var(--site-ink); }

.guest-body .auth-card input:-webkit-autofill,
.guest-body .auth-card input:-webkit-autofill:hover,
.guest-body .auth-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--site-copy);
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 9999s ease-out 0s;
}

.guest-body .auth-card .btn,
.clinic-body .btn,
.clinic-body button:not(.btn-close):not(.calendar-cell) {
    border-radius: 999px;
    font-family: inherit;
    font-weight: 650;
}

.guest-body .auth-card .btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1rem;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.guest-body .auth-card .btn-primary {
    border: 1px solid var(--site-ink);
    color: #fff;
    background: var(--site-ink);
}

.guest-body .auth-card .btn-primary:hover,
.guest-body .auth-card .btn-primary:active {
    border-color: var(--site-teal);
    color: var(--site-ink);
    background: var(--site-aqua);
}

.guest-body .auth-card .btn-outline-secondary {
    border: 1px solid var(--site-teal);
    color: var(--site-ink);
    background: var(--site-paper);
}

.guest-body .auth-card .btn-outline-secondary:hover,
.guest-body .auth-card .btn-outline-secondary:active {
    border-color: var(--site-teal);
    color: var(--site-ink);
    background: var(--site-aqua);
}

.guest-body .auth-card a { color: var(--site-ink); text-underline-offset: .18em; }
.guest-body .auth-card a:hover { color: var(--site-teal); }
.guest-body .auth-card .text-muted { color: var(--site-muted) !important; }
.guest-body .auth-card .text-danger { color: #9d2431 !important; }
.guest-body .auth-card .alert { border-radius: 12px; text-align: left; }

.guest-body .auth-card :is(a, button, input, select):focus-visible {
    outline: 3px solid rgb(66 158 189 / .56);
    outline-offset: 3px;
}

.guest-footer {
    z-index: 1;
    justify-self: center;
    padding-top: .5rem;
    color: #596f78;
    font-size: .76rem;
    font-weight: 500;
    letter-spacing: .015em;
    text-align: center;
}

body.clinic-body {
    color: var(--site-copy);
    background:
        radial-gradient(ellipse at 12% 8%, rgb(159 231 245 / .18) 0%, transparent 26rem),
        radial-gradient(ellipse at 90% 88%, rgb(176 238 214 / .16) 0%, transparent 30rem),
        linear-gradient(180deg, #fbfefe 0%, #f3fafb 100%);
    background-attachment: fixed;
}

.clinic-body .clinic-navbar {
    background: rgb(255 255 255 / .94);
    -webkit-backdrop-filter: blur(14px) saturate(115%);
    backdrop-filter: blur(14px) saturate(115%);
}

.clinic-body :is(.clinic-form, .agenda-calendar, .agenda-toolbar, .table-shell, .schedule-row) {
    border-color: var(--site-line);
    box-shadow: 0 10px 28px rgb(5 63 92 / .06);
}

.clinic-body :is(.btn, button:not(.btn-close):not(.calendar-cell)):focus-visible {
    outline: 3px solid rgb(66 158 189 / .56);
    outline-offset: 3px;
    box-shadow: none;
}

.welcome-page .welcome-footer { color: var(--site-muted); }

@keyframes site-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes site-atmosphere {
    from { transform: translate3d(-1.5%, -1%, 0) scale(.98); }
    to { transform: translate3d(1.5%, 1%, 0) scale(1.035); }
}

@media (max-width: 600px) {
    body.guest-body { padding: 1rem 1.1rem 1.25rem; }
    .guest-body .auth-card { padding: 1.4rem 1.2rem; border-radius: 1.25rem; }
    .guest-body .auth-card > img { width: min(100%, 9.5rem); margin-bottom: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    body.guest-body::before,
    .guest-body .auth-card { animation: none; }
    .guest-body .auth-card .form-control,
    .guest-body .auth-card .form-select,
    .guest-body .auth-card .btn { transition: none; }
}
