@font-face {
    font-family: "Avenir LT Pro";
    src: url("../fonts/AvenirLTProLight.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Avenir LT Pro";
    src: url("../fonts/AvenirLTProMedium.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Avenir LT Pro";
    src: url("../fonts/AvenirLTProHeavy.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Avenir LT Pro";
    src: url("../fonts/AvenirLTProBlack.otf") format("opentype");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/*
  Design tokens derived from Figma
  - Colors/color-primary: #ea167c
  - Colors/color-secondary: #084b8e
  - Colors/color-border: #d4d4d8
  - gray/800: #27272A
  - gray/500: #71717A
  - white: #FFFFFF
*/
:root {
    /* Colors */
    --color-primary: #ea167c;
    --color-primary-contrast: #ffffff;
    --color-secondary: #084b8e;
    --color-info: #0dcaf0;
    --color-warning: #ffc107;
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-text: #27272a;
    --color-text-muted: #414147;
    --color-border: #d4d4d8;
    --color-gray-800: #27272a;
    --color-gray-500: #71717a;
    --color-light-gray: #777777;
    --color-heading: #414042;
    --color-progress-track: #d9d9d9;
    --color-danger: #dc3545;
    --color-success: #198754;
    /* Typography */
    --font-family-sans: "Avenir LT Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --font-size-100: 12px;
    --font-size-200: 14px;
    --font-size-300: 16px; /* Base */
    --font-size-400: 18px;
    --font-size-500: 20px;
    --font-size-600: 24px; /* H1 */
    --line-height-tight: 1.25;
    --line-height-default: 1.5;
    --weight-light: 300; /* Rotman Light */
    --weight-medium: 500; /* Rotman Medium */
    --weight-bold: 700; /* Rotman Heavy */
    --weight-black: 900; /* Rotman Black - used for H1 */
    /* Headings */
    --h1-size: 24px; /* Rotman H1 */
    --h1-weight: var(--weight-black);
    --h1-line-height: var(--line-height-default);
    /* Spacing scale */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 48px;
    /* Layout */
    --container-max: 1200px;
    --radius-s: 4px;
    --radius-m: 10px;
    --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-m: 0 8px 24px rgba(0, 0, 0, 0.08);
    /* Controls */
    --control-height: 56px;
}

/* Basic reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-family-sans);
    font-size: var(--font-size-300);
    line-height: var(--line-height-default);
    color: var(--color-text);
    background: var(--color-bg);
}

main {
    padding: var(--space-6) 0 var(--space-8);
}

img {
    max-width: 100%;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* Utilities */
.container {
    width: min(100% - 1rem, var(--container-max));
    margin-inline: auto;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-5);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.grid {
    display: grid;
    gap: var(--space-5);
}

.grid--cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 960px) {
    .grid--cols-2 {
        grid-template-columns: 1fr;
    }

    .grid--cols-3 {
        grid-template-columns: 1fr;
    }
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 1001;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: var(--weight-bold);
}

.brand__mark {
    inline-size: 10px;
    block-size: 24px;
    background: var(--color-primary);
    border-radius: 2px;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

    .nav a {
        color: var(--color-text);
        text-decoration: none;
        font-weight: var(--weight-medium);
    }

        .nav a[aria-current="page"] {
            color: var(--color-primary);
        }

/* Header variant for registration/authenticated layout */
.registration-header {
    background: var(--color-primary);
}

    .registration-header .header__inner {
        color: var(--color-primary-contrast);
    }

    .registration-header .nav a,
    .registration-header .brand,
    .registration-header .brand img,
    .registration-header .icon-row {
        color: var(--color-primary-contrast);
    }

    .registration-header .nav a {
        color: var(--color-primary-contrast);
    }

        .registration-header .nav a:hover,
        .registration-header .nav a:focus {
            opacity: 0.9;
        }

/* Hero */
.hero {
    padding: var(--space-6) 0 var(--space-5);
    padding-top: 0 !important;
}

    .hero h1 {
        margin: 0;
        font-size: var(--h1-size);
        font-weight: var(--h1-weight);
        line-height: var(--h1-line-height);
    }

    .hero p {
        margin: var(--space-2) 0 0 0;
        color: var(--color-text-muted);
    }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 16px;
    border-radius: var(--radius-s);
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    font-weight: var(--weight-medium);
    line-height: 1;
}

.btn--primary {
    color: var(--color-primary-contrast);
    background: var(--color-primary);
}

.btn--secondary {
    color: var(--color-primary);
    background: transparent;
    border-color: var(--color-primary);
}

.btn--ghost {
    color: var(--color-text);
    background: transparent;
    border-color: var(--color-border);
}

/* CTA button variant matching secondary brand */
.btn--secondary-fill {
    color: var(--color-primary-contrast);
    background: var(--color-secondary);
}

/* White outline button (for use on colored headers) */
.btn--white-outline {
    color: #ffffff;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.9);
}

    .btn--white-outline:hover,
    .btn--white-outline:focus {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.1);
    }

/* Full-width button utility */
.btn--block {
    display: flex;
    width: 100%;
}

.btn:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-s);
}

.card__header {
    padding: var(--space-4) var(--space-5) var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.card__title {
    margin: 0;
    font-size: var(--font-size-400);
    font-weight: var(--weight-bold);
}

.card__body {
    height: 100%;
    padding: var(--space-7);
}

/* ------------------------------------ */
/* Application Detail (Program Application) */
/* ------------------------------------ */

.application-detail__hero-title {
    margin: 0 0 var(--space-2);
}

.application-detail__hero-subtitle {
    font-size: var(--font-size-600);
    color: var(--color-text);
    margin: 0 0 var(--space-3);
}

.application-detail__status {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
}

.application-detail__status-note {
    margin-top: 0;
}

.application-detail__info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}

.application-detail__card-body-grid {
    display: grid;
    height: 100%;
    gap: var(--space-4);
}

.application-detail__inline-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.application-detail__payment-meta {
    font-size: var(--font-size-400);
}

.application-detail__payment-amount {
    font-size: var(--font-size-400);
    font-weight: var(--weight-bold);
}

.application-detail__discount-amount {
    font-size: var(--font-size-400);
    font-weight: var(--weight-bold);
    color: var(--color-success);
}

.application-detail__balance {
    font-size: var(--font-size-500);
    font-weight: var(--weight-black);
    color: var(--color-primary);
}

.application-detail__payments-card {
    margin-bottom: var(--space-5);
}

.application-detail__payments-mobile-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-s);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    background: #fafafa;
}

.application-detail__payments-mobile-grid {
    display: grid;
    gap: var(--space-2);
}

.application-detail__participants-card {
    margin-bottom: var(--space-5);
}

.application-detail__participant-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
}

.application-detail__participant-avatar {
    inline-size: 40px;
    block-size: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--weight-bold);
}

.application-detail__participant-name {
    font-weight: var(--weight-medium);
}

.application-detail__participant-email {
    font-size: var(--font-size-200);
    color: var(--color-text-muted);
}

/* Small button variant for compact actions */
.btn-sm {
    font-size: var(--font-size-200);
    padding: 6px 12px;
}

/* Table refinements for detail pages */
.table--application-detail {
    font-size: var(--font-size-300);
}

    .table--application-detail thead th {
        font-size: var(--font-size-200);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .table--application-detail tbody tr {
        transition: background-color 0.2s ease;
    }

        .table--application-detail tbody tr:hover {
            background-color: #f8f9fa;
        }

/* Accessibility improvements specific to links on detail pages */
.link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Skeleton loading states (shared) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient( 90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75% );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Alerts */
.alert {
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-s);
    background: #f8f9fa;
    color: var(--color-text);
}

.alert-success {
    background: #edf7f0;
    border-color: rgba(25, 135, 84, 0.35);
    color: #0f5132;
}

.alert-danger {
    background: #fdecec;
    border-color: rgba(220, 53, 69, 0.35);
    color: #842029;
}

/* Stat block */
.stat {
    display: grid;
    gap: var(--space-2);
}

.stat__label {
    color: var(--color-text-muted);
    font-size: var(--font-size-200);
}

.stat__value {
    font-size: 28px;
    font-weight: var(--weight-black);
    line-height: var(--line-height-tight);
}

/* Table */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    .table thead th {
        text-align: left;
        font-weight: var(--weight-medium);
        color: var(--color-text-muted);
        padding: var(--space-3) var(--space-4);
        border-bottom: 1px solid var(--color-border);
    }

    .table tbody td {
        padding: var(--space-4);
        border-bottom: 1px solid var(--color-border);
    }

/* Mobile Payment Cards */
.mobile-payment-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: var(--space-3);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mobile-payment-card__header {
    background: var(--color-primary);
    padding: var(--space-3);
    color: white;
}

.mobile-payment-card__id {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.mobile-payment-card__badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: var(--weight-semibold);
}

.mobile-payment-card__type {
    font-size: 0.8125rem;
    opacity: 0.9;
}

.mobile-payment-card__amount {
    font-size: 1.75rem;
    font-weight: var(--weight-bold);
    letter-spacing: -0.02em;
}

.mobile-payment-card__body {
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.mobile-payment-card__info-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9375rem;
    color: #4b5563;
}

.mobile-payment-card__icon {
    flex-shrink: 0;
    color: #6b7280;
}

.mobile-payment-card__ref {
    font-family: monospace;
    font-size: 0.875rem;
}

.mobile-payment-card__discount {
    margin-left: 0;
}

.mobile-payment-card__footer {
    padding: var(--space-2) var(--space-3) var(--space-3);
}

.mobile-payment-card__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: 0.875rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #002a5c;
    font-weight: var(--weight-medium);
    text-decoration: none;
    transition: all 0.2s ease;
}

    .mobile-payment-card__button:hover {
        background: #f3f4f6;
        border-color: #002a5c;
        color: #002a5c;
    }

    .mobile-payment-card__button svg {
        flex-shrink: 0;
    }

@@media (max-width: 768px) {
    /* Hero section - stack vertically */
    .application-detail__hero-flex {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start !important;
    }

    .application-detail__status {
        width: 100%;
    }
    /* 3-column grid becomes 1 column */
    .application-detail__info-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-3) !important;
    }

    .application-program__dates-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-1) !important;
    }
    /* Card body grids - make single column */
    .application-detail__card-body-grid {
        grid-template-columns: 1fr !important;
    }
    /* Reduce padding on mobile */
    .card__body {
        padding: var(--space-3) !important;
    }

    .card__header {
        padding: var(--space-3) !important;
    }
    /* Hero title sizing */
    .application-detail__hero-title {
        font-size: 1.5rem !important;
    }

    .application-detail__hero-subtitle {
        font-size: 0.9375rem !important;
    }
    /* Participant cards - better mobile layout */
    .application-detail__participant-card {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
    /* Payment inline rows - allow wrapping */
    .application-detail__inline-row {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    /* Make buttons full width on mobile */
    .btn {
        width: 100%;
        justify-content: center;
    }
    /* Actions card buttons */
    .card .btn {
        text-align: center;
    }
}

@@media (max-width: 480px) {
    /* Extra small devices - further adjustments */
    .container {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }

    .hero {
        padding: var(--space-3) 0;
    }

    .application-detail__hero-title {
        font-size: 1.25rem !important;
    }

    .card__body {
        padding: var(--space-2) !important;
    }

    .card__header {
        padding: var(--space-2) !important;
    }
}

/* Print styles for detail pages */
@media print {
    .btn,
    .d-none.d-md-block,
    .d-block.d-md-none {
        display: none !important;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: var(--font-size-200);
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: #fafafa;
}

.badge--primary {
    color: var(--color-primary-contrast);
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.badge--success {
    color: green;
}

.badge--warning {
    color: #212529;
}

.badge--info {
    color: var(--color-primary-contrast);
}

.badge--danger {
    color: var(--color-danger);
}

.badge--secondary {
    color: var(--color-text);
}

.transaction-id--value {
    color: var(--color-primary);
}

/* Forms */
.field {
    display: grid;
    gap: var(--space-1);
}

.field--full {
    grid-column: 1 / -1;
}

.label {
    font-weight: var(--weight-medium);
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-s);
    background: var(--color-surface);
    font-weight: var(--weight-light) !important;
}

    .input::placeholder {
        color: var(--color-text-muted);
    }

    /* Validation states */
    .is-invalid,
    .input.is-invalid,
    .select.is-invalid,
    .form-control.is-invalid,
    .form-select.is-invalid {
        border-color: var(--color-danger) !important;
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
    }

    .is-valid,
    .input.is-valid,
    .select.is-valid,
    .form-control.is-valid,
    .form-select.is-valid {
        border-color: var(--color-success) !important;
    }

.invalid-feedback,
.text-danger[role="alert"] {
    display: none;
    color: var(--color-danger);
    font-size: var(--font-size-200);
}

.is-invalid + .invalid-feedback,
.float-field .is-invalid ~ .invalid-feedback {
    display: block;
}

.password-strength {
    margin-top: 6px;
    font-size: var(--font-size-200);
}

    .password-strength.very-weak {
        color: var(--color-danger);
    }

    .password-strength.weak {
        color: #fd7e14;
    }

    .password-strength.fair {
        color: #ffc107;
    }

    .password-strength.good {
        color: #20c997;
    }

    .password-strength.strong {
        color: #28a745;
    }

/* Password strength bar (shared) */
.password-strength-bar {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak {
    background-color: #dc3545;
}

.strength-fair {
    background-color: #fd7e14;
}

.strength-good {
    background-color: #ffc107;
}

.strength-strong {
    background-color: #28a745;
}

/* Footer */
.footer {
    padding: var(--space-6) 0;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
}



/* Registration (Step 1) */
.registration-header {
    background: var(--color-primary);
}

.registration-header__inner {
    height: 70px;
    display: flex;
    align-items: center;
}

/*.registration {
  padding: var(--space-6) 0 var(--space-8);
}*/

.registration__shell {
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
    display: grid;
    gap: var(--space-5);
}

.registration__title {
    margin: 0;
    text-align: center;
    font-size: var(--h1-size);
    font-weight: var(--h1-weight);
    line-height: var(--h1-line-height);
    color: var(--color-heading);
}

.info-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: #f4f4f4;
    color: var(--color-light-gray);
    padding: 10px;
    border-radius: var(--radius-s);
}

.link {
    all: unset;
    color: var(--color-secondary);
    text-decoration: underline;
    cursor: pointer;
}

/* Account dropdown (framework-agnostic) */
.account {
    position: relative;
}

.account__button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-primary-contrast);
    background: transparent;
    border: 0;
    padding: 8px 10px;
    cursor: pointer;
    text-decoration: none;
}

    .account__button:focus-visible {
        outline: 2px solid rgba(255,255,255,0.9);
        outline-offset: 2px;
        border-radius: var(--radius-s);
    }

.account__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-m);
    display: none;
    z-index: 1002;
}

    .account__menu.is-open {
        display: block;
    }

    .account__menu a {
        display: block;
        padding: 10px 14px;
        color: var(--color-text);
        text-decoration: none;
    }

        .account__menu a:hover,
        .account__menu a:focus {
            background: #f7f7f7;
        }

.account__divider {
    height: 1px;
    background: var(--color-border);
    margin: 6px 0;
}
/* Progress */
.progress {
    display: grid;
    gap: var(--space-3);
}

.progress__label {
    /*color: var(--color-secondary);*/
    font-weight: var(--weight-bold);
}

.progress__track {
    height: 20px;
    background: var(--color-progress-track);
    border-radius: 4px;
    overflow: hidden;
}

.progress__bar {
    height: 100%;
    width: var(--progress, 0%);
    background: var(--color-secondary);
    border-start-start-radius: 4px;
    border-end-start-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--space-2);
}

.progress__value {
    color: #ffffff;
    font-size: var(--font-size-100);
    line-height: 1;
}

/* Form specifics */
.form-stack {
    display: grid;
    gap: var(--space-5);
}

.label--strong {
    color: var(--color-gray-800);
    font-weight: var(--weight-bold);
}

.select,
.input {
    height: var(--control-height);
}

.select {
    cursor: pointer;
}

.float-field {
    position: relative;
}

.float-field__control {
    padding-top: 18px;
    padding-bottom: 8px;
}

/* Input with inline icon (e.g., info icon) */
.input--with-icon {
    padding-right: 40px;
}

.input__icon {
    position: absolute;
    right: 12px;
    top: 30px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.65;
    z-index: 1;
}

/* Lightweight tooltip for form fields (shown on hover/focus) */
.tooltip--field {
    position: absolute;
    right: -365px;
    top: 0;
    display: none;
    width: min(320px, 80vw);
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-m);
    padding: 10px 12px;
    z-index: var(--z-tooltip, 1060);
}

    .tooltip--field::before {
        content: "";
        position: absolute;
        right: 14px;
        top: -6px;
        border-width: 6px;
        border-style: solid;
        border-color: transparent transparent var(--color-border) transparent;
    }

    .tooltip--field::after {
        content: "";
        position: absolute;
        right: 14px;
        top: -5px;
        border-width: 6px;
        border-style: solid;
        border-color: transparent transparent var(--color-surface) transparent;
    }

/* Position the password requirements tooltip above the input */
#password-reqs.tooltip--field {
    top: 0;
    left: -365px;
    /*bottom: calc(100% + 6px);*/
}

    #password-reqs.tooltip--field::before {
        top: auto;
        /*bottom: -6px;*/
        border-color: var(--color-border) transparent transparent transparent;
    }

    #password-reqs.tooltip--field::after {
        top: auto;
        /*bottom: -5px;*/
        border-color: var(--color-surface) transparent transparent transparent;
    }

.tooltip__list {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--color-light-gray);
    font-size: var(--font-size-200);
}

    .tooltip__list li {
        margin: 0 0 0.25rem 0;
    }
        /* Live password requirement colors */
        .tooltip__list li.is-met {
            color: var(--color-success);
        }

        .tooltip__list li.is-not-met {
            color: var(--color-danger);
        }

/* Reveal tooltip on field hover or focus */
.float-field:hover .tooltip--field,
.float-field:focus-within .tooltip--field {
    display: block;
}

.float-field__label {
    position: absolute;
    top: 30px;
    left: 12px;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-weight: var(--weight-light);
    background: var(--color-surface);
    padding: 0 4px;
    pointer-events: none;
    z-index: 2;
    transition: top 120ms ease, transform 120ms ease, font-size 120ms ease, color 120ms ease;
}

/* Wrap correspondence email label into two lines when inside the field */
.float-field--correspondence .float-field__label {
    white-space: normal;
    max-width: calc(100% - 56px); /* keep clear of the icon */
    line-height: 1.2;
}

.float-field--correspondence:focus-within .float-field__label,
.float-field--correspondence input:not(:placeholder-shown) + .float-field__label,
.float-field--correspondence.has-value .float-field__label {
    white-space: nowrap;
    max-width: none;
}

/* Float when focused or when there is content */
.float-field:focus-within .float-field__label,
.float-field input:not(:placeholder-shown) + .float-field__label,
.float-field.has-value .float-field__label {
    top: -8px;
    transform: none;
    font-size: var(--font-size-200);
}

.select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--color-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 40px;
}

/* For selects that also have an info icon, give extra space and move chevron left */
.select--with-info-icon {
    background-position: right 36px center;
    padding-right: 64px;
}

/* Select2 overrides to match native inputs/selects */
.select2-container {
    width: 100% !important;
    font-size: inherit;
}

    .select2-container .select2-selection--single .select2-selection__rendered {
        padding-left: 0 !important;
        display: initial !important;
    }

    .select2-container .select2-selection--single {
        height: var(--control-height) !important;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-s);
        background: var(--color-surface);
        display: flex;
        align-items: center;
        padding: 10px 12px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 16px 16px;
        padding-right: 40px;
    }

/* Match float-field control padding for label overlap */
.float-field .select2-container .select2-selection--single {
    padding-top: 18px;
    padding-bottom: 8px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    margin: 0;
    padding: 0;
    width: 100%;
    color: inherit;
    font-weight: var(--weight-light) !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--color-text-muted);
}

/* Hide default arrow; we use background-image chevron above */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none;
}

/* Validation states parity */
.is-invalid + .select2 .select2-selection--single {
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.is-valid + .select2 .select2-selection--single {
    border-color: var(--color-success) !important;
}

/* Dropdown styling */
.select2-dropdown {
    border-color: var(--color-border);
    border-radius: var(--radius-s);
    background: var(--color-surface);
}

.select2-results__option {
    padding: 10px 12px;
}

.select2-results__option--highlighted.select2-results__option--selectable {
    background: #f7f7f7;
    color: inherit;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-s);
    padding: 8px 10px;
    outline: none;
}

.help-list {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--color-light-gray);
}

    .help-list li {
        margin: 0 0 0.25rem 0;
    }

.privacy {
    color: var(--color-light-gray);
}

    .privacy a {
        color: inherit;
        text-decoration: underline;
    }

.checkbox {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}

    /* Hide inline unobtrusive span for the consent checkbox; we render a dedicated block below */
    .checkbox input[name="ViewModel.AgreeToPrivacyNotice"] ~ .invalid-feedback,
    .checkbox input[name="ViewModel.AgreeToPrivacyNotice"] ~ [data-valmsg-for="ViewModel.AgreeToPrivacyNotice"] {
        display: none !important;
    }

    .checkbox input[type="checkbox"] {
        inline-size: 16px;
        block-size: 16px;
        accent-color: var(--color-secondary);
    }

.form-actions {
    display: grid;
    gap: var(--space-4);
}

/* Text utilities */
.text-secondary {
    color: var(--color-text);
}

.text-center {
    text-align: center;
}

.margin-0 {
    margin: 0;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-5 {
    margin-bottom: 20px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mb-7 {
    margin-bottom: 28px;
}

.mb-8 {
    margin-bottom: 32px;
}

.mb-9 {
    margin-bottom: 36px;
}

.mb-10 {
    margin-bottom: 40px;
}

/* Icon utilities */
.icon-row {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.icon {
    inline-size: 20px;
    block-size: 20px;
}

.icon--md {
    inline-size: 24px;
    block-size: 24px;
}


.wizard-step-content {
    gap: var(--space-5);
    display: flex;
    flex-direction: column;
}

/* Modal (lightweight, framework-agnostic) */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

    .modal.is-open {
        display: flex;
    }

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.modal__dialog {
    position: relative;
    width: min(720px, 92vw);
    max-height: 80vh;
    overflow: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-m);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.modal__body {
    padding: var(--space-5);
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
}

.modal__close {
    background: transparent;
    border: 0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    main {
        padding: var(--space-4) 0 var(--space-3);
        margin: 0;
    }

    .card {
        border: 0;
    }

    .card__body {
        padding: 0;
    }

    .hero {
        padding: var(--space-4) 0 var(--space-3);
    }
}

/* Application detail responsive tweaks */
@media (max-width: 1024px) {
    .application-detail__info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: var(--font-size-500);
    }

    .hero p {
        font-size: var(--font-size-300);
    }

    .card__body {
        padding: var(--space-4);
    }
}

/* ------------------------------------ */
/* Dashboard (Index) */
/* ------------------------------------ */

/* Attention Block */
.dashboard__attention-block {
    margin-top: 4px;
}

    .dashboard__attention-block p {
        margin: 0 0 6px 0;
    }

.dashboard__attention-label {
    color: #E20778;
    font-weight: var(--weight-bold);
}

.dashboard__attention-block ul {
    margin: 0;
    padding-left: 20px;
}

/* Program Application Cards */
.dashboard__program-card {
    margin-top: 8px;
}

.dashboard__program-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.dashboard__program-card-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.dashboard__program-card-title {
    margin: 0 0 4px 0;
}

.dashboard__program-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.dashboard__program-card-actions {
    display: flex;
    gap: var(--space-3);
}

/* Mobile Program Card */
.mobile-program-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-s);
    padding: 14px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-top: 10px;
}

.mobile-program-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.mobile-program-card__headings {
    flex: 1;
}

.mobile-program-card__code {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-s);
    background: var(--color-secondary);
    color: #ffffff;
    font-weight: var(--weight-black);
    border: 1px solid var(--color-border);
    padding: 2px;
}

    .mobile-program-card__code span {
        display: block;
        max-width: 100%;
        text-align: center;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
        line-height: 1.1;
        font-size: 12px;
    }

.mobile-program-card__title {
    margin: 0 0 2px 0;
    font-size: 1rem;
    line-height: 1.2;
}

.mobile-program-card__subtitle {
    margin: 0;
    color: var(--color-light-gray);
    font-size: 0.9rem;
}

.mobile-program-card__meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 8px 0 12px 0;
}

.mobile-program-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mobile-program-card__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.btn-mobile-cta {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    border-radius: var(--radius-s);
}

/* Enhanced Card Design (for future use) */
.application-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

    .application-card:hover {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

    .application-card.border-primary {
        border-left: 4px solid #0d6efd !important;
        background: linear-gradient(135deg, rgba(13, 110, 253, 0.02), rgba(13, 110, 253, 0.05));
    }

/* Touch-Friendly Buttons */
.btn-touch {
    min-height: 44px;
    padding: 12px 20px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

    .btn-touch:active {
        transform: scale(0.98);
    }

/* Summary Cards */
.summary-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #fff, #f8f9fa);
}

    .summary-card:hover {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
        transform: translateY(-3px);
    }

.summary-icon {
    opacity: 0.8;
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem !important;
}

/* Empty State Design */
.empty-state .icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

    .empty-state .icon-circle i {
        font-size: 2.5rem;
    }

/* Text Utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile Program Code Badge */
.program-code-mobile .badge {
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* Navigation Active State */
.navbar-nav .nav-link.active {
    font-weight: 600;
    color: #0d6efd !important;
    position: relative;
}

    .navbar-nav .nav-link.active::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
        height: 2px;
        background: #0d6efd;
        border-radius: 1px;
    }

/* Button Improvements */
.btn-link {
    text-decoration: none;
    color: #0d6efd;
    font-weight: 500;
}

    .btn-link:hover {
        text-decoration: underline;
        color: #0a58ca;
    }

/* Hidden IDs next to program name (visible when selecting) */
.hidden-ids {
    color: #ffffff;
}

    .hidden-ids::selection {
        color: #000000;
        background: #b3d4fc;
    }

    .hidden-ids::-moz-selection {
        color: #000000;
        background: #b3d4fc;
    }

/* Dashboard Responsive */
@media (max-width: 768px) {
    .welcome-section h4 {
        font-size: 1.25rem;
    }

    .summary-card .card-body {
        padding: 1rem 0.75rem;
    }

    .application-card .card-body {
        padding: 1rem;
    }

    .program-meta {
        font-size: 0.8rem;
    }
}

/* Large Screen Optimizations */
@media (min-width: 992px) {
    .welcome-section {
        padding: 2rem 2.5rem;
    }

    .application-card .card-body {
        padding: 1.5rem;
    }
}

/* Performance Optimizations */
.application-card,
.summary-card {
    will-change: transform;
}

/* Focus Indicators for Accessibility */
.btn:focus,
.btn-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .application-card {
        border-width: 2px;
    }

    .summary-card {
        border: 2px solid #dee2e6;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .application-card,
    .summary-card,
    .btn-touch {
        transition: none;
    }

        .application-card:hover,
        .summary-card:hover {
            transform: none;
        }
}

/* Mobile header/nav base */
.header__menu-toggle {
    display: none;
    align-items: center;
    gap: var(--space-2);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-s);
    padding: 8px 10px;
    cursor: pointer;
    color: inherit;
}

    .header__menu-toggle .hamburger {
        inline-size: 20px;
        block-size: 2px;
        background: currentColor;
        position: relative;
    }

        .header__menu-toggle .hamburger::before,
        .header__menu-toggle .hamburger::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            block-size: 2px;
            background: currentColor;
        }

        .header__menu-toggle .hamburger::before {
            top: -6px;
        }

        .header__menu-toggle .hamburger::after {
            top: 6px;
        }

@media (max-width: 768px) {
    .header {
        z-index: 1100;
    }

    .header__inner {
        position: relative;
    }

    .header__menu-toggle {
        display: inline-flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 50vw;
        display: none;
        flex-direction: column;
        align-items: flex-end;
        gap: 0;
        background: var(--color-surface);
        border-left: 1px solid var(--color-border);
        box-shadow: var(--shadow-s);
        overflow-y: auto;
        padding-top: 70px;
    }

        .nav a {
            padding: 12px 16px;
            text-align: right;
            display: block;
            width: 100%;
            border-bottom: 1px solid var(--color-border);
        }

    .nav__meta {
        justify-content: flex-end;
        text-align: right;
        width: 100%;
    }

    .nav.is-open {
        display: flex;
    }

    /* Registration header (white-on-pink) adjustments */
    .registration-header .nav {
        background: var(--color-primary);
        border-left-color: rgba(255, 255, 255, 0.25);
    }

        .registration-header .nav a {
            color: var(--color-primary-contrast);
        }

    .registration-header .header__menu-toggle {
        border-color: rgba(255, 255, 255, 0.5);
        color: var(--color-primary-contrast);
    }

    .registration-header .nav__divider {
        background: rgba(255, 255, 255, 0.35);
    }

    .registration-header .nav__meta {
        color: rgba(255, 255, 255, 0.9);
    }
}

/* Header actions alignment */
.header__actions {
    gap: var(--space-4);
}

/* Refined toggle styling */
.header__menu-toggle {
    border-color: rgba(255,255,255,0.6);
}

.registration-header .header__menu-toggle {
    border-color: rgba(255,255,255,0.6);
}

.header__menu-label {
    font-weight: var(--weight-medium);
}

@media (max-width: 768px) {
    .brand {
        gap: var(--space-2);
    }

    .header__menu-label {
        font-size: var(--font-size-200);
    }

    /* Hide verbose welcome label on small screens, keep icon */
    .account__label {
        display: none;
    }

    /* Remove border from hamburger toggle on mobile */
    .header__menu-toggle {
        border: 0;
    }
}

@media (max-width: 480px) {
    /* Compress toggle on very small screens */
    .header__menu-label {
        display: none;
    }

    .header__menu-toggle {
        padding: 8px;
    }
}

/* Mobile nav account section */
.nav__mobile-only {
    display: none;
}

.nav__divider {
    height: 1px;
    background: var(--color-border);
    margin: 8px 0;
}

.nav__meta {
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text);
    font-size: var(--font-size-200);
}

@media (max-width: 768px) {
    .header__actions .account {
        display: none;
    }

    .nav__mobile-only {
        display: contents;
    }

        .nav__mobile-only a {
            padding: 12px 16px;
        }
}

/* Minimal display utilities (Bootstrap-like) */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

@media (min-width: 768px) {
    .d-md-none {
        display: none !important;
    }

    .d-md-block {
        display: block !important;
    }
}
