.affiliate-page {
    background-color: transparent;
    min-height: calc(100vh - 80px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: var(--font-main, 'Chakra Petch', system-ui, sans-serif);
}

.affiliate-page .form-char-counter {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted, #8a9aa6);
    text-align: right;
}

.affiliate-page .form-char-counter.is-limit {
    color: #ef4444;
}

.affiliate-container {
    position: relative;
    width: 100%;
    max-width: 550px;
    background-color: var(--surface-800);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 30px;
    margin-top: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    overflow: visible;
}

.affiliate-page .affiliate-sponsor-field {
    position: relative;
    z-index: 30;
    overflow: visible;
}

.affiliate-title {
    color: var(--text-light);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: -0.02em;
}

.affiliate-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 30px;
    line-height: 1.5;
    text-align: center;
}

.affiliate-page .form-group {
    margin-bottom: 20px;
}

.affiliate-page .form-label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.affiliate-page .form-control {
    width: 100%;
    background-color: var(--surface-700);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.affiliate-page .form-control::placeholder {
    color: var(--text-muted, #8a9aa6);
}

.affiliate-page .form-control:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.affiliate-page .form-control:focus {
    outline: none;
    border-color: rgba(var(--primary), 0.65);
    background-color: var(--surface-600);
    box-shadow: 0 0 0 3px rgba(var(--primary), 0.15);
}

.affiliate-page textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.affiliate-page .submit-btn {
    width: 100%;
    background: var(--brand-red, #f59e0b);
    color: var(--text-on-accent, #000);
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.affiliate-page .submit-btn:hover {
    background: var(--accent-hover, #d97706);
    color: var(--text-light, #fff);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(var(--primary), 0.28);
}

.affiliate-page .submit-btn:active {
    transform: translateY(0);
    filter: brightness(0.92);
}

.affiliate-page .submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Custom sponsor select ── */
.aff-select {
    position: relative;
    width: 100%;
}

.aff-select__trigger {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface-700);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.aff-select__trigger:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: var(--surface-700);
}

.aff-select.is-open .aff-select__trigger,
.aff-select__trigger:focus {
    outline: none;
    border-color: rgba(var(--primary), 0.65);
    background: var(--surface-600);
    box-shadow: 0 0 0 3px rgba(var(--primary), 0.15);
}

.aff-select__value {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.aff-select__placeholder {
    color: var(--text-muted, #8a9aa6);
    font-weight: 500;
}

.aff-select__caret {
    font-size: 16px;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.aff-select.is-open .aff-select__caret {
    transform: rotate(180deg);
    color: var(--brand-red, #f59e0b);
}

.aff-select__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--surface-800);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.aff-select__panel[hidden] {
    display: none !important;
}

.aff-select__search {
    position: relative;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.aff-select__search i {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
    pointer-events: none;
}

.aff-select__search input {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-700);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-light);
    padding: 10px 12px 10px 38px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aff-select__search input:focus {
    border-color: rgba(var(--primary), 0.65);
    box-shadow: 0 0 0 3px rgba(var(--primary), 0.12);
}

.aff-select__list {
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
}

.aff-select__option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-on-dark, #e2e8f0);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.aff-select__option:hover,
.aff-select__option:focus {
    outline: none;
    background: var(--surface-700);
    color: var(--text-light);
}

.aff-select__option.is-selected {
    background: rgba(var(--primary), 0.14);
    color: var(--text-light);
}

.aff-select__option.is-selected:hover {
    background: rgba(var(--primary), 0.2);
}

.aff-select__logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--surface-600);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.aff-select__logo--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 15px;
    padding: 0;
}

.aff-select__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.aff-select__empty {
    padding: 18px 12px;
    text-align: center;
    color: var(--text-muted, #8a9aa6);
    font-size: 13px;
}

.aff-select__empty[hidden] {
    display: none !important;
}

/* Date input icon */
.affiliate-page .date-input-wrapper {
    position: relative;
}

.affiliate-page .date-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 20px;
    pointer-events: none;
    z-index: 1;
}

.affiliate-page .date-input-wrapper input {
    padding-left: 48px;
}

.affiliate-page ::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.affiliate-page ::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

@media (max-width: 640px) {
    .affiliate-container {
        margin-top: 16px;
        padding: 20px 16px;
        border-radius: 12px;
    }

    .affiliate-title {
        font-size: 20px;
    }
}
