/* All roles reuse the original form-box, parent-input and submit-btn styles. */
.form-section {
    min-height: 0;
    padding: 3rem 0;
}

/* The introduction should support both the short adult and long delegate forms. */
@media (min-width: 769px) {
    .form-content {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    }

    .form-content .col-6 {
        grid-column: auto;
    }

    .form-left {
        padding-top: 1rem;
    }

    .form-title {
        margin: 0;
        font-size: 2.75rem;
        line-height: 1.4;
    }

    .form-title-divider {
        margin-top: 1.5rem;
    }

    .form-left-image {
        max-width: 340px;
        margin-top: 2.25rem;
    }
}

.form-section [hidden] {
    display: none !important;
}

/* Preserve the existing blue/gold field borders and compact input height. */
.form-section .iti {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
    --iti-border-width: 2px;
    --iti-border-color: #5a88e3;
}

.form-section .student-form .iti {
    --iti-border-color: #efa93d;
}

.form-section .iti input.iti__tel-input {
    width: 100%;
    box-sizing: border-box;
}

.iti button {
    width: auto;
    border-radius: 0;
    font: inherit;
}

.iti .iti__selected-country {
    padding: 0;
    background: transparent;
}

.iti .iti__selected-country:focus-visible {
    outline: 2px solid #253f91;
    outline-offset: -2px;
}

.form-section .iti .iti__country-selector {
    z-index: 10;
}

.form-section .iti .iti__search-input {
    padding-top: .6rem;
    padding-bottom: .6rem;
    border: 0;
}

.iti__country-list .iti__country:nth-child(2) {
    border-bottom: 1px solid #d6dff0;
}

@media (max-width: 768px) {
    .iti {
        --iti-mobile-popup-margin: 20px;
    }
}

.form-section .form-right,
.form-section .form-group,
.form-section .form-group-half {
    min-width: 0;
}

.role-selector {
    margin: 0;
    padding: .5rem 1.3rem 1.3rem;
    min-width: 0;
    border: none;
    background: #fff;
}

.role-selector legend {
    float: left;
    width: 100%;
    padding: 0;
    margin-bottom: .5rem;
    color: #333;
    font-size: 1.5rem;
    font-weight: bold;
}

.role-selector p {
    clear: both;
    margin: 0 0 .75rem;
    color: #666;
    font-size: .9rem;
    line-height: 1.6;
}

.role-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4rem;
}

.role-option {
    position: relative;
    cursor: pointer;
}

.role-option input {
    position: absolute;
    top: 50%;
    left: .7rem;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #253f91;
    cursor: pointer;
}

.role-option-card {
    display: block;
    padding: .6rem .5rem .6rem 2.25rem;
    border: 2px solid #5a88e3;
    color: #333;
    font-size: 1rem;
    line-height: 1.6;
}

.role-option:hover .role-option-card,
.role-option input:checked + .role-option-card {
    background: #edf3ff;
}

.role-option input:checked + .role-option-card {
    border-color: #253f91;
    color: #253f91;
}

.role-option input:focus-visible + .role-option-card {
    outline: 3px solid #efa93d;
    outline-offset: 2px;
}

.role-option:has(input:disabled) {
    opacity: .6;
}

.role-prompt {
    margin: 0;
    padding: 1rem 1.3rem;
    background: #fff;
    color: #666;
    font-size: 1rem;
}

.role-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Keep accessible labels with the existing placeholder-led field appearance. */
#adultForm label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.adult-submit-area {
    text-align: center;
}

.handbook-note {
    color: #294395;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.6;
    margin: .8rem 0 0;
}

.handbook-note-marker {
    color: #a86608;
    font-weight: 700;
    margin-right: .3em;
}

.handbook-note a {
    color: #294395;
    text-decoration: underline;
    text-underline-offset: .15em;
}

.handbook-note a:hover,
.handbook-note a:focus-visible {
    color: #173074;
}

.form-section .submit-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 1100px) and (min-width: 769px) {
    .nav-container {
        height: auto;
        padding-top: .5rem;
        padding-bottom: .5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .role-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-section {
        padding-top: 2rem;
    }

    .form-title {
        margin: 0;
        line-height: 1.35;
    }

    .form-title-divider {
        margin: 1.25rem auto 0;
    }

    .form-left-image {
        display: none;
    }

    .role-selector {
        padding: 1.5rem;
    }

    .role-option input {
        top: .85rem;
        left: 50%;
        transform: translateX(-50%);
    }

    .role-option-card {
        padding: 2.4rem .25rem .6rem;
        text-align: center;
        font-size: .95rem;
    }
}

@media (max-width: 359px) {
    .role-options {
        grid-template-columns: 1fr;
    }

    .role-option input {
        top: 50%;
        left: .7rem;
        transform: translateY(-50%);
    }

    .role-option-card {
        padding: .6rem .5rem .6rem 2.25rem;
        text-align: left;
    }
}
