/* ============================================
   Affiliation — styles dédiés (préfixe .aff-)
   Hérite des variables/fonts du layout marketing
   ============================================ */

:root {
    --aff-ivory:   #F5EFE6;
    --aff-paper:   #EDE5D6;
    --aff-ink:     #14110E;
    --aff-gold:    #A8884A;
    --aff-rose:    #C9A07A;
    --aff-green:   #3B7D4F;
    --aff-amber:   #D97706;
    --aff-red:     #C2410C;
    --aff-grey:    #6B6559;
    --aff-shadow:  0 10px 30px rgba(20, 17, 14, 0.06);
    --aff-border:  rgba(20, 17, 14, 0.10);
}

.aff-page {
    background: var(--aff-ivory);
    color: var(--aff-ink);
    min-height: 100vh;
    font-family: 'Inter', system-ui, sans-serif;
}

.aff-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 24px;
}

.aff-container-narrow {
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 24px;
}

.aff-eyebrow {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--aff-gold);
    font-size: 15px;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.aff-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 600;
    line-height: 1.08;
    margin: 0 0 20px;
}

.aff-title em {
    color: var(--aff-gold);
    font-style: italic;
}

.aff-sub {
    color: var(--aff-grey);
    font-size: 17px;
    line-height: 1.6;
    margin: 0 0 32px;
    max-width: 640px;
}

.aff-subnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--aff-border);
    margin-bottom: 24px;
}

.aff-subnav a {
    color: var(--aff-ink);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.aff-subnav a:hover {
    color: var(--aff-gold);
}

.aff-brand {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    font-style: italic;
    color: var(--aff-ink);
}

/* Boutons */
.aff-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--aff-ink);
    color: var(--aff-ivory);
    border: none;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.aff-btn:hover { background: var(--aff-gold); color: var(--aff-ivory); }

.aff-btn-gold { background: var(--aff-gold); color: var(--aff-ivory); }
.aff-btn-gold:hover { background: var(--aff-ink); }

.aff-btn-ghost {
    background: transparent;
    color: var(--aff-ink);
    border: 1px solid var(--aff-border);
}
.aff-btn-ghost:hover { background: var(--aff-paper); color: var(--aff-ink); }

.aff-btn-sm { padding: 8px 16px; font-size: 13px; }
.aff-btn-danger { background: var(--aff-red); }
.aff-btn-danger:hover { background: #9a3410; color: var(--aff-ivory); }

/* Cartes */
.aff-card {
    background: #FFFFFF;
    border: 1px solid var(--aff-border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--aff-shadow);
}

.aff-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    margin: 0 0 16px;
    font-weight: 600;
}

/* Grille stats dashboard */
.aff-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.aff-stat {
    background: #FFFFFF;
    border: 1px solid var(--aff-border);
    border-radius: 8px;
    padding: 20px;
}

.aff-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--aff-grey);
    margin-bottom: 8px;
}

.aff-stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--aff-ink);
}

.aff-stat-value .aff-unit {
    font-size: 14px;
    color: var(--aff-grey);
    font-family: 'Inter', sans-serif;
    margin-left: 4px;
    font-weight: 400;
}

/* Formulaires */
.aff-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.aff-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aff-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--aff-ink);
}

.aff-input, .aff-textarea, .aff-select {
    padding: 10px 12px;
    border: 1px solid var(--aff-border);
    border-radius: 4px;
    background: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    color: var(--aff-ink);
    transition: border-color 0.2s;
}

.aff-input:focus, .aff-textarea:focus, .aff-select:focus {
    outline: none;
    border-color: var(--aff-gold);
}

.aff-textarea { resize: vertical; min-height: 90px; }

.aff-hint {
    font-size: 12px;
    color: var(--aff-grey);
}

/* Ref link box */
.aff-reflink {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--aff-paper);
    border: 1px solid var(--aff-border);
    border-radius: 6px;
    margin-bottom: 12px;
}

.aff-reflink code {
    flex: 1;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 14px;
    color: var(--aff-ink);
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tableaux */
.aff-table {
    width: 100%;
    border-collapse: collapse;
    background: #FFFFFF;
}

.aff-table th, .aff-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--aff-border);
    font-size: 14px;
}

.aff-table th {
    background: var(--aff-paper);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--aff-grey);
}

.aff-table tr:last-child td { border-bottom: none; }
.aff-table tr:hover { background: var(--aff-paper); }

/* Badges de statut */
.aff-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.aff-badge-pending   { background: #FEF3C7; color: #92400E; }
.aff-badge-active, .aff-badge-confirmed { background: #D1FAE5; color: #065F46; }
.aff-badge-paid      { background: #DBEAFE; color: #1E40AF; }
.aff-badge-suspended, .aff-badge-rejected { background: #FEE2E2; color: #991B1B; }

/* Benefits grid (landing) */
.aff-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.aff-benefit {
    background: #FFFFFF;
    border: 1px solid var(--aff-border);
    border-radius: 8px;
    padding: 24px;
}

.aff-benefit-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--aff-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.aff-benefit h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    margin: 0 0 8px;
    font-weight: 600;
}

.aff-benefit p {
    color: var(--aff-grey);
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}

/* Flash messages */
.aff-flash {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}
.aff-flash-error   { background: #FEE2E2; color: #991B1B; }
.aff-flash-success { background: #D1FAE5; color: #065F46; }
.aff-flash-info    { background: #DBEAFE; color: #1E40AF; }

/* Admin inline controls */
.aff-inline-form { display: inline-flex; gap: 6px; align-items: center; }
.aff-inline-form select, .aff-inline-form input[type="number"] {
    padding: 4px 8px;
    border: 1px solid var(--aff-border);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}
