/*
Theme Name: Mi9 Affiliate Theme
Theme URI: https://miniai.vn
Author: MI9
Author URI: https://miniai.vn
Description: Theme for Mi9 Affiliate
Version: 1.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.0
Text Domain: mi9-affiliate
*/

:root {
    --gold: #C9A84C;
    --gold-light: #F0CB6E;
    --gold-pale: #F5E6B8;
    --navy: #0A0E1A;
    --navy-mid: #111827;
    --navy-light: #1C2434;
    --navy-card: #161D2E;
    --text-primary: #F4EED8;
    --text-muted: #8E97AC;
    --accent-blue: #2762EC;
    --white: #FFFFFF;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--navy);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
  }

  /* ─── NOISE OVERLAY ─── */
  body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 9999; opacity: 0.4;
  }

  /* ─── NAV ─── */
  nav {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 48px;
    background: rgba(10,14,26,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(201,168,76,0.1);
  }
  .nav-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem; font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.05em;
    text-decoration: none;
  }
  .nav-logo span { color: var(--text-primary); }
  .nav-cta {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy);
    font-weight: 600; font-size: 0.85rem;
    padding: 10px 24px; border-radius: 4px;
    text-decoration: none; letter-spacing: 0.05em;
    transition: all 0.3s;
  }
  .nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(201,168,76,0.4); }

  /* ─── HERO ─── */
  .hero {
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    position: relative; overflow: hidden;
  }

  .hero-bg {
    position: absolute; inset: 0;
    background: 
      radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201,168,76,0.08) 0%, transparent 70%),
      radial-gradient(ellipse 60% 40% at 80% 80%, rgba(39,98,236,0.06) 0%, transparent 60%),
      linear-gradient(180deg, #0A0E1A 0%, #0D1220 100%);
  }
  .hero-lines {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  }
  .hero-lines::before, .hero-lines::after {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    border: 1px solid rgba(201,168,76,0.08);
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
  }
  .hero-lines::after { width: 900px; height: 900px; }

  .hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 100px;
    padding: 6px 16px; margin-bottom: 32px;
    font-size: 0.78rem; font-weight: 500;
    color: var(--gold-light); letter-spacing: 0.1em; text-transform: uppercase;
    animation: fadeDown 0.8s ease both;
  }
  .hero-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: block; }

  .hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 700; line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    animation: fadeDown 0.8s 0.1s ease both;
  }
  .hero h1 em {
    font-style: italic;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, #FFF3C0 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }
  .hero-sub {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--text-muted); font-weight: 400;
    margin-bottom: 48px; max-width: 600px;
    animation: fadeDown 0.8s 0.2s ease both;
  }
  .hero-stats {
    display: flex; gap: 48px; margin-bottom: 56px;
    animation: fadeDown 0.8s 0.3s ease both;
  }
  .stat { text-align: center; }
  .stat-num {
    font-family: 'Space Mono', monospace;
    font-size: 2.2rem; font-weight: 700;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    line-height: 1;
  }
  .stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; letter-spacing: 0.05em; }

  .hero-btns {
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
    animation: fadeDown 0.8s 0.4s ease both;
  }
  .btn-primary {
    display: inline-flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy);
    font-weight: 700; font-size: 0.95rem;
    padding: 16px 36px; border-radius: 4px;
    text-decoration: none; letter-spacing: 0.03em;
    transition: all 0.3s; box-shadow: 0 4px 30px rgba(201,168,76,0.25);
  }
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(201,168,76,0.45); }
  .btn-secondary {
    display: inline-flex; align-items: center; gap: 10px;
    background: transparent;
    border: 1px solid rgba(201,168,76,0.3);
    color: var(--gold-pale);
    font-weight: 500; font-size: 0.95rem;
    padding: 16px 32px; border-radius: 4px;
    text-decoration: none; letter-spacing: 0.03em;
    transition: all 0.3s;
  }
  .btn-secondary:hover { border-color: var(--gold); background: rgba(201,168,76,0.05); }

  .scroll-hint {
    position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: var(--text-muted); font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase;
    animation: fadeDown 1s 0.8s ease both;
  }
  .scroll-line {
    width: 1px; height: 40px;
    background: linear-gradient(180deg, var(--gold) 0%, transparent 100%);
    animation: scrollLine 2s infinite;
  }

  /* ─── SECTION BASE ─── */
  section { padding: 100px 24px; }
  .container { max-width: 1100px; margin: 0 auto; }
  .section-tag {
    display: inline-block;
    font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--gold);
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.2);
    padding: 4px 12px; border-radius: 2px;
    margin-bottom: 20px;
  }
  .section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700; line-height: 1.1;
    margin-bottom: 16px;
  }
  .section-title em {
    font-style: italic; color: var(--gold-light);
  }
  .section-desc {
    color: var(--text-muted); font-size: 1rem; line-height: 1.7;
    max-width: 560px;
  }
  .divider {
    width: 60px; height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    margin: 24px 0;
  }

  /* ─── WHY JOIN ─── */
  .why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px; margin-top: 60px;
  }
  .why-card {
    background: var(--navy-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px; padding: 36px 32px;
    position: relative; overflow: hidden;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  }
  .why-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0; transition: opacity 0.3s;
  }
  .why-card:hover { transform: translateY(-4px); border-color: rgba(201,168,76,0.2); box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
  .why-card:hover::before { opacity: 1; }
  .why-icon {
    width: 52px; height: 52px;
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: 24px;
  }
  .why-card h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem; font-weight: 700;
    margin-bottom: 10px; color: var(--text-primary);
  }
  .why-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.65; }

  /* ─── COMMISSION SPOTLIGHT ─── */
  .commission-section {
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy-mid) 100%);
    border-top: 1px solid rgba(201,168,76,0.08);
    border-bottom: 1px solid rgba(201,168,76,0.08);
  }
  .commission-inner {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 80px; align-items: center;
  }
  .commission-visual {
    position: relative; display: flex; align-items: center; justify-content: center;
  }
  .comm-circle {
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(201,168,76,0.15), rgba(201,168,76,0.03));
    border: 1px solid rgba(201,168,76,0.2);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative;
  }
  .comm-circle::before {
    content: ''; position: absolute;
    inset: -12px; border-radius: 50%;
    border: 1px dashed rgba(201,168,76,0.15);
  }
  .comm-circle::after {
    content: ''; position: absolute;
    inset: -24px; border-radius: 50%;
    border: 1px dashed rgba(201,168,76,0.07);
  }
  .comm-pct {
    font-family: 'Space Mono', monospace;
    font-size: 5rem; font-weight: 700; line-height: 1;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 60%, #FFF3C0 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }
  .comm-label {
    font-size: 0.85rem; color: var(--text-muted);
    letter-spacing: 0.1em; text-transform: uppercase;
    margin-top: 6px;
  }
  .comm-badge {
    position: absolute; top: 10px; right: -20px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--navy); font-size: 0.7rem; font-weight: 700;
    padding: 4px 12px; border-radius: 20px;
    letter-spacing: 0.08em; text-transform: uppercase;
  }
  .policy-list { list-style: none; display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }
  .policy-item {
    display: flex; align-items: flex-start; gap: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px; padding: 16px 20px;
    transition: border-color 0.3s;
  }
  .policy-item:hover { border-color: rgba(201,168,76,0.2); }
  .policy-icon {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 0.85rem; color: var(--navy); font-weight: 700;
  }
  .policy-text strong { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
  .policy-text span { font-size: 0.82rem; color: var(--text-muted); }

  /* ─── HOW IT WORKS ─── */
  .steps {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0; margin-top: 64px; position: relative;
  }
  .steps::before {
    content: ''; position: absolute;
    top: 32px; left: 12.5%; right: 12.5%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.3), rgba(201,168,76,0.3), rgba(201,168,76,0.3), transparent);
  }
  .step { text-align: center; padding: 0 16px; }
  .step-num {
    width: 64px; height: 64px; border-radius: 50%;
    border: 1px solid rgba(201,168,76,0.3);
    background: var(--navy-card);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem; color: var(--gold);
    margin: 0 auto 24px;
    position: relative; z-index: 1;
    transition: all 0.3s;
  }
  .step:hover .step-num {
    background: rgba(201,168,76,0.1);
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(201,168,76,0.2);
  }
  .step h4 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem; font-weight: 700;
    margin-bottom: 8px;
  }
  .step p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }

  /* ─── WHO SHOULD JOIN ─── */
  .audience-section { background: var(--navy-mid); }
  .persona-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-top: 56px;
  }
  .persona-card {
    background: var(--navy-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px; padding: 28px 24px;
    text-align: center; transition: all 0.3s;
    cursor: default;
  }
  .persona-card:hover {
    border-color: rgba(201,168,76,0.25);
    background: rgba(201,168,76,0.04);
    transform: translateY(-3px);
  }
  .persona-emoji { font-size: 2rem; margin-bottom: 14px; display: block; }
  .persona-card h4 { font-size: 0.88rem; font-weight: 600; line-height: 1.4; }

  /* ─── EARNINGS CALCULATOR ─── */
  .calc-section {
    background: linear-gradient(135deg, #0A0E1A 0%, #0F1525 100%);
    border-top: 1px solid rgba(201,168,76,0.06);
    border-bottom: 1px solid rgba(201,168,76,0.06);
  }
  .calc-box {
    background: var(--navy-card);
    border: 1px solid rgba(201,168,76,0.15);
    border-radius: 12px; padding: 48px;
    max-width: 700px; margin: 48px auto 0;
  }
  .calc-row { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
  .calc-row label { font-size: 0.85rem; color: var(--text-muted); width: 220px; flex-shrink: 0; }
  .calc-row input[type="range"] {
    flex: 1; -webkit-appearance: none;
    height: 4px; border-radius: 2px;
    background: rgba(201,168,76,0.2); outline: none;
    cursor: pointer;
  }
  .calc-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    box-shadow: 0 2px 8px rgba(201,168,76,0.4);
    cursor: pointer;
  }
  .calc-val {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem; color: var(--gold-light);
    width: 90px; text-align: right; flex-shrink: 0;
  }
  .calc-result {
    border-top: 1px solid rgba(201,168,76,0.15);
    padding-top: 28px; display: flex;
    align-items: center; justify-content: space-between;
  }
  .calc-result-label { font-size: 0.85rem; color: var(--text-muted); }
  .calc-result-amount {
    font-family: 'Space Mono', monospace;
    font-size: 2rem; font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }
  .calc-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; text-align: right; }

  /* ─── REGISTER ─── */
  .register-section { text-align: center; }
  .register-inner {
    display: grid; grid-template-columns: 1fr auto 1fr;
    gap: 64px; align-items: center; margin-top: 64px;
  }
  .register-steps { text-align: left; }
  .reg-step {
    display: flex; gap: 16px; align-items: flex-start;
    margin-bottom: 24px;
  }
  .reg-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gold); flex-shrink: 0; margin-top: 6px;
  }
  .reg-step-text strong { font-size: 0.9rem; display: block; margin-bottom: 2px; }
  .reg-step-text span { font-size: 0.82rem; color: var(--text-muted); }
  .register-divider {
    width: 1px; background: linear-gradient(180deg, transparent, rgba(201,168,76,0.3), transparent);
    height: 300px;
  }
  .qr-wrapper {
    display: flex; flex-direction: column; align-items: center; gap: 20px;
  }
  .qr-frame {
    padding: 16px; background: white; border-radius: 12px;
    box-shadow: 0 0 60px rgba(201,168,76,0.15);
    width: 200px; height: 200px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
  }
  .qr-frame img { width: 168px; height: 168px; object-fit: contain; }
  .qr-label { font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.08em; }
  .qr-sub { font-size: 0.7rem; color: rgba(255,255,255,0.3); margin-top: 4px; }

  /* ─── FAQ ─── */
  .faq-section { background: var(--navy-mid); }
  .faq-list { max-width: 720px; margin: 56px auto 0; }
  .faq-item {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
  }
  .faq-q {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 0; cursor: pointer;
    font-size: 0.95rem; font-weight: 500;
    transition: color 0.2s;
  }
  .faq-q:hover { color: var(--gold-light); }
  .faq-icon {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid rgba(201,168,76,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: var(--gold); flex-shrink: 0;
    transition: transform 0.3s, background 0.3s;
  }
  .faq-item.open .faq-icon { transform: rotate(45deg); background: rgba(201,168,76,0.1); }
  .faq-a {
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s;
    font-size: 0.88rem; color: var(--text-muted); line-height: 1.7;
    padding-bottom: 0;
  }
  .faq-item.open .faq-a { max-height: 200px; padding-bottom: 20px; }

  /* ─── CTA FINAL ─── */
  .cta-final {
    text-align: center;
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy) 100%);
    border-top: 1px solid rgba(201,168,76,0.1);
    position: relative; overflow: hidden;
  }
  .cta-final::before {
    content: ''; position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201,168,76,0.07) 0%, transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%,-50%);
  }
  .cta-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700; line-height: 1.1;
    margin-bottom: 20px;
  }
  .cta-title em { font-style: italic; color: var(--gold-light); }

  /* ─── FOOTER ─── */
  footer {
    background: var(--navy);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 32px 24px; text-align: center;
    font-size: 0.8rem; color: var(--text-muted);
  }
  footer a { color: var(--gold); text-decoration: none; }

  /* ─── ANIMATIONS ─── */
  @keyframes fadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes scrollLine {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.5); opacity: 0.3; }
  }

  /* ─── RESPONSIVE ─── */
  @media (max-width: 768px) {
    nav { padding: 16px 20px; }
    .hero-stats { gap: 28px; }
    .commission-inner { grid-template-columns: 1fr; gap: 40px; }
    .steps { grid-template-columns: repeat(2, 1fr); gap: 32px; }
    .steps::before { display: none; }
    .register-inner { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .register-divider { display: none; }
    .register-steps { text-align: center; }
    .reg-step { flex-direction: column; align-items: center; }
    .calc-box { padding: 28px 20px; }
    .calc-row { flex-wrap: wrap; }
    .calc-row label { width: 100%; }
    /* New sections responsive */
    [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; gap: 32px !important; }
  }
