.affiliate-wizard-section {
    padding: 72px 0 96px;
    background-color: #ffffff;
    background-image:
        linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)),
        url('../images/fondovideoblanco.png');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

.affiliate-wizard-card {
    background: #ffffff;
    border: 1px solid var(--ad-border);
    border-radius: 16px;
    box-shadow: 0 20px 40px -10px rgba(18,25,56,.08);
    margin: 0 auto;
    max-width: 650px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

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

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

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

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

.affiliate-wizard-header h2,
.affiliate-success h2 {
    color: #232835;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.affiliate-wizard-header p,
.affiliate-success p {
    color: #4e5362 !important;
    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(--ad-border);
    color: #232835;
    display: flex;
    font-size: 1.1rem;
    font-weight: 700;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 12px;
}

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

.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: #232835;
    font-size: .85rem;
    font-weight: 600;
}

.affiliate-field input,
.affiliate-field select,
.affiliate-field textarea {
    background: #f3f5f8;
    border: 1px solid #c4cdd8;
    border-radius: 6px;
    color: #232835;
    font: inherit;
    font-size: .95rem;
    min-height: 46px;
    outline: none;
    padding: 12px 14px;
    width: 100%;
}

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

.affiliate-field input:focus,
.affiliate-field select:focus,
.affiliate-field textarea:focus {
    border-color: var(--ad-purple);
    box-shadow: 0 0 0 3px rgba(45, 14, 96,.10);
}

/* Oculta el select nativo solo cuando el JS ya lo ha mejorado */
.affiliate-field select[data-affiliate-native-select] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.ad-theme .affiliate-select-trigger {
    align-items: center;
    background: #f3f5f8;
    border: 1px solid #c4cdd8;
    border-radius: 6px;
    color: #232835;
    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%;
}

.ad-theme .affiliate-select-trigger i { color: #94a3b8; font-size: .78rem; }

.ad-theme .affiliate-select-trigger:focus,
.ad-theme .affiliate-select-trigger.is-open {
    border-color: var(--ad-purple);
    box-shadow: 0 0 0 3px rgba(45, 14, 96,.10);
}

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

.affiliate-select-portal {
    background: #ffffff;
    border: 1px solid rgba(45, 14, 96,.30);
    border-radius: 10px;
    box-shadow: 0 18px 34px rgba(15,23,42,.12);
    display: none;
    max-height: 176px;
    overflow-y: auto;
    padding: 6px;
    position: fixed;
    scrollbar-color: rgba(45, 14, 96,.35) transparent;
    scrollbar-width: thin;
    z-index: 9999;
}

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

.ad-theme .affiliate-select-portal button {
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: #232835;
    cursor: pointer;
    font: inherit;
    font-size: .92rem;
    padding: 9px 12px;
    text-align: left;
    width: 100%;
}

.ad-theme .affiliate-select-portal button:hover,
.ad-theme .affiliate-select-portal button.is-selected {
    background: rgba(45, 14, 96,.08);
    color: var(--ad-purple);
}

/* Number control */
.affiliate-number-control {
    align-items: center;
    background: #f3f5f8;
    border: 1px solid #c4cdd8;
    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(--ad-purple);
    box-shadow: 0 0 0 3px rgba(45, 14, 96,.10);
}

.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; }

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

.ad-theme .affiliate-number-control button:hover { background: rgba(45, 14, 96,.14); }

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

.affiliate-radio-group label,
.affiliate-check {
    align-items: center;
    background: #f3f5f8;
    border: 1px solid #c4cdd8;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    transition: border-color .2s ease;
}

.affiliate-radio-group label {
    flex: 1;
    font-size: .9rem;
    font-weight: 600;
    justify-content: center;
}

.affiliate-radio-group label:hover { border-color: rgba(45, 14, 96,.35); }

.affiliate-check { align-items: flex-start; margin: 2px 0 24px; }
.affiliate-check input { accent-color: var(--ad-purple); flex: 0 0 auto; margin-top: 2px; }

.affiliate-radio-group input {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px #f3f5f8;
    flex: 0 0 16px;
    height: 16px;
    margin: 0;
    min-height: 0;
    padding: 0;
    width: 16px;
}

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

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

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

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

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

.ad-theme .affiliate-btn--primary,
.ad-theme .affiliate-btn--submit {
    background: linear-gradient(180deg, #4b168c 0%, #2d0e60 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74,32,216,.18);
}

.ad-theme .affiliate-btn--primary:hover,
.ad-theme .affiliate-btn--submit:hover {
    background: linear-gradient(135deg, var(--ad-purple-hover, #6a2cf3), var(--ad-purple-hover-2, #8d3dff));
    box-shadow: 0 8px 18px rgba(74,32,216,.24);
    color: #ffffff;
}

.ad-theme .affiliate-btn--soft {
    background: #f3f5f8;
    border: 1px solid #c4cdd8;
    color: #4e5362;
}

.ad-theme .affiliate-btn--soft:hover { border-color: rgba(45, 14, 96,.35); color: #232835; }

/* Éxito */
.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 { flex-direction: column; gap: 12px; }
    .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; }
}
