/* Production-only behavior states layered onto the frozen prototype design. */

:root {
    --font-family: "Century Gothic", "Avenir Next", Avenir, Futura, "Trebuchet MS", Arial, sans-serif;
}

[hidden] {
    display: none !important;
}

/* The landing page mirrors the approved two-stage financing composition. */
body[data-page="landing"] {
    background: #fff;
}

body[data-page="landing"] .page-shell {
    padding-top: 0;
}

body[data-page="landing"] .journey-progress {
    max-width: 790px;
    margin: 0 auto 14px;
    padding: 22px 0 12px;
}

body[data-page="landing"] .journey-progress__step {
    min-width: 0;
    white-space: nowrap;
}

.journey-progress__number svg,
.financing-stage svg,
.readiness-strip svg {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.journey-progress__number--locked {
    border-color: #cbd4dc;
    background: #fff;
    color: #7e8b98;
}

.journey-progress__number--locked svg {
    width: 22px;
    height: 22px;
}

.journey-progress__step-number {
    margin-right: 8px;
    font-size: 1.15rem;
}

body[data-page="landing"] .financing-landing__intro {
    margin-bottom: 24px;
}

body[data-page="landing"] .financing-landing__intro p {
    max-width: 820px;
    color: var(--text-dark);
    line-height: 1.55;
}

body[data-page="landing"] .financing-stage-grid {
    gap: 34px;
    max-width: 1350px;
}

body[data-page="landing"] .financing-stage {
    min-height: 380px;
    grid-template-rows: auto 1fr auto;
    gap: 14px;
    padding: 22px 34px 24px;
    border-top-width: 3px;
}

body[data-page="landing"] .financing-stage__heading {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 20px;
}

body[data-page="landing"] .financing-stage__heading p {
    margin: 9px 0 0;
    color: var(--text-dark);
    line-height: 1.5;
}

body[data-page="landing"] .financing-stage__icon {
    width: 80px;
    height: 80px;
    font-size: 43px;
}

body[data-page="landing"] .financing-stage__icon--locked {
    background: #eef6fb;
    color: #1261aa;
}

body[data-page="landing"] .financing-stage__features {
    gap: 7px;
    padding-left: 120px;
    color: var(--text-dark);
    list-style: none;
}

body[data-page="landing"] .financing-stage__features li {
    position: relative;
    min-height: 22px;
    padding-left: 28px;
}

body[data-page="landing"] .financing-stage__features li::before {
    content: "✓";
    position: absolute;
    top: 1px;
    left: 0;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1.5px solid var(--secondary-teal);
    border-radius: 50%;
    color: #149a98;
    font-size: 11px;
    font-weight: 700;
}

body[data-page="landing"] .financing-stage--locked .financing-stage__features li::before {
    border-color: #95a3b0;
    color: #73818e;
}

body[data-page="landing"] .financing-stage .button {
    width: calc(100% - 120px);
    margin-left: 120px;
}

body[data-page="landing"] .financing-stage .button--teal {
    border-color: #159f9b;
    background: #18aaa7;
    color: #fff;
}

body[data-page="landing"] .financing-stage .button--disabled {
    gap: 10px;
    padding-inline: 14px;
    font-size: 0.82rem;
}

body[data-page="landing"] .financing-stage .button--disabled svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

body[data-page="landing"] .readiness-strip {
    position: relative;
    max-width: 1350px;
    padding-top: 38px;
}

body[data-page="landing"] .readiness-strip > h2 {
    position: absolute;
    top: 10px;
    left: 28px;
    margin: 0;
    color: var(--primary-blue);
    font-size: 1rem;
}

body[data-page="landing"] .readiness-strip__item {
    min-height: 112px;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    align-content: center;
    gap: 18px;
    padding: 18px 28px;
}

body[data-page="landing"] .readiness-strip__item > div {
    display: grid;
    gap: 5px;
}

.readiness-strip__icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--teal-050);
    color: #149a98;
    font-size: 34px;
}

.qualification-block,
.form-section {
    scroll-margin-top: 176px;
}

.qualification-block__header > div {
    min-width: 0;
}

.qualification-block__header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: var(--type-helper);
}

.choice,
.radio-option.choice {
    width: 100%;
    min-height: 52px;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: 7px;
    background: #fff;
    color: var(--primary-blue);
    cursor: pointer;
    font: inherit;
    line-height: 1.25;
    text-align: center;
}

.qualification-block .choice-set {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
}

.qualification-block .radio-set {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.choice.selected,
.choice[aria-pressed="true"] {
    border-color: var(--secondary-teal);
    background: var(--teal-050);
    color: var(--text-dark);
}

.country-select {
    position: relative;
    min-width: 0;
}

.search-select-trigger {
    width: 100%;
    min-height: var(--input-height);
    padding: 0 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-dark);
    text-align: left;
}

.search-select-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: none;
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-float);
}

.country-select.open .search-select-menu {
    display: block;
}

.search-select-search {
    width: 100%;
    margin-bottom: 6px;
}

.search-select-options {
    max-height: 220px;
    overflow-y: auto;
}

.search-select-option {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-dark);
    text-align: left;
}

.search-select-option:hover,
.search-select-option.selected {
    background: var(--teal-050);
}

.phone-control {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 8px;
}

.phone-control > * {
    min-width: 0;
}

.application-section-select {
    display: none;
    width: 100%;
    min-height: var(--input-height);
    margin-bottom: var(--space-4);
}

#applicationQuestions {
    display: contents;
}

.application-group {
    display: block;
    align-content: start;
}

.standard-section__fields > .application-group {
    grid-column: 1 / -1;
}

.application-group > h4 {
    grid-column: 1 / -1;
    margin: 0 0 4px;
    color: var(--primary-blue);
}

.application-group > .compact-fields {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.buyer-section {
    display: block;
}

.buyer-list {
    display: grid;
    gap: var(--space-4);
}

.buyer-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: #fff;
}

.buyer-card-head,
.buyer-card__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.buyer-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
    gap: var(--space-5);
}

.application-helper {
    margin-top: 0;
    color: var(--text-muted);
}

.add-buyer-btn,
.remove-buyer-btn,
.remove-ubo-btn {
    min-height: var(--button-height);
    padding: 0 16px;
    border: 1px solid var(--primary-blue);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--primary-blue);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.ubo-group {
    grid-column: 1 / -1;
}

.ubo-list {
    display: grid;
    gap: 16px;
    margin: 10px 0 14px;
}

.ubo-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid #cbdde9;
    border-radius: var(--radius-sm);
    background: #f8fbfd;
}

.ubo-card .document-upload-card {
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #fff;
}

.ubo-pep-details {
    grid-column: 1 / -1;
}

.document-upload-card {
    display: grid;
    gap: 7px;
    padding: 12px 0;
    border-top: 1px solid var(--border-light);
}

.upload-box,
.inline-upload {
    display: grid;
    place-items: center;
    min-height: 88px;
    padding: 12px;
    border: 1px dashed var(--secondary-teal);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--primary-blue);
    cursor: pointer;
    text-align: center;
}

.upload-zone {
    cursor: pointer;
}

.upload-panel input[type="file"],
.document-upload-card input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.upload-file-list,
.file-list {
    display: grid;
    gap: 12px;
}

.upload-file-list .file-row {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    padding: 14px;
    border: 1px solid #cbdde9;
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 0.82rem;
}

.upload-file-list .file-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.upload-file-list .file-name {
    min-width: 0;
    color: var(--text-dark);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.upload-file-list .remove-file {
    min-width: 80px;
    min-height: 38px;
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 1px solid #c8d6e0;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--primary-blue);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.upload-file-list .upload-state {
    display: block;
    color: var(--text-muted);
    font-size: var(--type-helper);
    line-height: 1.35;
}

.upload-file-list .upload-progress {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7edf2;
}

.upload-file-list .upload-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--secondary-teal);
}

.file-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #fff;
}

.file-item strong,
.file-item span {
    overflow-wrap: anywhere;
}

.file-remove,
.file-retry,
.file-cancel {
    min-width: 44px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--primary-blue);
    cursor: pointer;
}

.notification-region {
    position: fixed;
    z-index: 100;
    top: 16px;
    right: 22px;
    display: grid;
    width: min(360px, calc(100vw - 32px));
    gap: 8px;
}

.alert {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-float);
}

.alert.error {
    border-color: var(--danger);
    color: var(--danger);
}

.alert.success {
    border-color: var(--success);
    color: var(--success);
}

.alert-dismiss {
    min-width: 44px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    font-size: 22px;
}

.validation-invalid {
    border-color: var(--danger) !important;
    outline: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
}

.field-error {
    display: block;
    margin-top: 6px;
    color: var(--danger);
    font-size: var(--type-helper);
}

.application-actions {
    position: sticky;
    z-index: 20;
    bottom: 0;
}

.qualification-action-note {
    margin-right: auto;
    color: var(--text-muted);
    font-size: var(--type-helper);
}

.submission-result .decision-result__body {
    max-width: 920px;
}

.submission-summary {
    max-width: 820px;
}

.submission-next-steps {
    display: grid;
    gap: 6px;
    max-width: 820px;
    margin: 0 auto;
    text-align: left;
}

.submission-next-steps strong {
    color: var(--primary-blue);
}

.submission-next-steps span {
    color: var(--text-muted);
}

.support-notification-region {
    z-index: 120;
}

.support-copy-alert {
    align-items: center;
    color: var(--text-dark);
}

.support-copy-alert__mark {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e7f8f2;
    color: var(--success);
    font-weight: 700;
}

@media (max-width: 1024px) {
    .application-tabs {
        display: none;
    }

    .application-section-select {
        position: sticky;
        z-index: 25;
        top: 8px;
        display: block;
    }

    .buyer-workspace {
        grid-template-columns: 1fr;
    }

    .application-group > .compact-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body[data-page="landing"] .journey-progress__step {
        white-space: normal;
    }

    body[data-page="landing"] .financing-stage__heading {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 14px;
    }

    body[data-page="landing"] .financing-stage__icon {
        width: 64px;
        height: 64px;
        font-size: 34px;
    }

    body[data-page="landing"] .financing-stage__features {
        padding-left: 0;
    }

    body[data-page="landing"] .financing-stage .button {
        width: 100%;
        margin-left: 0;
    }

    body[data-page="landing"] .readiness-strip {
        padding-top: 42px;
    }

    body[data-page="landing"] .readiness-strip__item {
        grid-template-columns: 56px minmax(0, 1fr);
        padding: 16px 18px;
    }

    .readiness-strip__icon {
        width: 52px;
        height: 52px;
        font-size: 28px;
    }

    .phone-control {
        grid-template-columns: 1fr;
    }

    .application-group > .compact-fields {
        grid-template-columns: 1fr;
    }

    .qualification-block,
    .form-section {
        scroll-margin-top: 96px;
    }

    .notification-region {
        right: 12px;
        left: 12px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
