/* ===== AFFILIATE PAGE ===== */

/* Hero */
.affiliate-hero {
    padding: 140px 0 80px;
    background: linear-gradient(180deg,
        rgba(224, 231, 255, 0.35) 0%,
        rgba(237, 233, 254, 0.15) 100%);
    text-align: center;
}

.affiliate-hero-content {
    max-width: 680px;
    margin: 0 auto;
}

.affiliate-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(65, 105, 225, 0.08);
    border: 1px solid rgba(65, 105, 225, 0.2);
    color: var(--primary-color);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
}

.affiliate-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.2;
}

.affiliate-hero p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 36px;
    line-height: 1.7;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    gap: 10px;
}

/* Why Section */
.affiliate-why {
    padding: 80px 0;
    background: linear-gradient(180deg,
        rgba(237, 233, 254, 0.15) 0%,
        rgba(224, 231, 255, 0.25) 40%,
        rgba(255, 255, 255, 0.9) 100%);
    position: relative;
    overflow: hidden;
}

.affiliate-why::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(ellipse at center,
        rgba(147, 197, 253, 0.12) 0%,
        rgba(196, 181, 253, 0.08) 40%,
        transparent 70%);
    pointer-events: none;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 12px;
    text-align: center;
}

.affiliate-benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 48px;
    position: relative;
    z-index: 1;
}

/* Last row: center remaining cards */
.affiliate-benefits-grid .affiliate-benefit-card:nth-child(5),
.affiliate-benefits-grid .affiliate-benefit-card:nth-child(6) {
    grid-column: auto;
}

.affiliate-benefits-grid::after {
    content: '';
    grid-column: span 2;
}

/* When only 2 cards remain in last row, center them */
@supports (grid-template-columns: subgrid) {
    .affiliate-benefits-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Center last two cards via wrapper trick */
.affiliate-benefits-last-row {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.affiliate-benefits-last-row .affiliate-benefit-card {
    width: calc(25% - 12px);
    max-width: 300px;
}

.affiliate-benefit-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.affiliate-benefit-card:hover {
    border-color: rgba(65, 105, 225, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.benefit-icon {
    width: 52px;
    height: 52px;
    background: rgba(65, 105, 225, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 22px;
    color: var(--primary-color);
}

.affiliate-benefit-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.affiliate-benefit-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.65;
}

/* How It Works */
.affiliate-how {
    padding: 80px 0;
    background: linear-gradient(180deg,
        rgba(255, 240, 245, 0.3) 0%,
        rgba(237, 233, 254, 0.2) 50%,
        rgba(224, 231, 255, 0.25) 100%);
    position: relative;
    overflow: hidden;
}

.affiliate-how::before {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse at center,
        rgba(196, 181, 253, 0.12) 0%,
        transparent 70%);
    pointer-events: none;
}

.affiliate-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 48px;
    position: relative;
    z-index: 1;
}

.affiliate-step {
    flex: 1;
    min-width: 200px;
    max-width: 260px;
    text-align: center;
    padding: 32px 20px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.step-number {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 20px;
}

.affiliate-step h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.affiliate-step p {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.65;
}

.affiliate-step-arrow {
    display: flex;
    align-items: center;
    padding-top: 26px;
    color: var(--text-lighter);
    font-size: 20px;
}

/* Application Form */
.affiliate-apply {
    padding: 80px 0 100px;
    background: linear-gradient(180deg,
        rgba(224, 231, 255, 0.2) 0%,
        rgba(255, 255, 255, 1) 40%);
    position: relative;
    overflow: hidden;
}

.affiliate-apply::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10%;
    width: 50%;
    height: 60%;
    background: radial-gradient(ellipse at center,
        rgba(147, 197, 253, 0.1) 0%,
        transparent 70%);
    pointer-events: none;
}

.affiliate-form-wrapper {
    max-width: 760px;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 48px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.affiliate-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.affiliate-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.affiliate-form-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

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

.affiliate-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.affiliate-form label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
}

.affiliate-form input,
.affiliate-form select,
.affiliate-form textarea {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.affiliate-form input:focus,
.affiliate-form select:focus,
.affiliate-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
    background: var(--white);
}

.affiliate-form textarea {
    resize: vertical;
    min-height: 100px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 28px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.form-check label {
    font-size: 0.875rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1.5;
}

.form-check label a {
    color: var(--primary-color);
    text-decoration: none;
}

.form-check label a:hover {
    text-decoration: underline;
}

.form-success {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 20px;
    color: #16a34a;
    font-size: 0.9rem;
}

.form-success .icon {
    font-size: 20px;
    flex-shrink: 0;
}

.form-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 14px;
    color: #dc2626;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .affiliate-hero {
        padding: 100px 0 60px;
    }

    .affiliate-form-wrapper {
        padding: 28px 20px;
    }

    .affiliate-form .form-row {
        grid-template-columns: 1fr;
    }

    .affiliate-step-arrow {
        display: none;
    }

    .affiliate-steps {
        flex-direction: column;
        align-items: center;
    }

    .affiliate-step {
        max-width: 100%;
        width: 100%;
    }
}

/* White icons inside primary buttons */
.affiliate-hero .btn-primary .icon,
.affiliate-form .btn-primary .icon {
    filter: brightness(0) invert(1);
}
