/* Svenn Referral Pages */

/* ── Poppins Font ── */

@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-hover: #ebebef;
  --border: #e0e0e8;
  --border-hover: #c8c8d4;
  --text: #1a1a2e;
  --text-secondary: #4a4a5c;
  --text-muted: #8888a0;
  --primary: #E93D82;
  --primary-hover: #D32D6C;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 8px;
}

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Animated Gradient Canvas ── */

#gradient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ── Header ── */

.app-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Ensure all sections sit above the gradient canvas */
.ref-hero,
.ref-video-section,
.ref-section,
.page-section,
.login-section,
.dashboard-section,
.site-footer {
  position: relative;
  z-index: 1;
}

.app-header .header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-header .logo {
  height: 32px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--text);
}

/* ── Buttons ── */

.btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

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

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Animated Gradient Button ── */

.btn-gradient {
  background: linear-gradient(135deg, #ff8a2b, #E93D82, #a020f0, #ff2da0, #ff8a2b);
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-gradient:hover {
  animation-duration: 2s;
  box-shadow: 0 0 24px rgba(255, 45, 160, 0.4);
}

.btn-gradient:disabled {
  animation: none;
  opacity: 0.6;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Card (shared glass style) ── */

.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card h2 {
  font-size: 1.05rem;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

/* ══════════════════════════════════════
   LANDING PAGE — Hero
   ══════════════════════════════════════ */

.ref-hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 60px;
  text-align: center;
}

.ref-hero-inner {
  max-width: 680px;
}

.ref-hero-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  background: rgba(233, 61, 130, 0.12);
  border: 1px solid rgba(233, 61, 130, 0.25);
  margin-bottom: 24px;
  letter-spacing: 0.3px;
}

.ref-hero h1 {
  font-size: 3rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.ref-hero-sub {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
}

.ref-hero-sub strong {
  color: var(--text);
  font-weight: 500;
}

.ref-hero-cta {
  width: auto;
  padding: 16px 48px;
  font-size: 1.05rem;
}

/* ══════════════════════════════════════
   LANDING PAGE — Video
   ══════════════════════════════════════ */

.ref-video-section {
  padding: 0 24px 60px;
  text-align: center;
}

.ref-video-wrap {
  max-width: 700px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.ref-video-wrap video {
  display: block;
  width: 100%;
  height: auto;
}

/* ══════════════════════════════════════
   LANDING PAGE — Sections
   ══════════════════════════════════════ */

.ref-section {
  padding: 80px 24px;
}

.ref-section-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.ref-section-narrow {
  max-width: 520px;
}

.ref-section h2 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.ref-section-sub {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

/* ── Earnings Chart ── */

.earnings-card {
  padding: 28px;
}

.earnings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.earnings-header h3 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.earnings-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.chart-wrap {
  width: 100%;
  height: 300px;
  margin-bottom: 20px;
}

.chart-wrap canvas {
  display: block;
}

.earnings-totals {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.earning-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.earning-total-amount {
  font-size: 1.3rem;
  font-weight: 600;
}

.earning-total-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Steps ── */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: left;
}

.step-card {
  padding: 28px 24px;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(233, 61, 130, 0.15);
  color: var(--primary);
  margin-bottom: 16px;
}

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

.step-card p {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Benefits ── */

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
  text-align: left;
}

.benefit-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.benefit-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.benefit-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.benefit-item p {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Math Table ── */

.math-table {
  padding: 0;
  overflow: hidden;
}

.math-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.math-table th,
.math-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.math-table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.02);
}

.math-table td:last-child {
  text-align: right;
}

.math-table th:last-child {
  text-align: right;
}

.math-table td strong {
  color: var(--primary);
  font-weight: 600;
}

.math-table tr:last-child td {
  border-bottom: none;
}

.highlight-row td {
  background: rgba(233, 61, 130, 0.06);
}

/* ── Form labels stay left-aligned ── */

#signup .form-group {
  text-align: left;
}

/* ══════════════════════════════════════
   FORMS
   ══════════════════════════════════════ */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group .label-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.payout-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.payout-option {
  flex: 1;
  padding: 10px 0;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.payout-option:first-child {
  border-right: 1px solid var(--border);
}

.payout-option.active {
  background: var(--primary);
  color: white;
}

.payout-option:not(.active):hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 6px;
}

/* ── Success State ── */

.success-card {
  text-align: center;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 20px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.success-card h2 {
  border: none;
  padding: 0;
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.success-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.referral-link-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.referral-link-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.referral-link-box button {
  padding: 6px 14px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ══════════════════════════════════════
   DASHBOARD (shared styles)
   ══════════════════════════════════════ */

.page-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 53px);
  padding: 40px 20px;
}

.page-inner {
  width: 100%;
  max-width: 480px;
}

.page-inner h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}

.page-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 32px;
  text-align: center;
}

.dashboard-section {
  padding: 32px 20px;
  min-height: calc(100vh - 53px);
}

.dashboard-inner {
  max-width: 800px;
  margin: 0 auto;
}

.dashboard-inner h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.login-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 53px);
  padding: 40px 20px;
}

.login-inner {
  width: 100%;
  max-width: 400px;
}

.login-inner h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}

.login-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

/* ── Stats Grid ── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
}

.stat-value.primary { color: var(--primary); }
.stat-value.success { color: var(--success); }

.referral-link-section {
  margin-bottom: 28px;
}

.referral-link-section h3 {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 10px;
}

/* ── Payout Table ── */

.payout-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.payout-table th,
.payout-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.payout-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payout-table tr:hover {
  background: var(--surface-hover);
}

/* ── Badges ── */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-paid { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-calculated { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-processing { background: rgba(233, 61, 130, 0.15); color: var(--primary); }
.badge-failed { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 0.9rem;
}

/* ── Stipulations ── */

.stipulations {
  margin-top: 28px;
  text-align: left;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.stipulations h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.stipulations ul {
  list-style: none;
  padding: 0;
}

.stipulations li {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 14px;
  position: relative;
  margin-bottom: 6px;
}

.stipulations li:last-child {
  margin-bottom: 0;
}

.stipulations li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ── Footer ── */

.site-footer {
  background: var(--surface);
  padding: 32px 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--text);
}

/* ══════════════════════════════════════
   SCROLL ANIMATIONS
   ══════════════════════════════════════ */

.anim {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.anim.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger hero elements */
.ref-hero-inner .anim:nth-child(1) { transition-delay: 0s; }
.ref-hero-inner .anim:nth-child(2) { transition-delay: 0.1s; }
.ref-hero-inner .anim:nth-child(3) { transition-delay: 0.2s; }
.ref-hero-inner .anim:nth-child(4) { transition-delay: 0.3s; }

/* Stagger step cards */
.steps-grid .anim:nth-child(1) { transition-delay: 0s; }
.steps-grid .anim:nth-child(2) { transition-delay: 0.1s; }
.steps-grid .anim:nth-child(3) { transition-delay: 0.2s; }

/* Stagger benefit items */
.benefits-grid .anim:nth-child(1) { transition-delay: 0s; }
.benefits-grid .anim:nth-child(2) { transition-delay: 0.06s; }
.benefits-grid .anim:nth-child(3) { transition-delay: 0.12s; }
.benefits-grid .anim:nth-child(4) { transition-delay: 0.18s; }
.benefits-grid .anim:nth-child(5) { transition-delay: 0.24s; }
.benefits-grid .anim:nth-child(6) { transition-delay: 0.3s; }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 768px) {
  .ref-hero {
    min-height: auto;
    padding: 60px 20px 40px;
  }

  .ref-hero h1 {
    font-size: 2rem;
  }

  .ref-hero-sub {
    font-size: 0.95rem;
  }

  .ref-section {
    padding: 50px 20px;
  }

  .ref-section h2 {
    font-size: 1.5rem;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .chart-wrap {
    height: 220px;
  }

  .earnings-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .earnings-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    justify-items: center;
  }

  .earning-total-amount {
    font-size: 1rem;
  }

  .earnings-card {
    padding: 18px 14px;
  }

  .page-inner h1 {
    font-size: 1.4rem;
  }

  .card {
    padding: 24px 18px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .referral-link-box {
    flex-direction: column;
  }

  .referral-link-box input {
    width: 100%;
    text-align: center;
  }
}
