/* Public forms in the Sunrise design: Online Registration (S-08), its confirmation (S-09) and Contact Us (S-07).
   The shared field, label, button and alert styles live in public.css; this file adds what only these pages need.
   No inline styles (CSP). */

.public-form {
    /*max-width: 62rem;*/
    margin-inline: auto;
}

.public-form__intro {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    border-left: 4px solid var(--sun-500);
}

.public-form__lead {
    margin: 0 0 6px;
    color: var(--ink);
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 600;
}

/* A card per group of fields (Personal details, Educational qualification, Photo, Declaration). */
.form-section {
    margin-bottom: 20px;
    padding: clamp(18px, 2.5vw, 28px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}

.form-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    font-size: 1.25rem;
}

.form-section__step {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sun-100);
    color: var(--sun-700);
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: 18px;
}

.form-grid .field--wide {
    grid-column: 1 / -1;
}

/* Radio groups: fieldset/legend (SRS E.5) with Bootstrap's big legend reduced to label size. */
.radio-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.radio-group legend {
    float: none;
    width: auto;
    margin-bottom: 8px;
    color: var(--ink);
    font-family: var(--font-head);
    font-size: .9375rem;
    font-weight: 600;
}

.radio-group-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.radio-group-options .form-check-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 0;
    padding: 4px 14px 4px 10px;
    /* The pill is the 44px target for the radio inside it, so its edge follows the control-boundary rule
       (3:1, WCAG 1.4.11) rather than the decorative --line-2. */
    border: 1px solid var(--control-line);
    border-radius: var(--r-pill);
    background: var(--paper);
}

.radio-group-options .form-check-inline:hover {
    border-color: var(--sky-600);
    background: var(--sky-50);
}

.radio-group-options .form-check-input {
    float: none;
    margin: 0;
}

.radio-group-options .form-check-label {
    padding: 0;
    font-weight: 600;
    cursor: pointer;
}

/* Honeypot (anti-spam): never shown to people or assistive technology. */
.form-hp {
    display: none;
}

.photo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
}

.photo-row .field {
    flex: 1 1 20rem;
}

/* Photo preview (FR-022): a fixed frame so the layout does not jump; images keep their aspect ratio. */
.photo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 9.5rem;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 2px dashed var(--line-2);
    border-radius: var(--r-md);
    background: var(--sun-50);
    text-align: center;
}

.photo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.photo-preview-empty {
    padding: .5rem;
    color: var(--muted);
    font-size: .875rem;
}

/* ---------------------------------------------------------------- live photo (js/photo-camera.js) */

.photo-camera-start {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-top: 12px;
}

/* Shown where no camera can be used (no JavaScript, no camera, not a secure page): why, and that the photo is optional. */
.photo-camera-none {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 0;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: var(--sky-50);
    color: var(--ink);
    text-align: left;
}

.photo-camera-none .icon {
    margin-top: .1em;
    color: var(--sky-700);
}

.photo-camera {
    margin-top: 18px;
    padding: clamp(14px, 2vw, 20px);
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    background: var(--sky-50);
}

.photo-camera__title {
    margin: 0 0 12px;
    color: var(--ink);
    font-family: var(--font-head);
    font-weight: 700;
}

/* Passport shape (35 x 45 mm). The video fills it the way the photo is cropped, so what shows is what is taken. */
.photo-camera__frame {
    position: relative;
    width: min(100%, 18rem);
    aspect-ratio: 7 / 9;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--sky-900);
}

.photo-camera__video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-camera--mirror .photo-camera__video {
    transform: scaleX(-1);
}

/* Where the face goes: a dashed oval, with the rest of the picture slightly dimmed. */
.photo-camera__guide {
    position: absolute;
    top: 46%;
    left: 50%;
    width: 62%;
    height: 64%;
    border: 2px dashed rgba(255, 255, 255, .9);
    border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(30, 27, 75, .3);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.photo-camera__tip {
    max-width: 46ch;
    margin: 12px 0 14px;
}

.photo-camera__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 575.98px) {
    .photo-camera__frame {
        width: 100%;
    }

    .photo-camera__actions .sbtn,
    .photo-camera-start__button {
        width: 100%;
    }
}

.declaration {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: var(--r-md);
    background: var(--sun-50);
}

.declaration .form-check-input {
    float: none;
    margin-left: 0;
}

.declaration .form-check-label {
    line-height: 1.6;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

/* Long values (emails, Hindi hints) wrap instead of forcing horizontal scrolling at 320px. */
.public-form,
.contact-page,
.form-text {
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- confirmation (S-09) */

.registration-receipt {
    max-width: 44rem;
}

.receipt {
    text-align: left;
}

.receipt__mark {
    margin-bottom: 16px;
}

.receipt-details {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.receipt-row {
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--sun-50);
}

.receipt-row dt {
    color: var(--muted);
    font-family: var(--font-head);
    font-size: .875rem;
    font-weight: 600;
}

.receipt-row dd {
    margin: 2px 0 0;
    color: var(--ink);
    font-family: var(--font-head);
    font-size: 1.35rem;
    font-weight: 700;
}

.receipt-number {
    letter-spacing: .12em;
}

.receipt-next-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 .75rem;
    color: var(--ink);
    font-weight: 600;
}

.receipt-next-step .icon {
    margin-top: .15em;
    color: var(--sky-700);
}

/* ---------------------------------------------------------------- contact (S-07) */

.contact-page__grid {
    display: grid;
    gap: clamp(24px, 4vw, 40px);
    align-items: start;
}

@media (min-width: 992px) {
    .contact-page__grid {
        grid-template-columns: .9fr 1.1fr;
    }
}

.contact-details .sec-title {
    margin-bottom: 18px;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 14px;
}

.contact-card h3 {
    margin: 12px 0 6px;
    font-size: 1.05rem;
    font-weight: 700;
}

.contact-card p,
.contact-card address,
.contact-card ul {
    margin: 0;
    font-size: .9375rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.contact-card__lead {
    color: var(--ink);
    font-size: 1rem;
}

.contact-card .tile {
    width: 44px;
    height: 44px;
    border-radius: var(--r-sm);
}

.contact-card .tile .icon {
    width: 22px;
    height: 22px;
}

.contact-card a {
    text-decoration: none;
}

.contact-card a:hover {
    text-decoration: underline;
}

/* The enquiry form panel: a sky head over the fields, like the result lookup. */
.form-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    background: var(--paper);
    box-shadow: var(--shadow-lg);
}

.form-panel__head {
    position: relative;
    overflow: hidden;
    padding: clamp(22px, 3vw, 30px);
    background: linear-gradient(135deg, var(--sky-600), var(--sky-700));
    color: #EEEDFF;
}

.form-panel__head::after {
    content: "";
    position: absolute;
    right: -50px;
    top: -60px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--sun-400) 0 34%, rgba(255, 165, 61, .35) 34.5% 56%, rgba(255, 165, 61, .15) 56.5% 78%, transparent 78.5%);
}

.public-site .form-panel__head h2 {
    position: relative;
    margin: 14px 0 0;
    color: var(--paper);
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}

.form-panel__head p {
    position: relative;
    max-width: 44ch;
    margin: 8px 0 0;
}

.form-panel__body {
    padding: clamp(20px, 3vw, 30px);
}

.form-panel__body .form-actions {
    margin-bottom: 0;
}

.form-panel__body .alert {
    margin-bottom: 16px;
}

.contact-map {
    margin-top: clamp(32px, 4vw, 48px);
}

.map-frame {
    padding: 8px;
    overflow: hidden;
}

.map-frame .ratio {
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--sky-50);
}

.map-frame iframe {
    border: 0;
}

.map-fallback {
    margin-top: 10px;
    color: var(--muted);
    font-size: .9375rem;
}

@media (max-width: 575.98px) {
    .form-actions .sbtn {
        width: 100%;
    }
}

/* ---------------------------------------------------------------- course first: choosing the course */

.course-choice__title {
    margin: 0 0 6px;
}

.course-choice__lead {
    max-width: 62ch;
    margin: 0 0 20px;
}

.course-picks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    gap: 14px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.course-picks > li {
    display: flex;
}

/* Each card is a link, so its colours are written against ".public-site a", which would otherwise win. The name
   of the link is everything on the card: code, full name and duration. */
.public-site .course-pick {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-height: 44px;
    padding: 16px 18px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    background: var(--paper);
    color: var(--body);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.public-site .course-pick:hover {
    border-color: var(--sky-600);
    color: var(--body);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.public-site .course-pick:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.course-pick__title {
    color: var(--ink);
    font-family: var(--font-head);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
}

.course-pick__note {
    color: var(--body);
    line-height: 1.4;
}

/* The same pill as the course cards on the Courses page: indigo on lavender, 6.3:1. */
.course-pick__duration,
.course-applied__duration {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-top: auto;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: var(--sky-100);
    color: var(--sky-700);
    font-size: .8125rem;
    font-weight: 700;
}

.course-pick__duration .icon,
.course-applied__duration .icon {
    width: 1em;
    height: 1em;
}

.public-site .course-pick--unsure {
    border-style: dashed;
    background: var(--sky-50);
    box-shadow: none;
}

.course-choice__note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0;
    color: var(--body);
}

/* The chosen course at the top of the form. */
.course-applied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: var(--sky-50);
}

.course-applied__name {
    color: var(--ink);
    font-family: var(--font-head);
    font-size: 1.0625rem;
    font-weight: 700;
}

.course-applied__duration {
    margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
    .public-site .course-pick {
        transition: none;
    }

    .public-site .course-pick:hover {
        transform: none;
    }
}

/* ---------------------------------------------------------------- print: the confirmation receipt only */

@media print {
    .form-panel__head,
    .d-print-none {
        display: none !important;
    }

    .receipt,
    .form-section {
        border: 1px solid #000;
        box-shadow: none;
    }

    .receipt-row {
        border-color: #000;
        background: none;
    }
}
