/**
 * Ccambassador Registration Wizard Layout Styling
 */

/* 2-Column Page Layout Grid (70% content, 30% sidebar) */
.reg-page-layout {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 3.2rem;
    padding-bottom: 2rem;
    /* space for sticky footer */
    align-items: start;

    &[data-current-step="preferences"] .reg-sidebar {
        display: none;
    }
}

@media(min-width: 800px) {
    .reg-page-layout {
        grid-template-columns: 7fr 3fr;
    }
}


/* sidebar step tracker styling */
.reg-sidebar {
    padding: 1.6rem;
    margin-inline-start: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;

    & .timeline-steps {
        display: flex;
        flex-direction: column;
        gap: 4.8rem;
        list-style: none;
        margin: 0;
        padding: 0;
        counter-reset: step-num;

        & .timeline-step {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            counter-increment: step-num;

            & .step-header {
                margin-bottom: 1.6rem;
                display: flex;
                align-items: flex-start;
                gap: 3rem;
                position: relative;

                & .step-label::before {
                    content: counter(step-num);
                    margin-inline-end: 1rem;

                }

                /* vertical line after main step dot */
                &::after {
                    content: "";
                    position: absolute;
                    left: 5px;
                    /* Centered on a 12px dot */
                    top: 1.4rem;
                    /* Starts at the center of the current dot (0.8rem margin + 0.6rem radius) */
                    bottom: -3.8rem;
                    /* Extends to the center of the next dot */
                    width: 2px;
                    background-color: #66C1BF;
                    z-index: 1;
                }
            }

            /* For main steps that connect directly to the next main step */
            &:not([data-step-group="eligibility"]) .step-header::after {
                bottom: -7.8rem;
            }

            /* Hide the line on the very last main step */
            &:last-child .step-header::after {
                display: none;
            }
        }
    }

    & .timeline-substeps {
        display: flex;
        flex-direction: column;
        gap: 2.4rem;
        list-style: none;
        margin: 0;
        padding: 0;
        counter-reset: substep-num;

        & .timeline-substep {
            display: flex;
            align-items: flex-start;
            gap: 4.4rem;
            position: relative;
            counter-increment: substep-num;

            & .substep-label::before {
                content: counter(step-num)"." counter(substep-num);
                margin-inline-end: 1rem;
            }

            &::after {
                content: "";
                position: absolute;
                left: 5px;
                /* Centered on a 12px dot */
                top: 1.4rem;
                /* Starts at the center of the current dot (0.8rem margin + 0.6rem radius) */
                bottom: -3.8rem;
                /* Extends to the center of the next dot */
                width: 2px;
                background-color: #66C1BF;
                z-index: 1;
            }

            &:last-child::after {
                bottom: -6.2rem;
            }

            &:has(+ .timeline-substep.skipped)::after {
                bottom: -6.2rem;
            }
        }
    }

    /* Hide skipped steps and substeps */
    & .timeline-step.skipped,
    & .timeline-substep.skipped {
        display: none !important;
    }

    & .step-dot,
    & .substep-dot {
        display: inline-block;
        width: 1.2rem;
        height: 1.2rem;
        border-radius: 50%;
        background: #66C1BF;
        z-index: 2;
        transition: all 0.3s ease;
        margin-top: 0.8rem;
        flex-grow: 0;
        flex-shrink: 0;
    }

    /* Completed State */
    & .timeline-step.completed {
        & .step-label {
            color: var(--color-primary);
        }

        & .step-dot {
            background-color: var(--color-primary);
        }

        & .step-header::after {
            background-color: var(--color-primary);
        }
    }

    & .timeline-substep.completed {
        & .substep-label {
            color: var(--color-primary);
        }

        & .substep-dot {
            background-color: var(--color-primary);
        }

        &::after {
            background-color: var(--color-primary);
        }
    }

    /* Active State */
    & .timeline-step.active {
        & .step-label {
            font-weight: 700;
        }

        & .step-dot {
            background-color: var(--color-primary);
            box-shadow:
                0 0 0 0.2rem #ffffff,
                0 0 0 0.4rem #389A7D,
                0 0 0 0.6rem #75B5A2,
                0 0 0 0.7rem #C5DBD4;
        }
    }

    & .timeline-substep.active {
        & .substep-label {
            font-weight: 700;
        }

        & .substep-dot {
            background-color: var(--color-primary);
            box-shadow:
                0 0 0 0.2rem #ffffff,
                0 0 0 0.4rem #389A7D,
                0 0 0 0.6rem #75B5A2,
                0 0 0 0.7rem #C5DBD4;
        }
    }
}

/* Multi-step Panel Visibility */
.reg-step-panel {
    display: none;

    &.active {
        display: block;
    }

    & .form-label {
        font-size: 1.4rem;
        font-weight: 400;
        line-height: 2.4rem;
        color: #49454F;
        margin: 0;
    }

    & .form-control,
    & textarea {
        background-color: transparent;
        padding: 1.2rem 2rem;
        border-radius: 4px;
        border: 1px solid #C8C8C8;
        border-radius: 4px;
        border: 1px solid #C8C8C8;
        background-color: transparent;
        color: var(--text-color-black-100);
        font-family: var(--font-secondary);
        font-size: 1.6rem;
        font-style: normal;
        font-weight: 400;
        line-height: 150%;
        width: 100%;

        &::placeholder {
            color: var(--text-color-black-40);
        }

        &:focus {
            outline: none;
            border-color: var(--color-primary);
        }
    }

    & textarea {

        min-height: 12rem;
        padding: 1.2rem;
        box-sizing: border-box;

    }

    & input[type="checkbox"],
    & .form-checkbox input[type="checkbox"] {
        margin-top: 0.3rem;
        margin-inline-start: 0.3rem;
        width: 2rem;
        height: 2rem;
        flex-shrink: 0;
        border: 2px solid var(--text-color-black-80);
        border-radius: var(--border-radius-xs);
        background-color: transparent;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        outline: none;
        transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    }

    & input[type="checkbox"]:focus-visible,
    & .form-checkbox input[type="checkbox"]:focus-visible {
        border-color: var(--color-primary);
    }

    & .form-checkbox input[type="checkbox"] {
        margin-top: 0;
        margin-inline-start: 0;
    }

    & input[type="checkbox"]:checked,
    &.form-checkbox input[type="checkbox"]:checked {
        background-color: var(--color-primary);
        border-color: var(--color-primary);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
    }


    /* Custom Checkboxes in Step 3 */
    .form-checkbox {
        display: flex;
        align-items: center;
        gap: 1.2rem;
        margin-bottom: 1.6rem;
        cursor: pointer;
    }

    .form-checkbox label {
        font-size: 1.6rem;
        font-family: var(--font-secondary);
        color: var(--text-color-black-100);
        cursor: pointer;
        line-height: 150%;
    }
}


/* Preferences List */

.reg-intro-text {
    margin-bottom: 3.2rem;
}

.newsletter-intro-text {
    margin-bottom: 2.4rem;
    font-weight: 600;
}

.reg-preferences-list {
    list-style: none;
    padding: 0;
    margin-block-end: 4rem;
    display: flex;
    flex-direction: column;
    gap: 3.2rem;

    & .reg-preference-label {
        display: inline-flex;
        flex-direction: row;
        gap: 1.2rem;
        align-items: flex-start;
        cursor: pointer;


        & .reg-preference-content {
            display: flex;
            flex-direction: column;
        }

        & .reg-pref-title {
            font-weight: 600;
            color: var(--text-color-black-80);
            line-height: 162%;
        }

        & .reg-pref-desc {
            line-height: 162%;
        }
    }
}



h3.reg-step-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1.8rem;
    line-height: 150%;
    color: var(--text-color-black-100);
    margin-bottom: 2.4rem;
}

.reg-mint-banner {
    margin-bottom: 0.8rem;
    padding-block: 1rem;
    border-radius: var(--border-radius-xs);
    background: linear-gradient(91deg, #F9F9F9 5.96%, #74EAC7 103.55%);
    color: var(--color-primary);
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 1.8rem;
    line-height: 150%;
}

.reg-step-desc {
    color: var(--text-color-black-100);
    line-height: 162%;

    a {
        color: var(--color-primary);
        text-decoration: underline;
        text-underline-offset: 0.3rem;
    }

    &.warning-text {
        margin-block: 2.4rem;
        color: #F0641E;
        font-size: 1.4rem;
        font-weight: 600;
    }

}

.eligibility-option-wrapper {
    margin-bottom: 3.2rem;

    & .option-header-item {
        margin-bottom: 1.6rem;
    }

    & .option-label {
        color: var(--text-color-black-80);
        font-family: var(--font-secondary);
        font-size: 1.6rem;
        font-weight: 600;
        line-height: 162%;
    }
}

/* Criteria List & Items */
.option-content-list {
    list-style-position: inside;
    padding-left: 0;
    margin: 1.6rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
}

.criterion-item {
    color: var(--text-color-black-100);
    font-family: var(--font-secondary);

    &::marker {
        color: var(--text-color-black-100);
    }

    & .criterion-title {
        display: inline;
        font-weight: 400;
        font-size: 1.6rem;
        line-height: 162%;
    }

    & .criterion-form {
        margin-top: 2.4rem;
        display: none;
    }
}

/* File Upload Group */
.select-file-input {
    display: none !important;
}

.file-upload-trigger-row {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    margin: 1.6rem;
}

.file-upload-trigger-row .btn-select-file {
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 150%;
}

.file-upload-limits-description {
    color: var(--text-color-black-100);
    line-height: 162%;
}

.file-upload-list {
    margin-top: 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.file-upload-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.6rem;
    background-color: var(--color-bg-sidebar);
    border-radius: var(--border-radius-xs);
    border: 1px solid #E5E5E5;
}

.file-upload-item-name {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: var(--font-secondary);
    font-size: 1.6rem;
    color: var(--text-color-black-100);

    & svg {
        flex-shrink: 0;
        color: var(--color-primary);
    }
}

.file-upload-item-remove {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-color-black-40);
    cursor: pointer;
    padding: 0 0.4rem;
    transition: color 0.2s ease;

    &:hover {
        color: #E02424;
    }
}

/* Stakeholder Forum */
.stakeholder-form-container {
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
    margin-top: 2.4rem;
}


.form-helper-text {
    margin-top: 0.8rem;
    padding-inline: 1.6rem;
    font-size: 1.2rem;
    color: #49454F;
}

/* Footer Styling */
.registration-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    height: 9.6rem;
    background-color: var(--dark-grey);
    padding: 0;
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);

    & .layout-track {
        height: 100%;
        align-items: center;
    }

    & .layout-track__sidebar {
        background-color: transparent;
        visibility: hidden;

        &::before {
            display: none;
        }
    }

    & .layout-track__content {
        padding-top: 0;
        padding-bottom: 0;
        height: 100%;
        justify-content: center;
    }

    & .reg-page-layout {
        margin-top: 0;
        padding-bottom: 0;
        align-items: center;
        width: 100%;
    }

    & .reg-footer-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    & .reg-footer-right {
        margin-left: auto;
    }

    & .reg-btn-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        width: 16rem;
        padding: 0.8rem 2.4rem;
        background-color: transparent;
        border-radius: var(--border-radius-lg);
        border: 1.5px solid var(--text-color-white);
        cursor: pointer;
        color: var(--text-color-white);
        font-family: var(--font-primary);
        font-weight: 500;
        font-size: 1.6rem;
        line-height: 150%;
        transition: background-color 0.25s ease, color 0.25s ease;
        outline: none;

        & svg path {
            fill: var(--text-color-white);
            transition: fill 0.25s ease;
        }

        &:hover {
            background-color: var(--text-color-white);
            color: var(--dark-grey);

            & svg path {
                fill: var(--dark-grey);
            }
        }

        &:focus-visible {
            outline: 2px solid var(--color-primary);
            outline-offset: 3px;
        }
    }

    & .reg-btn-submit {
        background-color: var(--color-accent);
        border-color: var(--color-accent);
        width: auto;
        min-width: 28rem;
        padding-inline: 3.2rem;

        &:hover {
            background-color: var(--color-accent-light);
            border-color: var(--color-accent-light);
            color: var(--text-color-white);
        }
    }

    & .reg-btn-nav:disabled,
    & .reg-btn-nav.is-loading {
        opacity: 0.65;
        cursor: wait !important;
        pointer-events: none !important;
    }
}

/* Submitting state: Global wait cursor */
body.is-submitting,
body.is-submitting * {
    cursor: wait !important;
}

/* Loading Spinner Overlay */
.reg-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: wait;
}

.reg-loading-overlay .reg-spinner {
    width: 4.8rem;
    height: 4.8rem;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: reg-spinner-spin 0.8s linear infinite;
}

@keyframes reg-spinner-spin {
    to {
        transform: rotate(360deg);
    }
}


/* Feedback Messages */
.obs-form-feedback {
    margin-top: 2rem;
    padding: 1.6rem 2.4rem;
    border-radius: var(--border-radius-sm);
    font-size: 1.5rem;
    font-family: var(--font-secondary);
    line-height: 150%;
    font-weight: 500;
}

.obs-form-feedback.success {
    background-color: var(--color-primary-very-light);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-primary);
}

.obs-form-feedback.error {
    background-color: #fdf2f2;
    color: #9b1c1c;
    border: 1px solid #f8b4b4;
}

/* Global Form Control Focus Override */
.reg-step-panel .form-control:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
}

/* Word Counter Component */
.word-counter {
    text-align: right;
    font-size: 1.3rem;
    font-family: var(--font-secondary);
    color: var(--text-color-black-40);
    margin-top: 0.6rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.word-counter.limit-reached {
    color: #E02424;
    font-weight: 600;
}

/* Form Grid & Column Layouts */
.form-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.4rem;
    width: 100%;

    &.form-contact-details {
        gap: 3.2rem;
    }
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.reg-form-col-50 {
    flex-shrink: 1;
    width: clamp(250px, 100%, 312px);
    box-sizing: border-box;
}


.form-col-100 {
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
}


/* 
@media (max-width: 600px) {
    .reg-form-col-50 {
        flex: 0 0 100%;
        width: 100%;
    }
} */

/* Step 3 Layout and Element Adjustments */
.form-col-50-wrapper {
    max-width: 50%;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .form-col-50-wrapper {
        max-width: 100%;
    }
}

/* Question Titles */
.question-label {
    display: block;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-color-black-80);
    margin-top: 4rem;
    margin-bottom: 1.6rem;

    & em {
        font-style: italic;
        font-weight: 400;
        margin-left: 0.4rem;
    }
}

/* Control Sublabel */
.control-sublabel {
    display: block;
    font-size: 1.4rem;
    color: #49454F;
    margin-bottom: 0;
    font-family: var(--font-secondary);
    font-weight: 400;
}

/* Custom Dropdown Styling */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2349454F' 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 1.6rem center;
    background-size: 1.6rem;
    padding-right: 4rem;
    cursor: pointer;
}

/* Custom Radios in Step 3 */
.form-radio-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.6rem;
    cursor: pointer;
}

.form-radio-item input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--text-color-black-80);
    border-radius: 50%;
    outline: none;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    background-color: transparent;
    flex-shrink: 0;
}

.form-radio-item input[type="radio"]:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(116, 234, 199, 0.4);
}

.form-radio-item input[type="radio"]:checked {
    border-color: var(--color-primary);
}

.form-radio-item input[type="radio"]:checked::before {
    content: "";
    width: 1rem;
    height: 1rem;
    background-color: var(--color-primary);
    border-radius: 50%;
    display: block;
}

.form-radio-item label {
    font-size: 1.6rem;
    font-family: var(--font-secondary);
    color: var(--text-color-black-100);
    cursor: pointer;
    line-height: 150%;
}

/* Footnote Styling */
.obs-form-note {
    font-size: 1.4rem;
    color: var(--text-color-black-80);
    margin-top: 3.2rem;
    line-height: 162%;
    font-family: var(--font-secondary);
}

/* Registration Success Screen Styling */
.reg-success-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
}

.reg-success-icon-wrapper {
    width: 18rem;
    height: 18rem;
    border-radius: 50% !important;
    border: 2px solid #66C1BF;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    margin-inline: 3.4rem;
    overflow: hidden !important;
}

.reg-success-icon {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block;
}

.reg-success-title {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 150%;
    color: var(--text-color-black-100);
    margin-top: 2.4rem;
    margin-bottom: 1.6rem;
}

.reg-success-text {
    font-family: var(--font-secondary);
    font-size: 1.6rem;
    line-height: 162%;
    color: var(--text-color-black-80);
    margin: 0;
}

/* Mobile View (<800px): Wizard on top of form, horizontal timeline without labels */
@media (max-width: 800px) {
    .reg-page-layout {
        display: flex;
        flex-direction: column;
    }

    .reg-sidebar {
        order: -1;
        width: 100%;
        height: auto;
        padding: 0 0 2.4rem 0;
        margin-inline-start: 0;
        align-items: center;
        justify-content: center;
    }

    .reg-wizard-sidebar {
        width: 100%;
        max-width: 380px;
        margin: 0 auto;
        padding: 0 1.6rem;
    }

    /* Hide all text labels and step counter prefixes */
    .reg-sidebar .step-label,
    .reg-sidebar .substep-label {
        display: none !important;
    }

    /* Hide step header dot in eligibility group so only active step/substep dots are rendered */
    .reg-sidebar .timeline-step[data-step-group="eligibility"]>.step-header {
        display: none !important;
    }

    /* Hide vertical connecting line pseudo-elements */
    .reg-sidebar .timeline-steps .timeline-step .step-header::after,
    .reg-sidebar .timeline-substeps .timeline-substep::after {
        display: none !important;
    }

    /* Horizontal layout container for timeline dots */
    .reg-sidebar .timeline-steps {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        position: relative !important;
        margin: 0 !important;
        padding: 1.2rem 0 !important;
        width: 100% !important;
        gap: 0 !important;
    }

    /* Horizontal connecting line passing behind dots */
    .reg-sidebar .timeline-steps::before {
        content: "" !important;
        position: absolute !important;
        top: 50% !important;
        left: 0.6rem !important;
        right: 0.6rem !important;
        height: 2px !important;
        background-color: #66C1BF !important;
        transform: translateY(-50%) !important;
        z-index: 1 !important;
    }

    /* Unwrap step & substep containers so dots become direct flex items */
    .reg-sidebar .timeline-step,
    .reg-sidebar .timeline-substeps {
        display: contents !important;
    }

    /* Dot wrappers positioning */
    .reg-sidebar .timeline-substep,
    .reg-sidebar .timeline-step:not([data-step-group="eligibility"]) .step-header {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        z-index: 2 !important;
        margin: 0 !important;
        padding: 0.4rem !important;
        cursor: pointer;
    }

    .reg-sidebar .step-dot,
    .reg-sidebar .substep-dot {
        margin-top: 0 !important;
        position: relative !important;
        z-index: 2 !important;
    }
}