*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--background-color); color: var(--text-color); font: 17px/1.65 var(--font-body); }
main { flex: 1; min-width: 0; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: rgb(26 79 224 / 12%); touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--accent-color); text-underline-offset: 4px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0 0 16px; font-family: var(--font-heading); line-height: 1.2; letter-spacing: -.015em; font-weight: 600; }
h1 { font-size: clamp(34px, 5vw, 56px); }
h2 { font-size: clamp(28px, 3.4vw, 42px); }
h3 { font-size: clamp(20px, 2vw, 25px); }
h4 { font-size: 18px; }
p { margin: 0 0 18px; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 24px; }
:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 4px; }
[hidden] { display: none !important; }
.container { width: min(calc(100% - 2 * var(--gutter)), var(--max-width)); margin-inline: auto; }
main.container, main > .container { padding-block: 40px var(--section-space); }
.eyebrow { margin-bottom: 20px; font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--muted); }
.muted, .page-description { color: var(--muted); }
.page-description { font-size: clamp(17px, 2vw, 20px); max-width: 62ch; }
.page-header { padding-block: clamp(36px, 5vw, 64px); border-bottom: 1px solid var(--border-color); background: var(--surface-soft); }
.page-header h1 { max-width: 22ch; }
.page-header .eyebrow { margin-bottom: 12px; }
.btn, .btn-submit, .btn-save, .btn-add, .btn-reorder, .btn-action { display: inline-flex; justify-content: center; align-items: center; gap: 16px; min-height: 48px; padding: 12px 22px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--accent-color); color: var(--light-text-color); font-weight: 600; font-size: 15px; line-height: 1.4; text-decoration: none; transition: background .2s, transform .2s var(--ease); }
.btn:hover, .btn-submit:hover, .btn-save:hover, .btn-add:hover { color: var(--light-text-color); background: var(--primary-hover);  }
.btn--secondary, .btn-reorder { background: transparent; border-color: var(--control-border); color: var(--text-color); }
.btn--secondary:hover, .btn-reorder:hover { background: var(--surface-soft); color: var(--text-color); }
.btn--text { background: transparent; padding-inline: 0; color: var(--accent-color); }
.btn--text:hover { background: transparent; color: var(--primary-hover); }
button:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }
.button-group, .profile-action-buttons, .header-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.centered-button-group { margin-top: 28px; }
.skip-link { position: fixed; top: 12px; left: 16px; z-index: 5000; padding: 12px 20px; background: var(--card-background); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.form-group { min-width: 0; margin-bottom: 22px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
input:not([type='checkbox']):not([type='hidden']), select, textarea { width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; border: 1px solid var(--control-border); border-radius: var(--radius-sm); color: var(--text-color); background: var(--card-background); font-size: 16px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-color); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.full-width { grid-column: 1 / -1; }
fieldset { min-width: 0; padding: 0; border: 0; margin: 0 0 28px; }
legend { padding: 0 0 20px; font: 600 21px/1.3 var(--font-heading); letter-spacing: -.025em; }
.form-status, #form-status { display: none; margin-block: 16px; padding: 14px 16px; border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.form-status:not(:empty) { display: block; }
.form-status.success, #form-status.success { background: var(--success-bg-light); color: var(--success-text-light); }
.form-status.error, #form-status.error, p.error { background: var(--error-bg-light); color: var(--error-text-light); }
p.error { padding: 14px; border-radius: var(--radius-sm); margin-top: 16px; }
.info-alert { padding: 16px; background: var(--info-bg-light); color: var(--info-text-light); border-radius: var(--radius-sm); margin-bottom: 24px; }
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 56px !important; }
.password-toggle-icon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; background: transparent; color: var(--muted); border: 0; border-radius: 6px; }
.password-toggle-icon:hover { color: var(--accent-color); }
.form-link { display: block; margin-top: 20px; text-align: center; font-size: 15px; }
.modal { display: none; position: fixed; inset: 0; z-index: 3000; padding: 24px; background: rgb(8 19 34 / 65%); overflow-y: auto; overscroll-behavior: contain; }
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-content { background: var(--card-background); border-radius: var(--radius); padding: clamp(20px, 4vw, 36px); width: min(100%, 700px); max-height: calc(100dvh - 48px); overflow-y: auto; box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border-color); padding-bottom: 16px; margin-bottom: 24px; }
.modal-header h3 { margin: 0; }
.close-btn { min-width: 44px; min-height: 44px; border: 0; border-radius: 8px; background: var(--surface-soft); color: var(--text-color); font-size: 26px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
body.dialog-open { overflow: hidden; }
@media (max-width: 600px) {
    body { font-size: 16px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .button-group > .btn { flex: 1; }
    .modal { padding: 12px; }
    .modal-content { max-height: calc(100dvh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

code, pre { font-family: var(--font-mono); }
.page-header h1 { line-height: 1; }
.page-header { background: var(--background-color); }

.btn, .btn-submit { border-radius: 6px; }
.btn--text { border-radius: 0; }
.page-header { background: var(--surface-soft); }
h1, h2, h3 { letter-spacing: -.04em; }

/* One disclosure language for native schedule and account details. */
.disclosure-control { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--accent-color); transition: background 240ms var(--ease); }
.disclosure-control svg { transition: transform 240ms var(--ease); }
details[open] > summary .disclosure-control svg { transform: rotate(180deg); }
details[open] > summary .disclosure-control { background: var(--accent-tint); }
@media (hover: hover) and (pointer: fine) { details:hover > summary .disclosure-control { background: var(--accent-tint); } }
@media (prefers-reduced-motion: reduce) { .disclosure-control, .disclosure-control svg { transition: none; } }

/* A surface identifies a whole content group; spacing handles its interior. */
.content-group { min-width: 0; padding: clamp(18px, 3vw, 32px); background: var(--card-background); border: 0; border-radius: 10px; }

.field-error { margin: 6px 0 0; font-size: 12px; color: var(--error-text-light); line-height: 1.6; }
