/* ═══════════════════════════════════════════════════════════════
   🎨 EVO PHONICS AFFILIATE — Complete Style (v4)
   ───────────────────────────────────────────────────────────────
   Mobile-first, Marathi-friendly, premium gradient design
   + Language toggle button
   + Login page styles
   + Dashboard styles (navbar, stats, coupon, referrals)
   + Upgrade modal (Option C)
   ═══════════════════════════════════════════════════════════════ */


/* ═══════ CSS VARIABLES ═══════ */
:root {
    --aff-primary:        #7C4DFF;
    --aff-primary-dark:   #5E35B1;
    --aff-secondary:      #FF6F00;
    --aff-secondary-dark: #E65100;
    --aff-success:        #4CAF50;
    --aff-success-dark:   #2E7D32;
    --aff-warning:        #FFA726;
    --aff-warning-dark:   #EF6C00;
    --aff-danger:         #EF5350;
    --aff-bg-1:           #f3eaff;
    --aff-bg-2:           #fce4ec;
    --aff-text:           #1a1a2e;
    --aff-text-muted:     #6b7280;
    --aff-border:         #e5e7eb;
    --aff-border-focus:   #7C4DFF;
    --aff-radius:         16px;
    --aff-shadow:         0 10px 40px rgba(124, 77, 255, 0.15);
    --aff-shadow-hover:   0 14px 50px rgba(124, 77, 255, 0.25);
    --aff-font:           'Nunito', 'Noto Sans Devanagari', system-ui, sans-serif;
}


/* ═══════ BODY BACKGROUND ═══════ */
body {
    font-family:    var(--aff-font);
    background:     linear-gradient(135deg, var(--aff-bg-1) 0%, var(--aff-bg-2) 50%, #fff3e0 100%);
    min-height:     100vh;
    color:          var(--aff-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-attachment: fixed;
    margin:         0;
}

body::before,
body::after {
    content:    '';
    position:   fixed;
    border-radius: 50%;
    z-index:    -1;
    opacity:    0.4;
    filter:     blur(80px);
    pointer-events: none;
}
body::before {
    top:    -100px;
    left:   -100px;
    width:  400px;
    height: 400px;
    background: radial-gradient(circle, #7C4DFF, transparent);
}
body::after {
    bottom: -100px;
    right:  -100px;
    width:  500px;
    height: 500px;
    background: radial-gradient(circle, #FF6F00, transparent);
}


/* ═══════ LANGUAGE TOGGLE BUTTON (signup, login pages) ═══════ */
.aff-lang-btn {
    position:       fixed;
    top:            16px;
    right:          16px;
    z-index:        100;
    background:     rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border:         2px solid var(--aff-primary);
    color:          var(--aff-primary-dark);
    padding:        8px 14px;
    border-radius:  20px;
    font-family:    var(--aff-font);
    font-size:      13px;
    font-weight:    900;
    letter-spacing: 0.3px;
    cursor:         pointer;
    box-shadow:     0 4px 14px rgba(124, 77, 255, 0.25);
    display:        flex;
    align-items:    center;
    gap:            6px;
    transition:     all 0.2s ease;
    user-select:    none;
}

.aff-lang-btn:hover {
    background:     var(--aff-primary);
    color:          white;
    transform:      translateY(-2px);
    box-shadow:     0 6px 20px rgba(124, 77, 255, 0.45);
}

.aff-lang-btn:active {
    transform:      translateY(0);
}

.aff-lang-icon {
    font-size:      14px;
    line-height:    1;
}

#lang-toggle-label {
    line-height:    1;
}


/* ═══════ MAIN CARD (signup, login) ═══════ */
.aff-card {
    width:          100%;
    max-width:      480px;
    background:     #ffffff;
    border-radius:  var(--aff-radius);
    box-shadow:     var(--aff-shadow);
    overflow:       hidden;
    margin:         20px 0;
    animation:      slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ═══════ HEADER ═══════ */
.aff-header {
    background:     linear-gradient(135deg, var(--aff-primary) 0%, var(--aff-primary-dark) 100%);
    color:          white;
    padding:        32px 24px 28px;
    text-align:     center;
    position:       relative;
    overflow:       hidden;
}

.aff-header::before {
    content:    '';
    position:   absolute;
    top:        -50%;
    left:       -50%;
    width:      200%;
    height:     200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 50%);
    animation:  pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1);   opacity: 0.5; }
    50%      { transform: scale(1.1); opacity: 0.8; }
}

.aff-logo-circle {
    width:          70px;
    height:         70px;
    background:     rgba(255, 255, 255, 0.2);
    border:         3px solid rgba(255, 255, 255, 0.4);
    border-radius:  50%;
    display:        flex;
    align-items:    center;
    justify-content: center;
    font-size:      36px;
    margin:         0 auto 16px;
    backdrop-filter: blur(10px);
    position:       relative;
    z-index:        1;
}

.aff-title {
    font-size:      24px;
    font-weight:    900;
    margin-bottom:  6px;
    position:       relative;
    z-index:        1;
    letter-spacing: -0.5px;
}

.aff-subtitle {
    font-size:      14px;
    font-weight:    600;
    opacity:        0.95;
    position:       relative;
    z-index:        1;
}


/* ═══════ TRUST BADGES ═══════ */
.aff-badges {
    display:        flex;
    gap:            8px;
    padding:        16px 20px;
    background:     #fafafa;
    border-bottom:  1px solid var(--aff-border);
    overflow-x:     auto;
}

.aff-badge {
    flex:           1;
    min-width:      0;
    background:     white;
    border:         1.5px solid var(--aff-border);
    border-radius:  10px;
    padding:        10px 8px;
    text-align:     center;
    transition:     all 0.2s ease;
}

.aff-badge:hover {
    border-color:   var(--aff-primary);
    transform:      translateY(-2px);
    box-shadow:     0 4px 12px rgba(124, 77, 255, 0.15);
}

.aff-badge-icon {
    display:        block;
    font-size:      20px;
    margin-bottom:  4px;
}

.aff-badge-text {
    display:        block;
    font-size:      10px;
    font-weight:    800;
    color:          var(--aff-text);
    line-height:    1.2;
}


/* ═══════ FORM ═══════ */
.aff-form {
    padding:        24px;
}

.aff-form-title {
    font-size:      18px;
    font-weight:    900;
    color:          var(--aff-text);
    margin-bottom:  20px;
    text-align:     center;
}

.aff-field {
    margin-bottom:  16px;
}

.aff-label {
    display:        block;
    font-size:      13px;
    font-weight:    700;
    color:          var(--aff-text);
    margin-bottom:  6px;
    letter-spacing: 0.2px;
}

.aff-required {
    color:          var(--aff-danger);
    font-weight:    900;
}


/* ═══════ INPUTS ═══════ */
.aff-input {
    width:          100%;
    padding:        12px 14px;
    font-size:      15px;
    font-family:    var(--aff-font);
    font-weight:    600;
    color:          var(--aff-text);
    background:     #f9fafb;
    border:         2px solid var(--aff-border);
    border-radius:  10px;
    outline:        none;
    transition:     all 0.2s ease;
    -webkit-appearance: none;
    box-sizing:     border-box;
}

.aff-input::placeholder {
    color:          #9ca3af;
    font-weight:    500;
}

.aff-input:focus {
    background:     white;
    border-color:   var(--aff-border-focus);
    box-shadow:     0 0 0 4px rgba(124, 77, 255, 0.12);
}

.aff-input-error {
    border-color:   var(--aff-danger) !important;
    background:     #fef2f2 !important;
}


/* ═══════ MOBILE PREFIX ═══════ */
.aff-mobile-wrap {
    display:        flex;
    align-items:    stretch;
}

.aff-mobile-prefix {
    background:     #e8e0ff;
    color:          var(--aff-primary-dark);
    padding:        12px 14px;
    font-weight:    900;
    font-size:      15px;
    border:         2px solid var(--aff-border);
    border-right:   none;
    border-radius:  10px 0 0 10px;
    display:        flex;
    align-items:    center;
}

.aff-mobile-input {
    border-radius:  0 10px 10px 0;
    border-left:    none;
}


/* ═══════ PASSWORD TOGGLE ═══════ */
.aff-password-wrap {
    position:       relative;
}

.aff-password-toggle {
    position:       absolute;
    right:          12px;
    top:            50%;
    transform:      translateY(-50%);
    background:     none;
    border:         none;
    cursor:         pointer;
    font-size:      18px;
    padding:        4px;
    line-height:    1;
}


/* ═══════ HINTS & ERRORS ═══════ */
.aff-hint {
    font-size:      11px;
    color:          var(--aff-text-muted);
    font-weight:    600;
    margin-top:     5px;
}

.aff-error {
    font-size:      12px;
    color:          var(--aff-danger);
    font-weight:    700;
    margin-top:     5px;
    min-height:     16px;
}


/* ═══════ CHECKBOX (Terms) ═══════ */
.aff-checkbox-wrap {
    display:        flex;
    align-items:    flex-start;
    gap:            10px;
    margin-top:     10px;
    margin-bottom:  6px;
    padding:        12px;
    background:     #faf7ff;
    border-radius:  10px;
}

.aff-checkbox {
    width:          20px;
    height:         20px;
    accent-color:   var(--aff-primary);
    cursor:         pointer;
    flex-shrink:    0;
    margin-top:     1px;
}

.aff-checkbox-label {
    font-size:      13px;
    color:          var(--aff-text);
    font-weight:    600;
    cursor:         pointer;
    line-height:    1.4;
}


/* ═══════ LOGIN: Remember Me + Forgot Password ═══════ */
.aff-login-options {
    display:        flex;
    justify-content: space-between;
    align-items:    center;
    margin-top:     -4px;
    margin-bottom:  16px;
    flex-wrap:      wrap;
    gap:            10px;
}

.aff-remember-wrap {
    display:        flex;
    align-items:    center;
    gap:            6px;
    cursor:         pointer;
    font-size:      13px;
    font-weight:    700;
    color:          var(--aff-text-muted);
    user-select:    none;
}

.aff-checkbox-small {
    width:          16px;
    height:         16px;
    accent-color:   var(--aff-primary);
    cursor:         pointer;
}

.aff-link-small {
    font-size:      13px;
}


/* ═══════ DIVIDER ═══════ */
.aff-divider {
    text-align:     center;
    margin:         18px 0 12px;
    position:       relative;
}

.aff-divider::before {
    content:    '';
    position:   absolute;
    top:        50%;
    left:       0;
    right:      0;
    height:     1px;
    background: var(--aff-border);
    z-index:    0;
}

.aff-divider-text {
    background:     white;
    padding:        0 12px;
    font-size:      12px;
    font-weight:    700;
    color:          var(--aff-text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    position:       relative;
    z-index:        1;
}


/* ═══════ LINKS ═══════ */
.aff-link {
    color:          var(--aff-primary);
    font-weight:    800;
    text-decoration: none;
    border-bottom:  2px solid transparent;
    transition:     border-color 0.2s ease;
}

.aff-link:hover {
    border-bottom-color: var(--aff-primary);
}


/* ═══════ SUBMIT BUTTON ═══════ */
.aff-submit-btn {
    width:          100%;
    padding:        14px 20px;
    background:     linear-gradient(135deg, var(--aff-primary) 0%, var(--aff-primary-dark) 100%);
    color:          white;
    border:         none;
    border-radius:  12px;
    font-family:    var(--aff-font);
    font-size:      16px;
    font-weight:    900;
    letter-spacing: 0.3px;
    cursor:         pointer;
    margin-top:     12px;
    box-shadow:     0 4px 16px rgba(124, 77, 255, 0.4);
    transition:     all 0.2s ease;
    display:        flex;
    align-items:    center;
    justify-content: center;
    gap:            8px;
    min-height:     50px;
}

.aff-submit-btn:hover:not(:disabled) {
    transform:      translateY(-2px);
    box-shadow:     0 8px 22px rgba(124, 77, 255, 0.5);
}

.aff-submit-btn:active:not(:disabled) {
    transform:      translateY(0);
}

.aff-submit-btn:disabled {
    opacity:        0.7;
    cursor:         wait;
}

.aff-btn-secondary {
    background:     linear-gradient(135deg, var(--aff-success) 0%, var(--aff-success-dark) 100%);
    box-shadow:     0 4px 16px rgba(76, 175, 80, 0.4);
}

.aff-btn-warning {
    background:     linear-gradient(135deg, var(--aff-warning) 0%, var(--aff-warning-dark) 100%);
    box-shadow:     0 4px 16px rgba(255, 167, 38, 0.4);
}

.aff-btn-warning:hover:not(:disabled) {
    box-shadow:     0 8px 22px rgba(255, 167, 38, 0.5);
}

.aff-btn-ghost {
    background:     transparent;
    color:          var(--aff-text-muted);
    border:         2px solid var(--aff-border);
    box-shadow:     none;
    margin-top:     8px;
}

.aff-btn-ghost:hover:not(:disabled) {
    background:     #f9fafb;
    color:          var(--aff-text);
    transform:      translateY(-1px);
    box-shadow:     0 4px 12px rgba(0, 0, 0, 0.05);
}


/* ═══════ LOADER ═══════ */
.aff-loader {
    width:          22px;
    height:         22px;
    border:         3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius:  50%;
    animation:      spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ═══════ LOGIN LINK ═══════ */
.aff-login-link {
    text-align:     center;
    margin-top:     14px;
    font-size:      13px;
    color:          var(--aff-text-muted);
    font-weight:    600;
}


/* ═══════ SUCCESS STATE ═══════ */
.aff-success {
    padding:        40px 24px;
    text-align:     center;
    animation:      slideUp 0.5s ease-out;
}

.aff-success-icon {
    font-size:      72px;
    margin-bottom:  16px;
    animation:      bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

.aff-success-title {
    font-size:      28px;
    font-weight:    900;
    color:          var(--aff-success-dark);
    margin-bottom:  12px;
}

.aff-success-text {
    font-size:      15px;
    color:          var(--aff-text);
    line-height:    1.6;
    margin-bottom:  16px;
    font-weight:    600;
}

.aff-success-hint {
    font-size:      13px;
    color:          var(--aff-text-muted);
    background:     #fff8e1;
    padding:        12px;
    border-radius:  10px;
    margin-bottom:  20px;
    font-weight:    600;
}


/* ═══════ WARNING STATE (Email not verified) ═══════ */
.aff-warning {
    padding:        40px 24px;
    text-align:     center;
    animation:      slideUp 0.5s ease-out;
}

.aff-warning-icon {
    font-size:      72px;
    margin-bottom:  16px;
    animation:      bounce 1s ease-in-out;
}

.aff-warning-title {
    font-size:      26px;
    font-weight:    900;
    color:          var(--aff-warning-dark);
    margin-bottom:  12px;
}

.aff-warning-text {
    font-size:      15px;
    color:          var(--aff-text);
    line-height:    1.6;
    margin-bottom:  14px;
    font-weight:    600;
}

.aff-warning-hint {
    font-size:      13px;
    color:          var(--aff-text-muted);
    background:     #fff3e0;
    padding:        12px;
    border-radius:  10px;
    margin-bottom:  16px;
    font-weight:    600;
    border-left:    4px solid var(--aff-warning);
}


/* ═══════ FOOTER (signup, login) ═══════ */
.aff-footer {
    text-align:     center;
    padding:        16px 24px 20px;
    background:     #fafafa;
    border-top:     1px solid var(--aff-border);
    font-size:      12px;
    font-weight:    700;
    color:          var(--aff-text-muted);
}

.aff-footer-tiny {
    font-size:      10px;
    margin-top:     4px;
    opacity:        0.7;
}


/* ═══════ TOAST ═══════ */
.aff-toast {
    position:       fixed;
    top:            70px;
    left:           50%;
    transform:      translateX(-50%) translateY(-100px);
    background:     var(--aff-text);
    color:          white;
    padding:        14px 20px;
    border-radius:  12px;
    font-size:      14px;
    font-weight:    700;
    box-shadow:     0 10px 30px rgba(0, 0, 0, 0.3);
    z-index:        9999;
    max-width:      90vw;
    display:        flex;
    align-items:    center;
    gap:            10px;
    transition:     transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aff-toast.show {
    transform:      translateX(-50%) translateY(0);
}


/* ═══════ MODAL ═══════ */
.aff-modal {
    position:       fixed;
    inset:          0;
    background:     rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index:        10000;
    display:        flex;
    align-items:    center;
    justify-content: center;
    padding:        16px;
    animation:      fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.aff-modal-content {
    background:     white;
    border-radius:  var(--aff-radius);
    padding:        24px;
    max-width:      500px;
    width:          100%;
    max-height:     90vh;
    overflow-y:     auto;
    position:       relative;
    animation:      slideUp 0.3s ease-out;
}

.aff-modal-close {
    position:       absolute;
    top:            12px;
    right:          12px;
    background:     #f3f4f6;
    border:         none;
    width:          32px;
    height:         32px;
    border-radius:  50%;
    cursor:         pointer;
    font-size:      16px;
    font-weight:    900;
    color:          var(--aff-text);
    display:        flex;
    align-items:    center;
    justify-content: center;
}

.aff-modal-title {
    font-size:      20px;
    font-weight:    900;
    color:          var(--aff-text);
    margin-bottom:  10px;
    padding-right:  40px;
}

.aff-modal-text {
    font-size:      14px;
    color:          var(--aff-text-muted);
    line-height:    1.5;
    margin-bottom:  16px;
    font-weight:    600;
}

.aff-modal-body {
    font-size:      13px;
    color:          var(--aff-text);
    line-height:    1.6;
    margin-bottom:  16px;
}

.aff-modal-body h3 {
    font-size:      15px;
    font-weight:    900;
    color:          var(--aff-primary-dark);
    margin-top:     16px;
    margin-bottom:  6px;
}

.aff-modal-body h3:first-child {
    margin-top:     0;
}

.aff-modal-body p {
    margin-bottom:  10px;
    font-weight:    500;
}


/* ═══════════════════════════════════════════════════════════════
   🆕 OPTION C: UPGRADE MODAL
   ═══════════════════════════════════════════════════════════════ */
.aff-upgrade-modal {
    background:     linear-gradient(180deg, #ffffff 0%, #faf7ff 100%);
    border:         3px solid var(--aff-primary);
    text-align:     center;
}

.aff-upgrade-icon {
    font-size:      64px;
    text-align:     center;
    margin-bottom:  10px;
    animation:      bounce 1s ease-in-out;
}

.aff-upgrade-title {
    font-size:      24px;
    font-weight:    900;
    color:          var(--aff-primary-dark);
    margin-bottom:  10px;
    text-align:     center;
}

.aff-upgrade-text {
    font-size:      14px;
    color:          var(--aff-text);
    line-height:    1.6;
    margin-bottom:  16px;
    text-align:     center;
    font-weight:    600;
}

.aff-upgrade-benefits {
    display:        flex;
    justify-content: space-around;
    gap:            8px;
    margin-bottom:  20px;
    padding:        14px 10px;
    background:     #f3eaff;
    border-radius:  12px;
    border:         1.5px solid var(--aff-primary);
}

.aff-upgrade-benefit {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            4px;
    flex:           1;
    text-align:     center;
}

.aff-upgrade-benefit-icon {
    font-size:      26px;
    line-height:    1;
}

.aff-upgrade-benefit > span:nth-child(2) {
    font-size:      11px;
    font-weight:    800;
    color:          var(--aff-primary-dark);
    line-height:    1.2;
}


/* ═══════════════════════════════════════════════════════════════
   📊 DASHBOARD STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Loading screen */
.aff-loading-screen {
    position:       fixed;
    inset:          0;
    display:        flex;
    flex-direction: column;
    align-items:    center;
    justify-content: center;
    background:     linear-gradient(135deg, var(--aff-bg-1) 0%, var(--aff-bg-2) 50%, #fff3e0 100%);
    z-index:        9999;
}

.aff-loading-spinner {
    width:          50px;
    height:         50px;
    border:         5px solid rgba(124, 77, 255, 0.2);
    border-top-color: var(--aff-primary);
    border-radius:  50%;
    animation:      spin 0.8s linear infinite;
    margin-bottom:  16px;
}

.aff-loading-text {
    font-size:      14px;
    font-weight:    700;
    color:          var(--aff-primary-dark);
}


/* Dashboard wrapper */
.aff-dashboard {
    min-height:     100vh;
    display:        flex;
    flex-direction: column;
}


/* ═══════ NAVBAR ═══════ */
.aff-navbar {
    background:     white;
    border-bottom:  1px solid var(--aff-border);
    box-shadow:     0 2px 12px rgba(0, 0, 0, 0.04);
    position:       sticky;
    top:            0;
    z-index:        100;
}

.aff-navbar-inner {
    max-width:      900px;
    margin:         0 auto;
    padding:        14px 20px;
    display:        flex;
    align-items:    center;
    justify-content: space-between;
    gap:            10px;
}

.aff-navbar-brand {
    display:        flex;
    align-items:    center;
    gap:            10px;
}

.aff-navbar-logo {
    font-size:      28px;
    line-height:    1;
}

.aff-navbar-title {
    font-size:      17px;
    font-weight:    900;
    color:          var(--aff-primary-dark);
    letter-spacing: -0.3px;
}

.aff-navbar-right {
    display:        flex;
    align-items:    center;
    gap:            8px;
}

/* Lang button (navbar version — smaller, inline) */
.aff-lang-btn-nav {
    background:     #faf7ff;
    border:         1.5px solid var(--aff-primary);
    color:          var(--aff-primary-dark);
    padding:        7px 12px;
    border-radius:  20px;
    font-family:    var(--aff-font);
    font-size:      12px;
    font-weight:    900;
    cursor:         pointer;
    display:        flex;
    align-items:    center;
    gap:            5px;
    transition:     all 0.2s ease;
}

.aff-lang-btn-nav:hover {
    background:     var(--aff-primary);
    color:          white;
}

.aff-logout-btn {
    background:     transparent;
    border:         1.5px solid var(--aff-danger);
    color:          var(--aff-danger);
    padding:        7px 14px;
    border-radius:  20px;
    font-family:    var(--aff-font);
    font-size:      12px;
    font-weight:    900;
    cursor:         pointer;
    transition:     all 0.2s ease;
}

.aff-logout-btn:hover {
    background:     var(--aff-danger);
    color:          white;
}


/* ═══════ MAIN ═══════ */
.aff-main {
    max-width:      900px;
    margin:         0 auto;
    padding:        24px 20px;
    flex:           1;
    width:          100%;
    box-sizing:     border-box;
}


/* ═══════ UPGRADE WELCOME BANNER (?welcome=upgrade) ═══════ */
.aff-upgrade-banner {
    background:     linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border:         2px solid var(--aff-warning);
    border-radius:  14px;
    padding:        16px 20px;
    margin-bottom:  20px;
    display:        flex;
    align-items:    center;
    gap:            14px;
    animation:      slideUp 0.5s ease-out;
    position:       relative;
}

.aff-upgrade-banner-icon {
    font-size:      40px;
    line-height:    1;
    animation:      bounce 2s ease-in-out infinite;
}

.aff-upgrade-banner-content {
    flex:           1;
}

.aff-upgrade-banner-title {
    font-size:      16px;
    font-weight:    900;
    color:          var(--aff-warning-dark);
    margin-bottom:  4px;
}

.aff-upgrade-banner-text {
    font-size:      13px;
    color:          var(--aff-text);
    font-weight:    600;
    line-height:    1.4;
}

.aff-upgrade-banner-close {
    background:     none;
    border:         none;
    font-size:      18px;
    color:          var(--aff-warning-dark);
    cursor:         pointer;
    padding:        4px 8px;
    line-height:    1;
}


/* ═══════ GREETING ═══════ */
.aff-greeting {
    margin-bottom:  20px;
}

.aff-greeting-title {
    font-size:      24px;
    font-weight:    900;
    color:          var(--aff-text);
    margin-bottom:  4px;
    letter-spacing: -0.5px;
}

.aff-greeting-sub {
    font-size:      14px;
    color:          var(--aff-text-muted);
    font-weight:    600;
}


/* ═══════ COUPON CARD ═══════ */
.aff-coupon-card {
    background:     linear-gradient(135deg, var(--aff-primary) 0%, var(--aff-primary-dark) 100%);
    color:          white;
    border-radius:  18px;
    padding:        24px 22px;
    margin-bottom:  24px;
    box-shadow:     0 10px 30px rgba(124, 77, 255, 0.35);
    position:       relative;
    overflow:       hidden;
}

.aff-coupon-card::before {
    content:    '';
    position:   absolute;
    top:        -50%;
    right:      -50%;
    width:      300px;
    height:     300px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 50%);
    animation:  pulse 5s ease-in-out infinite;
}

.aff-coupon-label {
    font-size:      13px;
    font-weight:    800;
    opacity:        0.9;
    letter-spacing: 0.5px;
    margin-bottom:  12px;
    position:       relative;
}

.aff-coupon-display {
    background:     rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border:         2px dashed rgba(255, 255, 255, 0.5);
    border-radius:  12px;
    padding:        16px;
    margin-bottom:  12px;
    display:        flex;
    align-items:    center;
    justify-content: space-between;
    gap:            12px;
    position:       relative;
}

.aff-coupon-code {
    font-size:      28px;
    font-weight:    900;
    letter-spacing: 4px;
    font-family:    'Courier New', monospace;
    color:          white;
    flex:           1;
    word-break:     break-all;
}

.aff-coupon-pending {
    font-size:      18px !important;
    letter-spacing: 1px !important;
    opacity:        0.7;
    animation:      pulse 1.5s ease-in-out infinite;
    color:          #fff8e1 !important;
}

.aff-copy-btn {
    background:     white;
    color:          var(--aff-primary-dark);
    border:         none;
    padding:        8px 14px;
    border-radius:  20px;
    font-family:    var(--aff-font);
    font-size:      12px;
    font-weight:    900;
    cursor:         pointer;
    display:        flex;
    align-items:    center;
    gap:            5px;
    transition:     all 0.2s ease;
    flex-shrink:    0;
}

.aff-copy-btn:hover {
    transform:      translateY(-1px);
    box-shadow:     0 4px 12px rgba(0, 0, 0, 0.2);
}

.aff-coupon-hint {
    font-size:      12px;
    opacity:        0.95;
    line-height:    1.5;
    margin-bottom:  16px;
    position:       relative;
    font-weight:    600;
}


/* Share buttons */
.aff-share-row {
    display:        flex;
    gap:            10px;
    position:       relative;
}

.aff-share-btn {
    flex:           1;
    background:     rgba(255, 255, 255, 0.15);
    border:         1.5px solid rgba(255, 255, 255, 0.3);
    color:          white;
    padding:        10px 12px;
    border-radius:  10px;
    font-family:    var(--aff-font);
    font-size:      13px;
    font-weight:    800;
    cursor:         pointer;
    display:        flex;
    align-items:    center;
    justify-content: center;
    gap:            6px;
    transition:     all 0.2s ease;
}

.aff-share-btn:hover {
    background:     rgba(255, 255, 255, 0.25);
    transform:      translateY(-1px);
}

.aff-share-wa:hover {
    background:     #25D366;
    border-color:   #25D366;
}


/* ═══════ STATS GRID ═══════ */
.aff-stats-grid {
    display:        grid;
    grid-template-columns: repeat(2, 1fr);
    gap:            12px;
    margin-bottom:  24px;
}

.aff-stat-card {
    background:     white;
    border-radius:  14px;
    padding:        18px 16px;
    box-shadow:     0 4px 14px rgba(0, 0, 0, 0.06);
    border:         1.5px solid var(--aff-border);
    text-align:     center;
    transition:     all 0.2s ease;
}

.aff-stat-card:hover {
    transform:      translateY(-2px);
    box-shadow:     0 8px 22px rgba(124, 77, 255, 0.15);
    border-color:   var(--aff-primary);
}

.aff-stat-icon {
    font-size:      28px;
    margin-bottom:  4px;
    line-height:    1;
}

.aff-stat-value {
    font-size:      26px;
    font-weight:    900;
    color:          var(--aff-text);
    margin-bottom:  2px;
    letter-spacing: -0.5px;
}

.aff-stat-label {
    font-size:      11px;
    font-weight:    700;
    color:          var(--aff-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aff-stat-money .aff-stat-value {
    color:          var(--aff-success-dark);
}

.aff-stat-balance {
    background:     linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-color:   var(--aff-warning);
}

.aff-stat-balance .aff-stat-value {
    color:          var(--aff-warning-dark);
}


/* ═══════ ACTION BUTTONS ═══════ */
.aff-action-row {
    display:        flex;
    gap:            10px;
    margin-bottom:  28px;
}

.aff-action-btn {
    flex:           1;
    background:     white;
    border:         2px solid var(--aff-border);
    color:          var(--aff-text);
    padding:        14px 16px;
    border-radius:  12px;
    font-family:    var(--aff-font);
    font-size:      14px;
    font-weight:    800;
    cursor:         pointer;
    display:        flex;
    align-items:    center;
    justify-content: center;
    gap:            8px;
    transition:     all 0.2s ease;
}

.aff-action-btn:hover {
    border-color:   var(--aff-primary);
    color:          var(--aff-primary-dark);
    transform:      translateY(-1px);
    box-shadow:     0 4px 14px rgba(124, 77, 255, 0.15);
}

.aff-action-money {
    background:     linear-gradient(135deg, var(--aff-success) 0%, var(--aff-success-dark) 100%);
    color:          white;
    border-color:   var(--aff-success-dark);
}

.aff-action-money:hover {
    color:          white;
    border-color:   var(--aff-success-dark);
    transform:      translateY(-2px);
    box-shadow:     0 6px 18px rgba(76, 175, 80, 0.4);
}


/* ═══════ REFERRALS SECTION ═══════ */
.aff-referrals-section {
    background:     white;
    border-radius:  16px;
    padding:        20px;
    box-shadow:     0 4px 14px rgba(0, 0, 0, 0.06);
    margin-bottom:  20px;
}

.aff-section-header {
    display:        flex;
    justify-content: space-between;
    align-items:    center;
    margin-bottom:  16px;
    padding-bottom: 12px;
    border-bottom:  2px solid var(--aff-border);
}

.aff-section-title {
    font-size:      17px;
    font-weight:    900;
    color:          var(--aff-text);
}

.aff-section-count {
    background:     var(--aff-primary);
    color:          white;
    padding:        4px 12px;
    border-radius:  20px;
    font-size:      13px;
    font-weight:    900;
    min-width:      30px;
    text-align:     center;
}

.aff-empty-state {
    text-align:     center;
    padding:        30px 20px;
}

.aff-empty-icon {
    font-size:      52px;
    margin-bottom:  12px;
    opacity:        0.7;
}

.aff-empty-title {
    font-size:      16px;
    font-weight:    900;
    color:          var(--aff-text);
    margin-bottom:  6px;
}

.aff-empty-text {
    font-size:      13px;
    color:          var(--aff-text-muted);
    font-weight:    600;
}


/* Referral list (Phase 3) */
.aff-referrals-list {
    display:        flex;
    flex-direction: column;
    gap:            10px;
}


/* ═══════ DASHBOARD FOOTER ═══════ */
.aff-dashboard-footer {
    text-align:     center;
    padding:        20px;
    background:     transparent;
    font-size:      12px;
    font-weight:    700;
    color:          var(--aff-text-muted);
    margin-top:     auto;
}


/* ═══════ COUPON PENDING TOOLTIP ═══════ */
.aff-pending-tooltip {
    position:       fixed;
    bottom:         20px;
    left:           50%;
    transform:      translateX(-50%);
    background:     var(--aff-warning);
    color:          white;
    padding:        10px 16px;
    border-radius:  20px;
    font-size:      12px;
    font-weight:    800;
    box-shadow:     0 6px 18px rgba(255, 167, 38, 0.4);
    z-index:        99;
    animation:      slideUp 0.3s ease-out;
}


/* ═══════ UTILITY ═══════ */
.hidden {
    display:        none !important;
}


/* ═══════ MOBILE RESPONSIVE ═══════ */
@media (max-width: 480px) {
    .aff-card {
        margin:         12px 0;
        margin-top:     60px;
        border-radius:  12px;
    }
    .aff-header {
        padding:        24px 20px 22px;
    }
    .aff-title {
        font-size:      21px;
    }
    .aff-form {
        padding:        20px;
    }
    .aff-badges {
        padding:        12px 16px;
    }
    .aff-badge-text {
        font-size:      9px;
    }
    .aff-lang-btn {
        top:            12px;
        right:          12px;
        padding:        6px 12px;
        font-size:      12px;
    }
    .aff-login-options {
        flex-direction: column;
        align-items:    flex-start;
        gap:            8px;
    }

    /* Dashboard mobile tweaks */
    .aff-navbar-title {
        font-size:      14px;
    }
    .aff-navbar-logo {
        font-size:      24px;
    }
    .aff-greeting-title {
        font-size:      20px;
    }
    .aff-coupon-code {
        font-size:      22px;
        letter-spacing: 2px;
    }
    .aff-stats-grid {
        gap:            10px;
    }
    .aff-stat-value {
        font-size:      22px;
    }
    .aff-stat-icon {
        font-size:      24px;
    }
    .aff-upgrade-banner {
        padding:        14px;
        gap:            10px;
    }
    .aff-upgrade-banner-icon {
        font-size:      32px;
    }
    .aff-upgrade-benefits {
        flex-direction: column;
        gap:            12px;
    }
    .aff-upgrade-benefit {
        flex-direction: row;
        justify-content: flex-start;
        gap:            10px;
    }
    .aff-upgrade-benefit > span:nth-child(2) {
        font-size:      13px;
    }
}


/* ═══════ DARK SCROLLBAR ═══════ */
.aff-modal-content::-webkit-scrollbar {
    width:          6px;
}
.aff-modal-content::-webkit-scrollbar-thumb {
    background:     var(--aff-primary);
    border-radius:  3px;
}


/* ═══════════════════════════════════════════════════════════════
   🛒 CHECKOUT PAGE STYLES (Day 5)
   ═══════════════════════════════════════════════════════════════ */

/* Course display card */
.checkout-course-card {
    display:        flex;
    gap:            14px;
    padding:        18px 24px;
    background:     #faf7ff;
    border-bottom:  1px solid var(--aff-border);
    align-items:    flex-start;
}

.checkout-course-icon {
    font-size:      40px;
    line-height:    1;
    flex-shrink:    0;
}

.checkout-course-details {
    flex:           1;
    min-width:      0;
}

.checkout-course-name {
    font-size:      17px;
    font-weight:    900;
    color:          var(--aff-text);
    margin-bottom:  4px;
}

.checkout-course-tagline {
    font-size:      13px;
    color:          var(--aff-text-muted);
    font-weight:    600;
    line-height:    1.4;
    margin-bottom:  10px;
}

.checkout-course-features {
    display:        flex;
    flex-wrap:      wrap;
    gap:            6px 12px;
}

.checkout-feature {
    font-size:      12px;
    font-weight:    700;
    color:          var(--aff-success-dark);
}


/* Coupon code input row */
.checkout-coupon-wrap {
    display:        flex;
    gap:            8px;
}

.checkout-coupon-input {
    flex:           1;
    text-transform: uppercase;
    font-family:    'Courier New', monospace;
    font-weight:    900;
    letter-spacing: 1.5px;
}

.checkout-coupon-btn {
    padding:        12px 18px;
    background:     var(--aff-primary);
    color:          white;
    border:         none;
    border-radius:  10px;
    font-family:    var(--aff-font);
    font-size:      14px;
    font-weight:    900;
    cursor:         pointer;
    flex-shrink:    0;
    min-width:      80px;
    display:        flex;
    align-items:    center;
    justify-content: center;
    transition:     all 0.2s ease;
}

.checkout-coupon-btn:hover:not(:disabled) {
    background:     var(--aff-primary-dark);
    transform:      translateY(-1px);
}

.checkout-coupon-btn:disabled {
    opacity:        0.7;
    cursor:         wait;
}


/* Coupon success row */
.checkout-coupon-success {
    margin-top:     10px;
    padding:        10px 14px;
    background:     #e8f5e9;
    border:         1.5px solid var(--aff-success);
    border-radius:  10px;
    display:        flex;
    align-items:    center;
    gap:            10px;
    font-size:      13px;
    color:          var(--aff-success-dark);
    font-weight:    700;
    animation:      slideUp 0.3s ease-out;
}

.checkout-coupon-success-icon {
    font-size:      18px;
}

.checkout-coupon-success > span:nth-child(2) {
    flex:           1;
}

.checkout-coupon-remove {
    background:     none;
    border:         none;
    color:          var(--aff-danger);
    cursor:         pointer;
    font-size:      16px;
    font-weight:    900;
    padding:        2px 8px;
    border-radius:  50%;
    transition:     background 0.2s ease;
}

.checkout-coupon-remove:hover {
    background:     #fee;
}


/* Price breakdown */
.checkout-price-section {
    padding:        18px 24px;
    background:     #fafafa;
    border-top:     1px solid var(--aff-border);
    border-bottom:  1px solid var(--aff-border);
}

.checkout-price-row {
    display:        flex;
    justify-content: space-between;
    align-items:    center;
    margin-bottom:  8px;
    font-size:      14px;
    color:          var(--aff-text);
    font-weight:    600;
}

.checkout-price-row:last-child {
    margin-bottom:  0;
}

.checkout-price-divider {
    height:         1px;
    background:     var(--aff-border);
    margin:         10px 0;
}

.checkout-price-total {
    font-size:      18px !important;
    font-weight:    900 !important;
    color:          var(--aff-primary-dark) !important;
}

.checkout-price-total > span:last-child {
    color:          var(--aff-success-dark);
    font-size:      22px;
}


/* Pay button */
.checkout-pay-btn {
    background:     linear-gradient(135deg, var(--aff-success) 0%, var(--aff-success-dark) 100%) !important;
    box-shadow:     0 6px 20px rgba(76, 175, 80, 0.4) !important;
    font-size:      17px !important;
    min-height:     56px !important;
}

.checkout-pay-btn:hover:not(:disabled) {
    box-shadow:     0 10px 28px rgba(76, 175, 80, 0.5) !important;
}


/* Trust row */
.checkout-trust-row {
    text-align:     center;
    margin-top:     12px;
    font-size:      12px;
    color:          var(--aff-text-muted);
    font-weight:    600;
    display:        flex;
    align-items:    center;
    justify-content: center;
    gap:            6px;
}

.checkout-trust-icon {
    font-size:      14px;
}


/* Test mode notice */
.checkout-test-notice {
    margin-top:     12px;
    padding:        10px 12px;
    background:     #fff8e1;
    border:         1.5px dashed var(--aff-warning);
    border-radius:  8px;
    font-size:      12px;
    color:          var(--aff-warning-dark);
    font-weight:    700;
    text-align:     center;
    line-height:    1.4;
}


/* Receipt (success screen) */
.checkout-receipt {
    background:     #f9fafb;
    border-radius:  10px;
    padding:        14px 18px;
    margin-bottom:  20px;
    text-align:     left;
}

.checkout-receipt-row {
    display:        flex;
    justify-content: space-between;
    align-items:    center;
    margin-bottom:  6px;
    font-size:      13px;
    color:          var(--aff-text);
    font-weight:    600;
}

.checkout-receipt-row:last-child {
    margin-bottom:  0;
}


/* Mobile responsive */
@media (max-width: 480px) {
    .checkout-course-card {
        padding:        14px 16px;
        gap:            10px;
    }
    .checkout-course-icon {
        font-size:      32px;
    }
    .checkout-course-name {
        font-size:      15px;
    }
    .checkout-course-tagline {
        font-size:      12px;
    }
    .checkout-coupon-input {
        letter-spacing: 1px;
    }
    .checkout-price-section {
        padding:        14px 16px;
    }
    .checkout-price-total {
        font-size:      16px !important;
    }
    .checkout-price-total > span:last-child {
        font-size:      20px;
    }
}


/* ═══════ ACCESSIBILITY ═══════ */
@media (prefers-reduced-motion: reduce) {
    .aff-card,
    .aff-success,
    .aff-warning,
    .aff-success-icon,
    .aff-warning-icon,
    .aff-modal,
    .aff-modal-content,
    .aff-toast,
    .aff-header::before,
    .aff-lang-btn,
    .aff-loading-spinner,
    .aff-coupon-card::before,
    .aff-upgrade-banner-icon,
    .aff-upgrade-icon,
    .aff-coupon-pending {
        animation:      none !important;
        transition:     opacity 0.2s ease !important;
    }
}
