
/* =========================================
   CVXSA APPLICATION PORTAL
   Bright Intelligence | Graphite & Copper
   ========================================= */

.apply-page {
    min-height: 100vh;
    background: var(--background);
}

/* HERO SECTION */

.apply-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 30px auto 0;
    padding: 70px 30px;
    border-radius: 30px;
    text-align: center;
    background: linear-gradient(
        120deg,
        #FFF3DE,
        #F3C6AC,
        #DCE6F8,
        #F8E5D3
    );
    background-size: 300% 300%;
    animation: gradientFlow 16s ease infinite;
}

.apply-waves {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.apply-hero h1 {
    font-size: clamp(40px, 6vw, 76px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.06em;
    margin: 24px auto;
}

.apply-hero p {
    max-width: 650px;
    margin: 0 auto;
    font-size: 17px;
    color: #55585E;
}

/* APPLICATION LAYOUT */

.application-container {
    width: min(900px, calc(100% - 48px));
    margin: 65px auto 80px;
}

.application-heading {
    margin-bottom: 35px;
}

.application-heading h2 {
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.application-heading p {
    font-size: 15px;
    color: var(--muted);
    margin: 12px 0;
}

.required-note {
    font-size: 12px;
    color: var(--muted);
}

/* FORM SECTIONS */

.application-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    padding: 32px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 5px 25px rgba(37,40,43,0.025);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.section-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: #986332;
    background: #F8EBDD;
}

.section-icon svg {
    width: 24px;
    height: 24px;
}

.icon-professional {
    background: #E8EEF8;
    color: #53606D;
}

.icon-documents {
    background: #E7EDE1;
    color: #64765B;
}

.form-section-number {
    display: block;
    color: #986332;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 5px;
}

.form-section-header h3 {
    font-size: 23px;
    font-weight: 700;
}

.form-section-header p {
    font-size: 13px;
    color: var(--muted);
    margin: 5px 0 0;
}

/* FORM GRID */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

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

.field-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 9px;
}

.field-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--graphite);
}

.required {
    color: #B42318;
}

.optional {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

/* INPUTS AND DROPDOWNS */

.apply-input,
.apply-select {
    display: block;
    width: 100%;
    min-height: 54px;
    padding: 15px 17px;
    border: 1px solid #DEDFE0;
    border-radius: 13px;
    background: #FFFFFF;
    color: var(--graphite);
    font-family: var(--body-font);
    font-size: 15px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.apply-input::placeholder {
    color: #85898E;
}

.apply-input:hover,
.apply-select:hover {
    border-color: #BFC1C4;
}

.apply-input:focus,
.apply-select:focus {
    border-color: var(--copper);
    box-shadow: 0 0 0 4px rgba(184,115,51,0.10);
}

.apply-select {
    appearance: none;
    cursor: pointer;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2365666B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.apply-select:disabled {
    background-color: #F5F5F3;
    color: #777777;
    cursor: not-allowed;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
}

/* NUMERIC RATE INPUT */

.currency-wrapper {
    display: flex;
    align-items: center;
    overflow: hidden;
    min-height: 54px;
    border: 1px solid #DEDFE0;
    border-radius: 13px;
    background: #FFFFFF;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.currency-wrapper:focus-within {
    border-color: var(--copper);
    box-shadow: 0 0 0 4px rgba(184,115,51,0.10);
}

.currency-prefix {
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 18px;
    background: #F8F3ED;
    border-right: 1px solid var(--border);
    color: #986332;
    font-weight: 600;
    font-size: 14px;
}

.currency-wrapper input {
    flex: 1;
    width: 0;
    min-width: 0;
    padding: 15px;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--body-font);
    color: var(--graphite);
    font-size: 15px;
}

.currency-wrapper input::placeholder {
    color: #85898E;
}

.currency-suffix {
    padding-right: 15px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

/* DOCUMENT UPLOAD AREAS */

.upload-group {
    margin-bottom: 24px;
}

.upload-group:last-child {
    margin-bottom: 0;
}

.upload-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 180px;
    padding: 30px 20px;
    background: #FCFAF7;
    border: 1.5px dashed #D2BCA6;
    border-radius: 18px;
    text-align: center;
    cursor: pointer;
    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}

.upload-zone:hover,
.upload-zone.drag-active {
    background: #F8F0E6;
    border-color: var(--copper);
}

.upload-zone:focus-within {
    outline: 3px solid rgba(184,115,51,0.45);
    outline-offset: 3px;
}

.upload-zone.has-file {
    background: #F2F7F1;
    border-color: #86A780;
    border-style: solid;
}

.upload-zone.upload-invalid {
    background: #FFF5F4;
    border-color: #B42318;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #F4E7D8;
    color: #986332;
}

.upload-icon svg {
    width: 25px;
    height: 25px;
}

.upload-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--graphite);
}

.upload-description {
    font-size: 13px;
    color: var(--muted);
}

.upload-format {
    font-size: 11px;
    color: var(--muted);
}

.upload-filename {
    display: none;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 600;
    color: #376B39;
}

.upload-zone.has-file .upload-filename {
    display: block;
}

.upload-zone.has-file .upload-description {
    display: none;
}

/* TERMS AND CONDITIONS */

.consent-section {
    padding: 25px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--ivory);
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--graphite);
    cursor: pointer;
}

.consent-label input {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: var(--graphite);
    flex-shrink: 0;
    cursor: pointer;
}

.consent-label a {
    color: #986332;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* SUBMISSION BUTTON */

.application-submit {
    width: 100%;
    min-height: 58px;
    font-size: 15px;
}

.application-submit:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.submission-note {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

.submission-note svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* VALIDATION MESSAGES */

.field-error {
    color: #B42318;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.apply-input[aria-invalid="true"],
.apply-select[aria-invalid="true"],
.currency-wrapper.invalid {
    border-color: #B42318;
}

.application-alert {
    padding: 20px 24px;
    border-radius: 16px;
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.7;
}

.application-alert h3 {
    font-size: 17px;
    margin-bottom: 8px;
}

.alert-success {
    color: #28613A;
    background: #EDF6EF;
    border: 1px solid #C9E6D1;
}

.alert-error {
    color: #B42318;
    background: #FFF1F0;
    border: 1px solid #F3CAC5;
}

.alert-error ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

/* MOBILE RESPONSIVENESS */

@media (max-width: 768px) {

    .apply-hero {
        margin-top: 20px;
        padding: 45px 20px;
        border-radius: 22px;
    }

    .apply-hero h1 {
        font-size: clamp(36px, 9vw, 54px);
    }

    .apply-hero p {
        font-size: 15px;
    }

    .application-container {
        width: calc(100% - 32px);
        margin-top: 40px;
        margin-bottom: 45px;
    }

    .application-heading {
        margin-bottom: 25px;
    }

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

    .form-section-header {
        gap: 12px;
        margin-bottom: 22px;
        padding-bottom: 20px;
    }

    .form-section-header h3 {
        font-size: 19px;
    }

    .section-icon {
        width: 42px;
        height: 42px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .apply-input,
    .apply-select,
    .currency-wrapper input {
        font-size: 16px;
    }

    .upload-zone {
        min-height: 160px;
        padding: 24px 15px;
    }

    .consent-section {
        padding: 20px;
    }

    .submission-note {
        font-size: 11px;
    }
}

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

    .apply-hero {
        animation: none;
    }
}
