/* Application sheets: shared course-card geometry, white surfaces, native flow. */
:root { --popup-enter-ms: 340; --popup-exit-ms: 180; }
dialog.application-dialog { position: fixed; inset: 0; margin: 0; padding: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; border: 0; background: transparent; overflow: hidden; color: var(--ink); }
dialog.application-dialog[open] { display: grid; place-items: center; }
.application-dialog > #modal-shell { display: none; }
.application-dialog::backdrop { background: rgb(30 30 30 / 38%); backdrop-filter: grayscale(1) blur(3px); -webkit-backdrop-filter: grayscale(1) blur(3px); animation: application-backdrop-in 340ms ease-out both; }
.application-dialog[data-closing]::backdrop { animation: application-backdrop-out 180ms ease-in both; }
@keyframes application-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes application-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
.application-sheet { width: calc(min(100%,480px) - 2 * var(--site-gutter)); max-height: calc(100dvh - var(--site-gutter)); overflow: auto; overscroll-behavior: contain; scrollbar-width: none; background: var(--surface); border-radius: 10px; isolation: isolate; }
.application-sheet::-webkit-scrollbar { display: none; }
.application-sheet { overflow-anchor: none; scroll-behavior: auto; }
.application-toolbar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--surface); }
.application-close { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 0; border: 0; border-radius: 10px; color: var(--ink); background: transparent; font-size: 14px; font-weight: 500; }
.application-close .dropdown-chevron { width: 12px; height: 8px; transform: rotate(90deg); background-image: url('assets/dropdown-chevron-medium.svg'); }
.application-content { padding: 0 0 max(24px,env(safe-area-inset-bottom)); }
.application-hero.service-card { background: var(--surface); }
.application-hero .service-card-body { padding-bottom: 0; }
.application-course { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.application-course .service-title { flex: 1; margin: 0; font-family: var(--font-ui); }
/* Optical alignment with the first heading line, including wrapped titles. */
.application-course .application-check { margin-top: -2px; align-self: flex-start; flex-shrink: 0; }
.application-hero .service-description { margin-bottom: 0; }
.application-mode { margin: 8px 0 0; font-size: 12px; line-height: 1.5; }
.application-introduction { margin: 16px 16px 12px; font-size: 12px; line-height: 1.5; }
.application-choice-hint { display:block; margin-top:6px; font-weight:700; }
.application-extras { display: grid; gap: 8px; margin-top: 12px; }
.application-option { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 78px; padding: 12px 16px; overflow: hidden; border-radius: 10px; background: var(--surface-soft); cursor: pointer; }
.application-option-photo { position: absolute; z-index: -2; inset: 0 0 0 auto; width: 42%; height: 100%; object-fit: cover; }
.application-option::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,var(--surface-soft) 0%,var(--surface-soft) 54%,rgb(241 241 241 / 94%) 65%,rgb(241 241 241 / 0%) 83%); pointer-events: none; }
.application-option-copy { display: flex; flex-direction: column; gap: 4px; width: 72%; font-size: 12px; line-height: 1.35; }
.application-option-copy strong { font-weight: 600; }
.application-option-description { font-size: 11px; line-height: 1.4; }
.application-option:has(input:checked)::after { content: ""; position:absolute; inset:0; z-index:1; border:2px solid var(--service-accent); border-radius:inherit; pointer-events:none; }
.application-option:focus-within { outline: var(--focus-ring); outline-offset: 2px; }
.application-option .application-check { z-index:2; border-color:var(--service-accent,var(--blue)); box-shadow:0 0 0 3px rgb(255 255 255 / 88%); }
.application-check { appearance: none; -webkit-appearance: none; display: block; position: relative; width: 22px; height: 22px; min-width: 22px; min-height: 22px; max-height: 22px; aspect-ratio: 1; flex: 0 0 22px; margin: 0; border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.application-check:checked { background: var(--service-accent); border-color: var(--service-accent); }
.application-check:checked::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10l3.5 3.5 7.5-7.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px 20px no-repeat; }
.application-fields { display: grid; gap: 10px; margin: 18px 0 14px; }
.application-field { position: relative; display: block; }
.application-field input { width: 100%; min-height: 54px; border: 1px solid var(--line); border-radius: 10px; padding: 23px 12px 7px; font-size: 16px; line-height: 22px; background: var(--surface); color: var(--ink); box-shadow: none; }
.application-field-label { position: absolute; left: 13px; top: 7px; right: 10px; font-size: 13px; line-height: 17px; color: #757575; pointer-events: none; }
.application-field input:placeholder-shown:not(:focus) { padding-top: 15px; padding-bottom: 15px; }
.application-field input:placeholder-shown:not(:focus) + .application-field-label { top: 17px; font-size: 15px; line-height: 20px; }
.application-field input:focus { outline: 2px solid var(--blue); outline-offset: 2px; border-color: var(--blue); }
.application-field input[aria-invalid="true"] { border-color: var(--orange); }
.application-field input[aria-invalid="true"] + .application-field-label { color: var(--orange); }
.application-region { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: clip; }
.application-region-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px; list-style: none; cursor: pointer; font-size: 14px; line-height: 20px; }
.application-region-trigger::-webkit-details-marker { display: none; }
.application-region-trigger[data-placeholder="true"] { color: #929292; }
.application-region-trigger .dropdown-chevron { width: 12px; height: 8px; background-image: url('assets/dropdown-chevron-medium.svg'); }
.application-region[open] .application-region-trigger .dropdown-chevron { transform: rotate(180deg); }
.application-region[open] .application-region-trigger { border-bottom: 1px solid #1e1e1e14; }
.application-region-panel { padding: 4px 12px 12px; animation: region-reveal 120ms ease-out; }
@keyframes region-reveal { from { opacity: .4; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.application-region-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.application-region-option .application-check { border-radius: 50%; }
.application-region-note { padding: 12px; margin-top: 4px; border-radius: 10px; background: var(--surface-soft); font-size: 12px; line-height: 1.5; }
.application-region-note p { margin: 0; }
.application-region-note p + p { margin-top: 8px; }
.application-submit { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 44px; border: 0; border-radius: 10px; padding: 12px; background: var(--service-accent); color: var(--surface); font-size: 14px; line-height: 20px; font-weight: 600; }
.application-submit .dropdown-chevron { width: 12px; height: 8px; background: currentColor; mask: url('assets/dropdown-chevron-medium.svg') center / contain no-repeat; -webkit-mask: url('assets/dropdown-chevron-medium.svg') center / contain no-repeat; transform: rotate(-90deg); }
.application-consent { margin: 12px 0 0; color: #595959; font-size: 11px; line-height: 1.5; }
.application-consent p { margin: 0; }
.application-consent p:has(br):last-child { display: none; }
.application-consent u { color: var(--blue) !important; }
.application-call { margin-top: 18px; padding-top: 16px; border-top: 1px solid #1e1e1e22; font-size: 14px; line-height: 1.5; }
.application-call p { margin: 0; font-size: 12px; }
.application-call a { display: inline-flex; align-items: flex-start; padding-top: 2px; min-height: 44px; color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media(prefers-reduced-motion:reduce) { .application-dialog::backdrop,.application-dialog[data-closing]::backdrop,.application-region-panel { animation: none; } }

.application-hero .service-age { font-weight: 700; }

/* Close symbol and every checkbox share the same right-hand center line. */
.application-toolbar { justify-content: flex-end; min-height: 48px; }
.application-close { position: relative; display: grid; place-items: center; width: 48px; height: 48px; min-height: 48px; aspect-ratio: 1; padding: 0; }
.application-close-icon { position: relative; width: 16px; height: 16px; }
.application-close-icon::before,.application-close-icon::after { content: ''; position: absolute; top: 7px; left: 0; width: 16px; height: 2px; background: currentColor; transform: rotate(45deg); }
.application-close-icon::after { transform: rotate(-45deg); }

.application-course,.application-course .application-check:disabled { cursor: default; opacity: 1; }

/* The original card itself becomes the sheet; its photo is the outer edge. */
.application-toolbar { height: 0; min-height: 0; padding: 0; overflow: visible; background: transparent; }
.application-close { position: absolute; top: 0; right: 0; background: rgb(255 255 255 / 88%); border-radius: 0 10px 0 10px; }
.application-fields { margin-inline: 16px; }
.application-form-heading { margin: 24px 16px 12px; color: var(--orange); font: 700 clamp(14px,4vw,18px)/1.35 var(--font-brand); }
.application-submit { margin-inline: 16px; width: calc(100% - 32px); }
.application-consent,.application-call { margin-inline: 16px; }

/* Options and fields share one inset column; symbols retain a shared axis. */
.application-extras { margin-inline: 16px; }
.application-course .application-check { margin-right: 16px; }
.application-close { right: 0; }
.application-region-panel { padding-inline: 15px; }

/* Detailed course content uses the same sheet, fields and motion as applications. */
.course-rich-text { font-size: 12px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.course-rich-text p { margin: 0; }
.course-rich-text p + p { margin-top: 8px; }
.course-rich-text ul,.course-rich-text ol { padding-left: 20px; margin: 8px 0; }
.course-rich-text li + li { margin-top: 6px; }
.course-rich-text [style] { color: inherit !important; font-family: inherit !important; }
.course-details-sections { display: grid; gap: 8px; margin: 16px; }
.course-details-section { overflow: clip; border-radius: 10px; background: var(--surface-soft); }
.course-details-trigger { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 12px; list-style: none; cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.4; }
.course-details-trigger::-webkit-details-marker { display: none; }
.course-details-trigger .dropdown-chevron { flex: 0 0 12px; width: 12px; height: 8px; background-image: url('assets/dropdown-chevron-medium.svg'); }
.course-details-section[open] .dropdown-chevron { transform: rotate(180deg); }
.course-details-copy { margin: 0 1px 1px; padding: 12px; border-radius: 0 0 9px 9px; background: var(--surface); animation: region-reveal 120ms ease-out; }
@media(prefers-reduced-motion:reduce) { .course-details-copy { animation: none; } }

/* Open subprograms retain their course accent around the complete expanded card. */
.course-details-section { border:2px solid transparent; }
.course-details-section[open] { border-color:var(--service-accent); }
