.page-affiliate {
    background: var(--bg-soft);
    font-family: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.affiliate-wizard-section {
    align-items: center;
    display: flex;
    min-height: calc(100vh - 84px);
    padding: 80px 0;
}

.affiliate-wizard-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .08);
    margin: 0 auto;
    max-width: 650px;
    overflow: hidden;
    position: relative;
}

.affiliate-progress {
    background: rgba(148, 163, 184, .18);
    border-radius: 16px 16px 0 0;
    height: 4px;
    overflow: hidden;
}

.affiliate-progress__bar {
    background: var(--cyan);
    height: 100%;
    transition: width 0.25s ease;
    width: 33%;
}

.affiliate-wizard-header,
.affiliate-step,
.affiliate-success,
.affiliate-alert {
    padding: 40px;
}

.affiliate-wizard-header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
    text-align: center;
}

.affiliate-wizard-header h2,
.affiliate-success h2 {
    color: var(--text);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
}

.affiliate-wizard-header p,
.affiliate-success p {
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.6;
    margin: 8px 0 0;
}

.affiliate-alert--error {
    background: #fff4f1;
    border-bottom: 1px solid #ffd2c6;
    color: #9f2414;
}

.affiliate-alert ul {
    margin: 10px 0 0;
    padding-left: 18px;
}

.affiliate-step,
.affiliate-success {
    display: none;
}

.affiliate-step.is-active,
.affiliate-success.is-active {
    display: block;
}

.affiliate-step__title {
    align-items: center;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    display: flex;
    font-size: 1.1rem;
    font-weight: 700;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 12px;
}

.affiliate-step__title i {
    color: var(--cyan);
}

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

.affiliate-field {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.affiliate-field[hidden] {
    display: none !important;
}

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

.affiliate-field span,
.affiliate-check span {
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
}

.affiliate-field input,
.affiliate-field select,
.affiliate-field textarea {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    font-size: .95rem;
    min-height: 46px;
    outline: none;
    padding: 12px 14px;
    width: 100%;
}

.affiliate-field select {
    color-scheme: dark;
}

.affiliate-field select option {
    background: var(--surface-2);
    color: var(--text);
}

.affiliate-field select option:hover,
.affiliate-field select option:focus,
.affiliate-field select option:active,
.affiliate-field select option:checked {
    background-color: var(--cyan) !important;
    box-shadow: 0 0 0 100vmax var(--cyan) inset !important;
    color: #001419 !important;
}

.affiliate-field select[data-affiliate-native-select] {
    height: 1px;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    width: 1px;
}

.affiliate-select-trigger {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: .95rem;
    justify-content: space-between;
    min-height: 46px;
    outline: none;
    padding: 12px 14px;
    text-align: left;
    width: 100%;
}

.affiliate-select-trigger i {
    color: var(--muted);
    font-size: .78rem;
}

.affiliate-select-trigger:focus,
.affiliate-select-trigger.is-open {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 209, 224, .12);
}

.affiliate-select-trigger.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

.affiliate-select-portal {
    background: #121720;
    border: 1px solid rgba(0, 209, 224, .55);
    border-radius: 10px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, .32);
    display: none;
    max-height: 176px;
    overflow-y: auto;
    padding: 6px;
    position: fixed;
    scrollbar-color: rgba(0, 209, 224, .45) transparent;
    scrollbar-width: thin;
    z-index: 9999;
}

.affiliate-select-portal::-webkit-scrollbar {
    width: 5px;
}

.affiliate-select-portal::-webkit-scrollbar-track {
    background: transparent;
}

.affiliate-select-portal::-webkit-scrollbar-thumb {
    background: rgba(0, 209, 224, .38);
    border-radius: 999px;
}

.affiliate-select-portal.is-open {
    display: grid;
    gap: 2px;
}

.affiliate-select-portal button {
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: .92rem;
    padding: 9px 12px;
    text-align: left;
}

.affiliate-select-portal button:hover,
.affiliate-select-portal button.is-selected {
    background: rgba(0, 209, 224, .12);
    color: var(--cyan);
}

.affiliate-field textarea {
    min-height: 132px;
    resize: vertical;
}

.affiliate-field input:focus,
.affiliate-field select:focus,
.affiliate-field textarea:focus {
    background: var(--surface-2);
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 209, 224, .12);
}

.affiliate-number-control {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    min-height: 50px;
    overflow: hidden;
}

.affiliate-number-control:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 209, 224, .12);
}

.affiliate-number-control input {
    background: transparent;
    border: 0;
    box-shadow: none;
    min-height: 48px;
    padding: 12px 10px;
    text-align: center;
}

.affiliate-number-control input:focus {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.affiliate-number-control input::-webkit-outer-spin-button,
.affiliate-number-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.affiliate-number-control input[type="number"] {
    -moz-appearance: textfield;
}

.affiliate-number-control button {
    align-items: center;
    align-self: stretch;
    background: rgba(0, 209, 224, .08);
    border: 0;
    color: var(--cyan);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 800;
    justify-content: center;
    line-height: 1;
    transition: background .2s ease, color .2s ease;
}

.affiliate-number-control button:hover,
.affiliate-number-control button:focus {
    background: rgba(0, 209, 224, .16);
    color: var(--text);
    outline: none;
}

.affiliate-radio-group {
    display: flex;
    gap: 20px;
}

.affiliate-radio-group label,
.affiliate-check {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
}

.affiliate-radio-group label {
    align-items: center;
    cursor: pointer;
    display: flex;
    flex: 1;
    font-size: .9rem;
    font-weight: 600;
    gap: 10px;
    justify-content: center;
    padding: 12px 16px;
    transition: background .2s ease, border-color .2s ease;
}

.affiliate-radio-group label:hover {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .22);
}

.affiliate-check {
    align-items: flex-start;
    margin: 2px 0 24px;
}

.affiliate-check input {
    accent-color: var(--cyan);
    flex: 0 0 auto;
    margin-top: 2px;
}

.affiliate-radio-group input {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, .75);
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px var(--surface-2);
    flex: 0 0 16px;
    height: 16px;
    margin: 0;
    min-height: 0;
    padding: 0;
    width: 16px;
}

.affiliate-radio-group input:checked {
    background: var(--cyan);
    border-color: var(--cyan);
}

.affiliate-radio-group input:focus {
    outline: none;
}

.affiliate-radio-group label:has(input:focus-visible) {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 209, 224, .12);
}

.affiliate-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    margin-top: 30px;
    padding-top: 20px;
}

.affiliate-actions--end {
    justify-content: flex-end;
}

.affiliate-btn {
    align-items: center;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font-size: .95rem;
    font-weight: 700;
    gap: 9px;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.affiliate-btn:hover {
    transform: translateY(-1px);
}

.affiliate-btn--primary,
.affiliate-btn--submit {
    background: var(--cta-green);
    box-shadow: none;
    color: #ffffff;
}

.affiliate-btn--primary:hover,
.affiliate-btn--submit:hover {
    background: var(--cta-green-dark);
}

.affiliate-btn--soft {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
}

.affiliate-btn--submit {
    background: var(--cta-green);
}

.affiliate-btn--submit:hover {
    background: var(--cta-green-dark);
}

[data-theme="light"] .affiliate-wizard-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] .affiliate-progress {
    background: #f1f5f9;
}

[data-theme="light"] .affiliate-wizard-header {
    border-bottom-color: #e6ebf2;
}

[data-theme="light"] .affiliate-wizard-header h2,
[data-theme="light"] .affiliate-success h2,
[data-theme="light"] .affiliate-step__title,
[data-theme="light"] .affiliate-field span,
[data-theme="light"] .affiliate-check span {
    color: #0f172a;
}

[data-theme="light"] .affiliate-wizard-header p,
[data-theme="light"] .affiliate-success p {
    color: #64748b;
}

[data-theme="light"] .affiliate-step__title,
[data-theme="light"] .affiliate-actions {
    border-color: #e2e8f0;
}

[data-theme="light"] .affiliate-field input,
[data-theme="light"] .affiliate-field select,
[data-theme="light"] .affiliate-field textarea,
[data-theme="light"] .affiliate-number-control,
[data-theme="light"] .affiliate-radio-group label,
[data-theme="light"] .affiliate-check {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .affiliate-number-control button {
    background: rgba(11, 141, 151, .08);
    color: var(--cyan);
}

[data-theme="light"] .affiliate-number-control button:hover,
[data-theme="light"] .affiliate-number-control button:focus {
    background: rgba(11, 141, 151, .14);
    color: #0f172a;
}

[data-theme="light"] .affiliate-radio-group input {
    border-color: #94a3b8;
    box-shadow: inset 0 0 0 3px #ffffff;
}

[data-theme="light"] .affiliate-radio-group input:checked {
    background: var(--cyan);
    border-color: var(--cyan);
}

[data-theme="light"] .affiliate-radio-group label:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

[data-theme="light"] .affiliate-field select {
    color-scheme: light;
}

[data-theme="light"] .affiliate-field select option {
    background: #ffffff;
    color: #0f172a;
}

[data-theme="light"] .affiliate-field select option:hover,
[data-theme="light"] .affiliate-field select option:focus,
[data-theme="light"] .affiliate-field select option:active,
[data-theme="light"] .affiliate-field select option:checked {
    background-color: var(--cyan) !important;
    box-shadow: 0 0 0 100vmax var(--cyan) inset !important;
    color: #ffffff !important;
}

[data-theme="light"] .affiliate-select-trigger,
[data-theme="light"] .affiliate-select-portal {
    background: #ffffff;
    border-color: rgba(11, 141, 151, .35);
    color: #0f172a;
}

[data-theme="light"] .affiliate-select-trigger i {
    color: #64748b;
}

[data-theme="light"] .affiliate-select-portal {
    box-shadow: 0 18px 34px rgba(15, 23, 42, .12);
    scrollbar-color: rgba(11, 141, 151, .45) transparent;
}

[data-theme="light"] .affiliate-select-portal button {
    color: #0f172a;
}

[data-theme="light"] .affiliate-select-portal button:hover,
[data-theme="light"] .affiliate-select-portal button.is-selected {
    background: rgba(11, 141, 151, .08);
    color: var(--cyan);
}

.affiliate-field input:-webkit-autofill,
.affiliate-field input:-webkit-autofill:hover,
.affiliate-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    box-shadow: 0 0 0 1000px var(--surface-2) inset;
    transition: background-color 9999s ease-out;
}

[data-theme="light"] .affiliate-field input:-webkit-autofill,
[data-theme="light"] .affiliate-field input:-webkit-autofill:hover,
[data-theme="light"] .affiliate-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a;
    box-shadow: 0 0 0 1000px #ffffff inset;
}

[data-theme="light"] .affiliate-btn--primary {
    background: var(--cta-green);
}

[data-theme="light"] .affiliate-btn--primary:hover {
    background: var(--cta-green-dark);
}

[data-theme="light"] .affiliate-btn--soft {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.affiliate-success {
    text-align: center;
}

.affiliate-success__icon {
    align-items: center;
    background: #16a34a;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    height: 58px;
    justify-content: center;
    margin-bottom: 18px;
    width: 58px;
}

.affiliate-success .affiliate-btn {
    margin-top: 22px;
}

@media (max-width: 860px) {
    .affiliate-grid {
        grid-template-columns: 1fr;
    }

    .affiliate-radio-group,
    .affiliate-actions {
        grid-template-columns: 1fr;
    }

    .affiliate-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .affiliate-actions--end {
        align-items: stretch;
    }

    .affiliate-btn {
        width: 100%;
    }

    .affiliate-wizard-header,
    .affiliate-step,
    .affiliate-success,
    .affiliate-alert {
        padding: 24px;
    }
}
