/* ============================================
   Tesla Referral Landing Page – Modern Design
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --tesla-red: #e82127;
  --tesla-red-dark: #c41a1f;
  --dark: #0b0b0f;
  --dark-surface: #141418;
  --dark-card: #1c1c22;
  --gray-100: #f5f5f7;
  --gray-200: #e8e8ed;
  --gray-400: #86868b;
  --gray-600: #515154;
  --white: #ffffff;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-w: 1100px;
  --radius: 16px;
  --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--dark);
  color: var(--gray-100);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* --- Typography --- */
h1, h2, h3 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
p  { font-size: 1.05rem; color: var(--gray-200); }

/* --- Layout --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; }
@media (max-width: 768px) { section { padding: 56px 0; } }

/* --- Navigation --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(11,11,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; justify-content: center;
}
.nav-inner {
  max-width: var(--max-w); width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-weight: 800; font-size: 1.15rem;
  color: var(--white);
  letter-spacing: -0.01em;
}
.nav-logo span { color: var(--tesla-red); }
.lang-switcher {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.lang-switcher a {
  font-size: 0.78rem; font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--gray-400);
  transition: var(--transition);
}
.lang-switcher a:hover, .lang-switcher a.active {
  color: var(--white);
  border-color: var(--tesla-red);
  background: rgba(232,33,39,0.1);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding-top: 60px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
}
.hero-bg video, .hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,11,15,0.55) 0%, rgba(11,11,15,0.85) 80%, var(--dark) 100%);
  z-index: 1;
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 720px; padding: 0 24px;
}
.hero-badge {
  display: inline-block;
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--tesla-red);
  background: rgba(232,33,39,0.12);
  border: 1px solid rgba(232,33,39,0.25);
  border-radius: 100px;
  padding: 6px 18px;
  margin-bottom: 24px;
}
.hero h1 { color: var(--white); margin-bottom: 20px; }
.hero p {
  font-size: 1.15rem;
  color: var(--gray-200);
  margin-bottom: 36px;
  max-width: 560px;
  margin-left: auto; margin-right: auto;
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font);
  font-size: 1rem; font-weight: 700;
  padding: 16px 36px;
  border-radius: 12px;
  border: none; cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--tesla-red);
  color: var(--white);
  box-shadow: 0 4px 24px rgba(232,33,39,0.35);
}
.btn-primary:hover {
  background: var(--tesla-red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(232,33,39,0.45);
}
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-2px);
}

/* --- Trust bar --- */
.trust-bar {
  padding: 40px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.trust-bar-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 40px; flex-wrap: wrap;
  font-size: 0.9rem; color: var(--gray-400); font-weight: 500;
}
.trust-item { display: flex; align-items: center; gap: 8px; }
.trust-icon {
  width: 20px; height: 20px;
  fill: var(--tesla-red);
  flex-shrink: 0;
}

/* --- Benefits Grid --- */
.benefits { background: var(--dark); }
.benefits .section-header { text-align: center; margin-bottom: 56px; }
.benefits .section-header p { max-width: 560px; margin: 12px auto 0; }

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.benefit-card {
  background: var(--dark-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: var(--transition);
}
.benefit-card:hover {
  border-color: rgba(232,33,39,0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.benefit-icon {
  width: 48px; height: 48px;
  background: rgba(232,33,39,0.1);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.benefit-icon svg { width: 24px; height: 24px; stroke: var(--tesla-red); fill: none; }
.benefit-card h3 { margin-bottom: 10px; color: var(--white); }
.benefit-card p { font-size: 0.95rem; }

/* --- FSD Highlight --- */
.fsd-section {
  background: linear-gradient(135deg, var(--dark-surface) 0%, var(--dark) 100%);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.fsd-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 768px) {
  .fsd-inner { grid-template-columns: 1fr; gap: 32px; }
}
.fsd-content .fsd-tag {
  display: inline-block;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #34c759;
  background: rgba(52,199,89,0.1);
  border: 1px solid rgba(52,199,89,0.25);
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 16px;
}
.fsd-content h2 { margin-bottom: 16px; color: var(--white); }
.fsd-content p { margin-bottom: 16px; }
.fsd-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--dark-card);
}
.fsd-visual video, .fsd-visual img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* --- How It Works --- */
.how-it-works { background: var(--dark); }
.how-it-works .section-header { text-align: center; margin-bottom: 56px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  counter-reset: step;
}
@media (max-width: 768px) { .steps { grid-template-columns: 1fr; } }

.step {
  text-align: center;
  padding: 32px 20px;
  counter-increment: step;
}
.step-number {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(232,33,39,0.1);
  border: 2px solid var(--tesla-red);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800;
  color: var(--tesla-red);
  margin: 0 auto 20px;
}
.step h3 { margin-bottom: 10px; color: var(--white); }
.step p { font-size: 0.95rem; }

/* --- FAQ --- */
.faq { background: var(--dark-surface); }
.faq .section-header { text-align: center; margin-bottom: 48px; }
.faq-list { max-width: 760px; margin: 0 auto; }

.faq-item {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
  font-family: var(--font);
  font-size: 1.05rem; font-weight: 600;
  color: var(--white);
  text-align: left;
  transition: var(--transition);
}
.faq-question:hover { color: var(--tesla-red); }
.faq-arrow {
  width: 20px; height: 20px;
  stroke: var(--gray-400);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 16px;
}
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 300px;
  padding-bottom: 22px;
}
.faq-answer p { font-size: 0.95rem; color: var(--gray-200); }

/* --- Final CTA --- */
.final-cta {
  text-align: center;
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark-surface) 100%);
}
.final-cta h2 { color: var(--white); margin-bottom: 16px; }
.final-cta p { max-width: 520px; margin: 0 auto 32px; }
.final-cta .hero-cta { margin-bottom: 16px; }
.referral-code {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--gray-400);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 20px;
  margin-top: 16px;
  letter-spacing: 0.03em;
}
.referral-code strong { color: var(--white); }

/* --- Footer --- */
.footer {
  padding: 40px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.footer p { font-size: 0.82rem; color: var(--gray-600); }
.footer a { color: var(--gray-400); }
.footer a:hover { color: var(--white); }

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in {
  opacity: 0;
  animation: fadeInUp 0.7s ease forwards;
}
.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
