/* ============================================================
   SWIFT MED / SWIFT URGENT CARE
   Patient Registration Portal

   Primary palette:
   Medical Blue : #0B5CAD
   Deep Blue    : #073B73
   Light Blue   : #EAF4FF
   Accent Red   : #D92D20
   Soft Red     : #FFF1F0
   Background   : #F4F7FB
   Text         : #1D2939
   ============================================================ */


/* ============================================================
   RESET / BASE
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background:
        linear-gradient(
            180deg,
            #eef5fc 0%,
            #f7f9fc 45%,
            #ffffff 100%
        );

    color: #1d2939;

    line-height: 1.6;

    min-height: 100vh;
}


/* ============================================================
   LINKS
   ============================================================ */

a {
    color: #0b5cad;
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}


/* ============================================================
   HEADER
   ============================================================ */

header {
    width: 100%;
}

.hero-bar {
    background:
        linear-gradient(
            135deg,
            #073b73 0%,
            #0b5cad 60%,
            #1473c9 100%
        );

    color: #ffffff;

    padding: 28px 36px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;

    position: relative;
    overflow: hidden;

    box-shadow:
        0 6px 20px rgba(7, 59, 115, 0.18);
}


/*
   Subtle medical visual effect.
*/
.hero-bar::before {
    content: "";

    position: absolute;

    width: 320px;
    height: 320px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.06);

    top: -180px;
    right: -80px;
}

.hero-bar::after {
    content: "";

    position: absolute;

    width: 190px;
    height: 190px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.04);

    bottom: -110px;
    left: 10%;
}


.hero-bar img {
    width: 88px;
    height: 88px;

    object-fit: contain;

    background: #ffffff;

    border-radius: 18px;

    padding: 9px;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.16);

    position: relative;
    z-index: 1;
}


.hero-bar > div {
    position: relative;
    z-index: 1;
}


.hero-bar h1 {
    margin: 0 0 5px;

    font-size: clamp(
        1.65rem,
        4vw,
        2.35rem
    );

    font-weight: 700;

    letter-spacing: -0.03em;
}


.hero-bar p {
    margin: 0;

    font-size: 1rem;

    color: rgba(255, 255, 255, 0.88);

    font-weight: 400;
}


/* ============================================================
   MAIN PAGE
   ============================================================ */

main {
    width: 100%;

    padding: 44px 20px 70px;
}


/* ============================================================
   FORM CARD
   ============================================================ */

.form-card {
    width: 100%;
    max-width: 850px;

    margin: 0 auto;

    background: #ffffff;

    border-radius: 18px;

    padding: 40px;

    border:
        1px solid
        rgba(11, 92, 173, 0.09);

    box-shadow:
        0 16px 45px
        rgba(15, 45, 78, 0.10);
}


.form-card > h2 {
    margin: 0 0 28px;

    color: #073b73;

    font-size: 1.65rem;

    line-height: 1.25;

    padding-bottom: 16px;

    border-bottom:
        3px solid #d92d20;
}


/* ============================================================
   SECTION HEADINGS
   ============================================================ */

.form-card h3 {
    margin:
        34px
        0
        18px;

    color: #073b73;

    font-size: 1.15rem;

    font-weight: 700;

    position: relative;

    padding-left: 14px;
}


.form-card h3::before {
    content: "";

    position: absolute;

    left: 0;
    top: 4px;

    width: 4px;
    height: 22px;

    background: #d92d20;

    border-radius: 10px;
}


/* ============================================================
   CONSENT SECTION
   ============================================================ */

.consent-section {
    margin-bottom: 32px;

    padding: 24px;

    background:
        linear-gradient(
            135deg,
            #f2f8ff 0%,
            #eaf4ff 100%
        );

    border:
        1px solid #cfe4fa;

    border-left:
        5px solid #0b5cad;

    border-radius: 12px;
}


.consent-section h3 {
    margin-top: 0;
}


.consent-section p {
    margin:
        0
        0
        20px;

    color: #344054;

    font-size: 0.95rem;
}


.consent-checkbox {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    cursor: pointer;

    padding: 15px;

    background: #ffffff;

    border-radius: 10px;

    border:
        1px solid #bcd8f3;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


.consent-checkbox:hover {
    border-color: #0b5cad;

    box-shadow:
        0 4px 14px
        rgba(11, 92, 173, 0.08);
}


.consent-checkbox input {
    width: 20px;
    height: 20px;

    margin-top: 2px;

    accent-color: #0b5cad;

    flex-shrink: 0;
}


.consent-checkbox span {
    font-size: 0.95rem;

    color: #344054;
}


.consent-checkbox strong {
    color: #073b73;
}


/* ============================================================
   NOTICE
   ============================================================ */

.notice {
    margin-bottom: 26px;

    padding: 13px 16px;

    border-radius: 8px;

    background: #fff8e7;

    color: #7a4d00;

    border:
        1px solid #f5d991;

    font-size: 0.91rem;

    font-weight: 500;
}


/* ============================================================
   LABELS
   ============================================================ */

.form-card label:not(.consent-checkbox) {
    display: block;

    margin:
        19px
        0
        7px;

    font-size: 0.92rem;

    font-weight: 600;

    color: #344054;
}


/* ============================================================
   FORM CONTROLS
   ============================================================ */

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="tel"],
.form-card input[type="date"],
.form-card input[type="number"],
.form-card select,
.form-card textarea {
    width: 100%;

    border:
        1px solid #cfd8e3;

    border-radius: 9px;

    background: #ffffff;

    color: #1d2939;

    padding: 12px 14px;

    min-height: 48px;

    font-family: inherit;

    font-size: 0.96rem;

    outline: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}


.form-card textarea {
    resize: vertical;

    min-height: 90px;
}


.form-card select {
    cursor: pointer;
}


/* ============================================================
   FOCUS
   ============================================================ */

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    border-color: #0b5cad;

    box-shadow:
        0 0 0 4px
        rgba(11, 92, 173, 0.12);

    background: #ffffff;
}


/* ============================================================
   REQUIRED / INVALID
   ============================================================ */

.form-card input:invalid:not(:placeholder-shown),
.form-card textarea:invalid:not(:placeholder-shown) {
    border-color: #d92d20;
}


/* ============================================================
   READONLY FIELDS
   ============================================================ */

.form-card input[readonly],
.readonly-field {
    background: #f2f4f7;

    color: #667085;

    cursor: not-allowed;

    border-color: #d9e0e8;
}


/* ============================================================
   SOURCE OTHER
   ============================================================ */

.form-group {
    width: 100%;
}


#sourceOtherGroup {
    margin-top: 8px;

    padding: 14px 16px 17px;

    border-radius: 10px;

    background: #f8fbff;

    border:
        1px dashed #abccea;
}


#sourceOtherGroup label {
    margin-top: 0;
}


/* ============================================================
   SUBMIT BUTTON
   ============================================================ */

#submitRegistration,
.form-card button[type="submit"] {
    width: 100%;

    margin-top: 35px;

    padding: 14px 20px;

    min-height: 52px;

    border: none;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            #0b5cad 0%,
            #073b73 100%
        );

    color: #ffffff;

    font-family: inherit;

    font-size: 1rem;

    font-weight: 700;

    letter-spacing: 0.01em;

    cursor: pointer;

    box-shadow:
        0 8px 20px
        rgba(11, 92, 173, 0.22);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        opacity 0.18s ease;
}


#submitRegistration:hover:not(:disabled),
.form-card button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-1px);

    box-shadow:
        0 11px 24px
        rgba(11, 92, 173, 0.28);
}


#submitRegistration:active:not(:disabled),
.form-card button[type="submit"]:active:not(:disabled) {
    transform: translateY(0);
}


#submitRegistration:focus-visible,
.form-card button[type="submit"]:focus-visible {
    outline:
        4px solid
        rgba(11, 92, 173, 0.18);

    outline-offset: 3px;
}


#submitRegistration:disabled,
.form-card button[type="submit"]:disabled {
    opacity: 0.62;

    cursor: not-allowed;

    box-shadow: none;
}


/* ============================================================
   SUCCESS MESSAGE
   ============================================================ */

.success-message {
    display: none;

    margin-top: 25px;

    padding: 20px;

    text-align: center;

    border-radius: 12px;

    background: #ecfdf3;

    border:
        1px solid #abefc6;

    color: #067647;

    font-size: 0.97rem;

    font-weight: 600;
}


.ref-code {
    display: inline-block;

    margin-top: 8px;

    padding: 6px 12px;

    border-radius: 7px;

    background: #ffffff;

    border:
        1px solid #98e6b8;

    color: #054f31;

    font-family:
        "Courier New",
        Courier,
        monospace;

    font-size: 1.05rem;

    font-weight: 700;

    letter-spacing: 0.04em;
}


/* ============================================================
   REGISTRATION ERROR MESSAGE
   Created dynamically by form-script.js
   ============================================================ */

#registrationError {
    margin-top: 22px !important;

    padding: 15px 17px !important;

    border-radius: 10px !important;

    background: #fff1f0 !important;

    color: #b42318 !important;

    border:
        1px solid #fecdca !important;

    border-left:
        4px solid #d92d20 !important;

    font-size: 0.94rem;

    font-weight: 600;
}


/* ============================================================
   OPTIONAL MEDICAL RED ACCENT
   ============================================================ */

.form-card strong {
    font-weight: 700;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 768px) {

    .hero-bar {
        padding:
            24px
            18px;

        justify-content: flex-start;
    }


    .hero-bar img {
        width: 72px;
        height: 72px;

        border-radius: 15px;
    }


    .hero-bar h1 {
        font-size: 1.65rem;
    }


    .hero-bar p {
        font-size: 0.9rem;
    }


    main {
        padding:
            28px
            14px
            50px;
    }


    .form-card {
        padding:
            27px
            21px;

        border-radius: 14px;
    }


    .form-card > h2 {
        font-size: 1.4rem;
    }


    .consent-section {
        padding: 19px;
    }

}


/* ============================================================
   SMALL PHONES
   ============================================================ */

@media (max-width: 480px) {

    .hero-bar {
        gap: 14px;

        padding:
            20px
            15px;
    }


    .hero-bar img {
        width: 62px;
        height: 62px;

        padding: 7px;
    }


    .hero-bar h1 {
        font-size: 1.4rem;
    }


    .hero-bar p {
        font-size: 0.82rem;
    }


    main {
        padding:
            20px
            10px
            40px;
    }


    .form-card {
        padding:
            22px
            16px;

        border-radius: 12px;
    }


    .form-card > h2 {
        font-size: 1.27rem;
    }


    .form-card input[type="text"],
    .form-card input[type="email"],
    .form-card input[type="tel"],
    .form-card input[type="date"],
    .form-card input[type="number"],
    .form-card select,
    .form-card textarea {
        font-size: 16px;

        /*
           16px also avoids unwanted input zoom
           on many mobile browsers.
        */
    }


    .consent-checkbox {
        padding: 13px;
    }

}


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration:
            0.01ms !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;
    }
}


/* ============================================================
   PRINT
   ============================================================ */

@media print {

    body {
        background: #ffffff;
    }


    .hero-bar {
        background: #ffffff;

        color: #073b73;

        box-shadow: none;

        border-bottom:
            2px solid #0b5cad;
    }


    .hero-bar p {
        color: #344054;
    }


    .form-card {
        box-shadow: none;

        border:
            1px solid #cccccc;
    }


    #submitRegistration,
    .form-card button[type="submit"] {
        display: none;
    }

}

/* ============================================================
   PREMIUM FORM STRUCTURE
   ============================================================ */

.form-card {
    max-width: 960px;
}


/* ============================================================
   FORM INTRODUCTION
   ============================================================ */

.form-intro {
    margin-bottom: 28px;
}

.form-eyebrow {
    display: inline-block;

    margin-bottom: 8px;

    color: #d92d20;

    font-size: 0.78rem;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.09em;
}

.form-intro h2 {
    margin: 0;

    color: #073b73;

    font-size: clamp(1.55rem, 3vw, 2rem);

    line-height: 1.25;
}

.form-intro p {
    max-width: 680px;

    margin: 10px 0 0;

    color: #667085;

    font-size: 0.95rem;
}


/* Override previous direct h2 border */
.form-card > h2 {
    border-bottom: none;
}


/* ============================================================
   BRAND
   ============================================================ */

.brand-name {
    display: inline-block;

    margin-bottom: 3px;

    font-size: 0.77rem;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.13em;

    color: rgba(255,255,255,0.78);
}

.hero-content h1 {
    margin: 0 0 3px;

    color: #fff;
}

.hero-content p {
    margin: 0;
}


/* ============================================================
   SECTION CARDS
   ============================================================ */

.form-section {
    margin: 0 0 24px;

    padding: 28px;

    background: #ffffff;

    border: 1px solid #e3ebf4;

    border-radius: 14px;

    box-shadow:
        0 5px 18px
        rgba(15, 45, 78, 0.045);

    position: relative;
}

.form-section::after {
    content: "";

    position: absolute;

    top: 0;
    left: 30px;
    right: 30px;

    height: 3px;

    border-radius: 0 0 4px 4px;

    background:
        linear-gradient(
            90deg,
            #0b5cad,
            #1473c9,
            transparent
        );

    opacity: 0.75;
}


/* Consent gets a slightly different treatment */
.consent-card {
    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #f8fbff 100%
        );
}


/* ============================================================
   SECTION HEADINGS
   ============================================================ */

.section-heading {
    display: flex;

    align-items: flex-start;

    gap: 14px;

    margin-bottom: 24px;

    padding-bottom: 16px;

    border-bottom: 1px solid #e8eef5;
}

.section-number {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #0b5cad,
            #073b73
        );

    font-size: 0.83rem;

    font-weight: 800;

    box-shadow:
        0 5px 12px
        rgba(11, 92, 173, 0.16);
}

.section-heading h3 {
    margin: 0;

    padding: 0;

    color: #073b73;

    font-size: 1.12rem;
}

.section-heading h3::before {
    display: none;
}

.section-heading p {
    margin: 3px 0 0;

    color: #667085;

    font-size: 0.87rem;
}


/* ============================================================
   FIELD GRID
   ============================================================ */

.field-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 7px 22px;
}

.field-group {
    min-width: 0;
}

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

.field-group label {
    display: block;
}

.field-hint {
    display: block;

    margin: -3px 0 7px;

    color: #8590a0;

    font-size: 0.78rem;
}


/* ============================================================
   INPUT POLISH
   ============================================================ */

.field-group input,
.field-group select,
.field-group textarea {
    margin-top: 0;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="tel"],
.form-card input[type="date"],
.form-card input[type="number"],
.form-card select,
.form-card textarea {
    border: 1px solid #cbd8e6;

    box-shadow:
        inset 0 1px 2px
        rgba(16, 24, 40, 0.025);
}

.form-card input:hover:not([readonly]),
.form-card select:hover,
.form-card textarea:hover {
    border-color: #99bada;
}


/* ============================================================
   CONSENT CARD REFINEMENT
   ============================================================ */

.consent-card .consent-section {
    margin-bottom: 0;
}

.consent-card::after {
    background:
        linear-gradient(
            90deg,
            #d92d20,
            #ef6156,
            transparent
        );
}


/* ============================================================
   REFERRAL SECTION
   ============================================================ */

.referral-section {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f8fbff
        );
}


/* ============================================================
   SUBMISSION
   ============================================================ */

.submission-section {
    margin-top: 28px;

    padding: 25px;

    border: 1px solid #cfe0f0;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #f3f8fd,
            #edf6ff
        );
}

.submission-note {
    display: flex;

    align-items: flex-start;

    gap: 13px;

    margin-bottom: 20px;
}

.submission-icon {
    width: 35px;
    height: 35px;

    flex: 0 0 35px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #0b5cad;

    color: #ffffff;

    font-weight: 800;
}

.submission-note strong {
    color: #073b73;

    font-size: 0.95rem;
}

.submission-note p {
    margin: 3px 0 0;

    color: #667085;

    font-size: 0.86rem;
}

.submission-section #submitRegistration {
    margin-top: 0;
}


/* ============================================================
   PREMIUM SUCCESS CARD
   ============================================================ */

.success-message {
    padding: 30px 24px;

    margin-top: 25px;

    text-align: center;
}

.success-icon {
    width: 54px;
    height: 54px;

    margin: 0 auto 13px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #067647;

    color: #ffffff;

    font-size: 1.6rem;

    font-weight: 800;

    box-shadow:
        0 8px 20px
        rgba(6, 118, 71, 0.18);
}

.success-message > strong {
    display: block;

    color: #05603a;

    font-size: 1.16rem;
}

.success-message p {
    margin: 6px 0;

    color: #477462;
}

.reference-label {
    margin-top: 17px;

    color: #667085;

    font-size: 0.78rem;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.06em;
}

.reference-help {
    margin-top: 12px !important;

    font-size: 0.82rem;
}


/* ============================================================
   PAGE FOOTER
   ============================================================ */

.page-footer {
    padding: 0 20px 38px;

    text-align: center;

    color: #667085;
}

.page-footer p {
    margin: 0;

    color: #073b73;

    font-size: 0.9rem;

    font-weight: 700;
}

.page-footer span {
    display: block;

    margin-top: 2px;

    font-size: 0.78rem;
}


/* ============================================================
   RESPONSIVE GRID
   ============================================================ */

@media (max-width: 700px) {

    .field-grid {
        grid-template-columns: 1fr;

        gap: 4px;
    }

    .field-group.full-width,
    .full-width {
        grid-column: auto;
    }

    .form-section {
        padding: 22px 18px;
    }

    .section-heading {
        gap: 11px;
    }

    .section-number {
        width: 38px;
        height: 38px;

        flex-basis: 38px;
    }

}


/* ============================================================
   SMALL MOBILE
   ============================================================ */

@media (max-width: 480px) {

    .form-section {
        margin-bottom: 17px;

        padding: 20px 14px;

        border-radius: 11px;
    }

    .section-heading {
        margin-bottom: 18px;
    }

    .section-heading p {
        font-size: 0.8rem;
    }

    .submission-section {
        padding: 20px 15px;
    }

}
