/* * MailAI — Referral & Affiliate Styles
 * Location: style/referral.css
 */

:root {
    --brand-navy: #0f172a;
    --brand-indigo: #3730a3;
    --brand-blue: #2563eb;
    --money-green: #10b981;
    --money-green-dark: #059669;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.03);
    --shadow-lg: 0 15px 35px rgba(15, 23, 42, 0.15);
}

.dash-wrap { max-width: 1100px; margin: 0 auto; padding: 25px 15px 60px; }
.ref-wrapper { font-family: 'Inter', -apple-system, sans-serif; }

/* ── HERO SECTION ── */
.ref-hero {
    background: linear-gradient(135deg, var(--brand-navy), #1e3a8a, var(--brand-indigo));
    border-radius: 24px; padding: 50px 30px; color: #fff; position: relative;
    overflow: hidden; text-align: center; margin-bottom: 35px;
    box-shadow: var(--shadow-lg);
}
.ref-hero::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    animation: rotateBg 30s linear infinite; pointer-events: none;
}
@keyframes rotateBg { 100% { transform: rotate(360deg); } }

.hero-badge {
    background: rgba(16, 185, 129, 0.2); border: 1px solid rgba(16, 185, 129, 0.4);
    color: #a7f3d0; padding: 8px 20px; border-radius: 30px; font-size: 13px; font-weight: 800;
    letter-spacing: 0.5px; text-transform: uppercase; display: inline-block; margin-bottom: 20px;
    backdrop-filter: blur(4px);
}
.ref-hero h1 { font-size: clamp(24px, 5vw, 40px); font-weight: 900; margin: 0 0 16px; line-height: 1.2; letter-spacing: -1px; }
.ref-hero h1 span { color: var(--money-green); }
.ref-hero p { font-size: 18px; color: #e2e8f0; margin: 0 auto 30px; max-width: 650px; line-height: 1.6; }

/* ── SHARE BOX ── */
.share-box {
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px; padding: 20px; max-width: 600px; margin: 0 auto; backdrop-filter: blur(10px);
}
.share-label { font-size: 12px; font-weight: 800; text-transform: uppercase; color: #93c5fd; margin-bottom: 12px; display: block; letter-spacing: 1px; }
.share-actions { display: flex; gap: 12px; }
.code-display {
    flex: 1; background: #fff; border-radius: 12px; padding: 14px 18px; font-family: 'JetBrains Mono', monospace;
    font-size: 16px; font-weight: 700; color: var(--brand-navy); display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff; word-break: break-all;
}
.btn-copy {
    background: var(--money-green); color: #fff; border: none; padding: 0 28px; border-radius: 12px;
    font-size: 15px; font-weight: 800; cursor: pointer; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap;
}
.btn-copy:hover { background: var(--money-green-dark); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4); }

/* ── STATS & ACTION GRID ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 35px; }
.stat-card {
    background: #fff; border: 1px solid var(--border-color); border-radius: 20px; padding: 24px;
    display: flex; align-items: center; gap: 20px; transition: 0.3s; box-shadow: var(--shadow-sm);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0,0,0,0.06); border-color: #cbd5e1; }
.stat-icon { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.icon-blue { background: #eff6ff; color: var(--brand-blue); }
.icon-green { background: #f0fdf4; color: var(--money-green); }
.icon-purple { background: #faf5ff; color: #a855f7; }

.stat-info h3 { font-size: 13px; font-weight: 800; color: var(--text-muted); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-info .stat-val { font-size: 30px; font-weight: 900; color: var(--text-main); line-height: 1; }
.stat-info .cr-unit { font-size: 14px; color: var(--text-muted); font-weight: 700; margin-left: 2px; }

/* ── ACTION CARD (Withdraw / Plan) ── */
.action-card { flex-direction: column; justify-content: center; gap: 12px; padding: 20px; align-items: stretch; background: var(--bg-light); border: 2px dashed #cbd5e1; }
.btn-act { border: none; padding: 14px; border-radius: 12px; font-size: 14px; font-weight: 800; cursor: pointer; transition: 0.2s; text-align: center; width: 100%; display: block; }
.btn-act-withdraw { background: var(--money-green); color: #fff; }
.btn-act-withdraw:hover { background: var(--money-green-dark); }
.btn-act-plan { background: var(--brand-indigo); color: #fff; }
.btn-act-plan:hover { background: #312e81; }

/* ── CONTENT SECTIONS ── */
.section-card { background: #fff; border: 1px solid var(--border-color); border-radius: 20px; padding: 35px; margin-bottom: 35px; box-shadow: var(--shadow-sm); }
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; }
.sec-head h2 { font-size: 24px; font-weight: 800; color: var(--text-main); margin: 0; letter-spacing: -0.5px; }
.sec-icon { background: var(--bg-light); width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; border: 1px solid var(--border-color); }

.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.step-item { text-align: center; padding: 30px 20px; background: var(--bg-light); border-radius: 20px; border: 1px solid var(--border-color); position: relative; }
.step-num {
    position: absolute; top: -18px; left: 50%; transform: translateX(-50%); width: 36px; height: 36px;
    background: var(--brand-blue); color: #fff; font-size: 16px; font-weight: 900; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; border: 4px solid #fff; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}
.step-item h4 { font-size: 18px; font-weight: 800; color: var(--text-main); margin: 18px 0 12px; }
.step-item p { font-size: 15px; color: #475569; margin: 0; line-height: 1.6; }
.text-highlight { color: var(--money-green); font-weight: 800; }

/* ── BENEFITS GRID ── */
.benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.benefit-box { background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 18px; padding: 25px; display: flex; gap: 20px; align-items: flex-start; }
.benefit-icon { font-size: 26px; line-height: 1; flex-shrink: 0; background: #fff; padding: 12px; border-radius: 14px; box-shadow: 0 4px 10px rgba(0,0,0,0.04); }
.benefit-text strong { display: block; font-size: 17px; color: var(--text-main); font-weight: 800; margin-bottom: 8px; }
.benefit-text span { display: block; font-size: 14px; color: #475569; line-height: 1.7; }

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: 1px solid var(--border-color); border-radius: 14px; overflow: hidden; transition: 0.2s; }
.faq-q { width: 100%; background: #fff; border: none; text-align: left; padding: 20px 24px; font-size: 16px; font-weight: 700; color: var(--text-main); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.faq-q:hover { background: var(--bg-light); color: var(--brand-blue); }
.faq-arrow { font-size: 12px; color: #94a3b8; transition: 0.3s; }
.faq-a { display: none; padding: 0 24px 20px; font-size: 15px; color: #475569; line-height: 1.75; background: #fff; }
.faq-item.open { border-color: var(--brand-blue); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08); }
.faq-item.open .faq-arrow { transform: rotate(180deg); color: var(--brand-blue); }
.faq-item.open .faq-a { display: block; }

/* ── MODALS ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.8); z-index: 10000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(8px); padding: 20px; }
.modal-overlay.show { display: flex; animation: fadeIn 0.2s ease-out; }
.modal-content { background: #fff; border-radius: 28px; padding: 40px; width: 100%; max-width: 480px; box-shadow: 0 25px 70px rgba(0,0,0,0.3); animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.modal-content h2 { font-size: 26px; font-weight: 900; color: var(--text-main); margin: 0 0 10px; }
.modal-content p.mod-desc { font-size: 15px; color: var(--text-muted); margin: 0 0 28px; line-height: 1.6; }
.modal-field { margin-bottom: 20px; }
.modal-field label { display: block; font-size: 13px; font-weight: 800; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.modal-field input, .modal-field select { width: 100%; padding: 16px; border: 2px solid var(--border-color); border-radius: 14px; font-size: 16px; font-family: inherit; outline: none; font-weight: 600; color: var(--text-main); background: #fff; transition: 0.2s; }
.modal-field input:focus, .modal-field select:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); }
.modal-field small { display: block; margin-top: 8px; font-size: 14px; }

.modal-actions { display: flex; gap: 15px; margin-top: 30px; }
.btn-modal { flex: 1; padding: 16px; border: none; border-radius: 14px; font-size: 16px; font-weight: 800; cursor: pointer; transition: 0.2s; }
.btn-modal-cancel { background: var(--bg-light); color: #475569; border: 1px solid var(--border-color); }
.btn-modal-cancel:hover { background: #e2e8f0; color: var(--text-main); }
.btn-modal-submit { background: var(--brand-navy); color: #fff; flex: 1.5; }
.btn-modal-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-modal-submit:disabled { background: #cbd5e1; cursor: not-allowed; transform: none; }

/* ── UTILITIES ── */
.toast { position: fixed; bottom: 30px; right: 30px; background: var(--brand-navy); color: #fff; padding: 16px 28px; border-radius: 16px; font-size: 15px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,0.2); transform: translateY(120px); opacity: 0; transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 10001; }
.toast.show { transform: translateY(0); opacity: 1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── MOBILE RESPONSIVENESS ── */
@media (max-width: 640px) {
    .share-actions { flex-direction: column; }
    .btn-copy { padding: 16px; }
    .ref-hero { padding: 40px 20px; border-radius: 20px; }
    .ref-hero h1 { font-size: 30px; }
    .stats-grid { grid-template-columns: 1fr; }
    .section-card { padding: 25px 20px; }
    .benefit-box { flex-direction: column; text-align: center; align-items: center; }
    .modal-content { padding: 30px 20px; }
}