/* ============================================
   SAFEAI SCHOOL - TOP CLASS CSS (V3.1)
   Conversion-first, credible, clean
   Fixed: outline buttons, video black flash, safer reveal, video section styles
   ============================================ */

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

:root{
  --primary:#2563eb;
  --primary-dark:#1e40af;
  --secondary:#10b981;
  --secondary-dark:#059669;
  --accent:#f59e0b;

  --text:#111827;
  --muted:#6b7280;

  --bg:#ffffff;
  --bg-light:#f9fafb;
  --hero-grad: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);

  --border:#e5e7eb;
  --shadow: rgba(0,0,0,.10);
  --shadow-lg: rgba(0,0,0,.18);

  --radius: 1rem;
  --radius-sm: .75rem;

  --container: 1200px;

  --t: .25s ease;
  --t2: .6s ease;
}

html{ scroll-behavior:smooth; }
body{
  font-family:"Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.6;
  overflow-x:hidden;
}

/* Accessibility */
a, button, input{ outline:none; }
a:focus-visible, button:focus-visible, input:focus-visible{
  box-shadow:0 0 0 4px rgba(37,99,235,.18);
  border-radius:.6rem;
}

/* Typography */
h1,h2,h3,h4{ letter-spacing:-0.02em; line-height:1.15; }
h1{ font-size:clamp(2rem, 5vw, 3.35rem); margin-bottom:1rem; }
h2{ font-size:clamp(1.7rem, 3.8vw, 2.35rem); text-align:center; margin-bottom:.75rem; }
h3{ font-size:clamp(1.2rem, 2.4vw, 1.6rem); margin-bottom:.55rem; }
p{ margin-bottom:1rem; }
.section-subtitle{
  text-align:center;
  max-width:860px;
  margin:0 auto 2.4rem;
  color:var(--muted);
  font-size:1.1rem;
}

/* Layout */
.container{
  max-width:var(--container);
  margin:0 auto;
  padding:2rem;
}

/* Reveal (safe) */
section{
  padding:4rem 0;
  opacity:0;
  transform:translateY(18px);
  transition:opacity var(--t2), transform var(--t2);
}
section.visible{
  opacity:1;
  transform:translateY(0);
}
/* Always visible key areas (avoid “invisible page” if JS fails) */
.hero, .footer{
  opacity:1 !important;
  transform:none !important;
}

/* Header */
.header{
  position:fixed;
  top:0; left:0; right:0;
  z-index:1000;
  background:rgba(255,255,255,.92);
  border-bottom:1px solid var(--border);
  backdrop-filter:blur(10px);
  transition:box-shadow var(--t), background var(--t);
}
.header.scrolled{ box-shadow:0 12px 30px -22px var(--shadow-lg); }

.nav{
  max-width:var(--container);
  margin:0 auto;
  padding:1rem 2rem;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  flex-wrap:wrap;
}
.logo{
  font-weight:900;
  color:var(--primary);
  font-size:1.35rem;
}
.nav-links{
  list-style:none;
  display:flex;
  gap:1.1rem;
  flex-wrap:wrap;
}
.nav-links a{
  text-decoration:none;
  color:var(--text);
  font-weight:700;
  padding:.25rem .1rem;
  transition:color var(--t);
}
.nav-links a:hover{ color:var(--primary); }

.lang-link{
  display:inline-block;
  padding:.45rem .75rem;
  border:1px solid var(--border);
  border-radius:.75rem;
  text-decoration:none;
  font-weight:900;
  color:var(--text);
  background:#fff;
  transition:transform var(--t), border-color var(--t);
}
.lang-link:hover{
  border-color:rgba(37,99,235,.35);
  transform:translateY(-1px);
}

/* Sticky CTA */
.sticky-cta{
  position:fixed;
  left:0; right:0;
  bottom:-120px;
  z-index:999;
  padding:.9rem 1.2rem;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:.9rem;
  flex-wrap:wrap;
  background:linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow:0 -12px 30px -22px var(--shadow-lg);
  transition:bottom var(--t);
}
.sticky-cta.visible{ bottom:0; }
.sticky-cta p{ margin:0; color:#fff; font-weight:700; }

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  padding:.82rem 1.2rem;
  border-radius:.95rem;
  border:2px solid transparent;
  font-weight:900;
  text-decoration:none;
  cursor:pointer;
  transition:transform var(--t), box-shadow var(--t), background var(--t), border-color var(--t), color var(--t);
  user-select:none;
}
.btn-small{ padding:.58rem .95rem; font-size:.92rem; border-radius:.85rem; }
.btn-block{ width:100%; }

.btn-primary{ background:var(--primary); color:#fff; }
.btn-primary:hover{
  background:var(--primary-dark);
  transform:translateY(-1px);
  box-shadow:0 18px 40px -28px var(--shadow-lg);
}

.btn-secondary{ background:var(--secondary); color:#fff; }
.btn-secondary:hover{
  background:var(--secondary-dark);
  transform:translateY(-1px);
  box-shadow:0 18px 40px -28px var(--shadow-lg);
}

.btn-white{ background:#fff; color:var(--primary); border-color:#fff; }
.btn-white:hover{
  background:var(--bg-light);
  transform:translateY(-1px);
}

/* Outline default = works on light backgrounds */
.btn-outline{
  background:transparent;
  color:var(--primary);
  border-color:rgba(37,99,235,.35);
}
.btn-outline:hover{
  border-color:rgba(37,99,235,.65);
  transform:translateY(-1px);
}

/* Outline on dark background (sticky CTA) */
.sticky-cta .btn-outline{
  color:#fff;
  border-color:rgba(255,255,255,.65);
}
.sticky-cta .btn-outline:hover{
  border-color:#fff;
}

/* Hero */
.hero{
  margin-top:72px;
  background:var(--hero-grad);
  padding:4.5rem 0;
}
.hero-content{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:2rem;
  align-items:center;
}
.hero-text{ text-align:left; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.48rem .92rem;
  background:#fff;
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--primary);
  font-weight:900;
  box-shadow:0 12px 28px -22px var(--shadow-lg);
  margin-bottom:1rem;
}

.hero-subtitle{
  font-size:1.15rem;
  color:var(--muted);
  margin-bottom:1.1rem;
}

.hero-cta{
  display:flex;
  gap:.9rem;
  flex-wrap:wrap;
  margin:1.1rem 0;
}

.trust-badges{
  display:flex;
  flex-wrap:wrap;
  gap:.8rem;
  margin-top:1.2rem;
}
.trust-badge{
  display:flex;
  align-items:center;
  gap:.55rem;
  padding:.72rem .92rem;
  background:#fff;
  border:1px solid var(--border);
  border-radius:.95rem;
  font-weight:800;
  font-size:.92rem;
  box-shadow:0 18px 40px -34px var(--shadow-lg);
}
.micro-note{
  color:var(--muted);
  font-size:.92rem;
  margin-top:.8rem;
}

.hero-visual .video-placeholder{
  background:#fff;
  border:1px dashed var(--border);
  border-radius:var(--radius);
  padding:2rem;
  text-align:center;
  box-shadow:0 22px 60px -52px var(--shadow-lg);
}
.video-icon{ font-size:2.2rem; margin-bottom:.5rem; }
.video-caption{ color:var(--muted); font-style:italic; margin:.25rem 0 0; }

/* Hero video */
.hero-video{
  width:100%;
  max-width:820px;
  aspect-ratio:16 / 9;
  height:auto;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow:0 22px 60px -52px rgba(0,0,0,.18);
  background:transparent; /* avoids black flash if poster shows */
  display:block;
}
.video-hint{
  position:absolute;
  top:12px;
  left:12px;
  background:rgba(0,0,0,.55);
  color:#fff;
  padding:.45rem .7rem;
  border-radius:999px;
  font-weight:900;
  font-size:.9rem;
  pointer-events:auto;
  border:none;
  cursor:pointer;
  backdrop-filter:blur(6px);
}

/* Problem section */
.problem-section{ background:#fff7ed; }
.problem-section h2{ color:#9a3412; }

.problem-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
  gap:1.4rem;
}
.problem-card{
  background:#fff;
  border:1px solid #fed7aa;
  border-radius:var(--radius);
  padding:1.7rem;
  text-align:center;
  transition:transform var(--t), box-shadow var(--t), border-color var(--t);
}
.problem-card:hover{
  transform:translateY(-4px);
  border-color:#fdba74;
  box-shadow:0 22px 60px -52px rgba(154,52,18,.30);
}
.problem-icon{ font-size:2.6rem; margin-bottom:.55rem; }

/* Note cards */
.note-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:1.6rem;
  box-shadow:0 26px 80px -72px var(--shadow-lg);
}

/* Dual path */
.dual-path-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));
  gap:1.4rem;
}
.path-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:2rem;
  transition:transform var(--t), box-shadow var(--t), border-color var(--t);
}
.path-card:hover{
  transform:translateY(-4px);
  border-color:rgba(37,99,235,.20);
  box-shadow:0 28px 80px -70px var(--shadow-lg);
}

/* Backbone */
.backbone-section{
  background:var(--bg-light);
  border-radius:var(--radius);
}
.backbone-list{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
  gap:1.2rem;
}
.backbone-item{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:1.3rem;
  text-align:center;
  transition:transform var(--t), box-shadow var(--t);
}
.backbone-item:hover{
  transform:translateY(-3px);
  box-shadow:0 22px 70px -62px var(--shadow-lg);
}
.backbone-icon{ font-size:2.2rem; margin-bottom:.5rem; }

/* Offers */
.products-section{ background:var(--bg-light); }
.products-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));
  gap:1.6rem;
  align-items:stretch;
}

.product-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:2rem;
  display:flex;
  flex-direction:column;
  position:relative;
  transition:transform var(--t), box-shadow var(--t), border-color var(--t);
}
.product-card:hover{
  transform:translateY(-4px);
  box-shadow:0 34px 110px -92px var(--shadow-lg);
  border-color:rgba(37,99,235,.22);
}

.featured-badge{
  position:absolute;
  top:-12px;
  right:18px;
  background:var(--accent);
  color:#fff;
  font-weight:950;
  font-size:.85rem;
  padding:.45rem .85rem;
  border-radius:999px;
  box-shadow:0 22px 70px -58px rgba(245,158,11,.75);
}

.product-subtitle{
  color:var(--muted);
  font-weight:900;
  margin-bottom:1.1rem;
}

.value-stack{ margin-bottom:1.1rem; }
.value-header{ font-weight:950; margin-bottom:.55rem; }
.value-list{ list-style:none; margin:0; padding:0; }
.value-list li{
  display:flex;
  gap:.6rem;
  align-items:flex-start;
  padding:.65rem 0;
  border-bottom:1px solid var(--border);
}
.value-list li:last-child{ border-bottom:none; }
.check{ color:var(--secondary); font-weight:950; }

.price-section{
  margin-top:auto;
  background:var(--bg-light);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:1.2rem;
  text-align:center;
}
.price{
  font-size:2.35rem;
  font-weight:950;
  color:var(--primary);
  margin-bottom:.1rem;
}
.savings{ color:var(--secondary); font-weight:950; }
.price-note{
  text-align:center;
  color:var(--muted);
  font-size:.92rem;
  margin-top:.8rem;
}
.guarantee{
  text-align:center;
  color:var(--secondary);
  font-weight:950;
  margin-top:.7rem;
}

.dual-cta{
  display:grid;
  gap:.7rem;
  margin-top:.6rem;
}

/* Checklist */
.checklist-section{
  background:linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
}
.checklist-content{ text-align:center; }

.checklist-box{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:2rem;
  max-width:920px;
  margin:0 auto;
  box-shadow:0 34px 110px -92px var(--shadow-lg);
}

.checklist-preview{
  text-align:left;
  background:var(--bg-light);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:1.2rem;
}

.email-form{
  display:flex;
  gap:.8rem;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  margin-top:1.2rem;
}
.email-form input[type="email"]{
  min-width:280px;
  flex:1;
  padding:.95rem 1rem;
  border:1px solid var(--border);
  border-radius:.95rem;
  font-size:1rem;
  transition:border-color var(--t), box-shadow var(--t);
}
.email-form input[type="email"]:focus{
  border-color:rgba(37,99,235,.55);
  box-shadow:0 0 0 4px rgba(37,99,235,.14);
}
.privacy-note{ color:var(--muted); font-size:.9rem; margin-top:.7rem; }

/* FAQ */
.faq-item{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  margin-bottom:.9rem;
  overflow:hidden;
  transition:border-color var(--t), box-shadow var(--t);
}
.faq-item:hover{
  border-color:rgba(37,99,235,.22);
  box-shadow:0 22px 70px -62px var(--shadow-lg);
}
.faq-question{
  padding:1.2rem;
  display:flex;
  justify-content:space-between;
  align-items:center;
  cursor:pointer;
  font-weight:950;
}
.faq-icon{
  font-size:1.35rem;
  color:var(--primary);
  transition:transform var(--t);
}
.faq-question.active .faq-icon{ transform:rotate(45deg); }

.faq-answer{
  max-height:0;
  overflow:hidden;
  padding:0 1.2rem;
  transition:max-height var(--t2), padding var(--t);
}
.faq-answer.active{
  max-height:520px;
  padding:0 1.2rem 1.2rem;
}
.faq-answer p{ margin:0; color:var(--muted); }

/* Footer */
.footer{
  background:#0b1220;
  color:#fff;
  padding:3rem 0;
}
.footer-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:1.4rem;
}
.footer a{ color:#fff; opacity:.92; text-decoration:none; }
.footer a:hover{ opacity:1; text-decoration:underline; }
.footer-note{ opacity:.78; font-size:.92rem; }

/* Exit popup */
.exit-popup{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.72);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
}
.exit-popup.visible{ display:flex; }
.exit-popup-content{
  background:#fff;
  width:min(540px, 92vw);
  border-radius:1.2rem;
  padding:2rem;
  position:relative;
  box-shadow:0 46px 140px -110px rgba(0,0,0,.7);
}
.exit-close{
  position:absolute;
  top:12px; right:12px;
  border:none;
  background:transparent;
  font-size:2rem;
  cursor:pointer;
  color:var(--muted);
}
.exit-close:hover{ color:var(--text); }
.exit-benefits{ list-style:none; margin:1rem 0; text-align:left; }
.exit-benefits li{ padding:.35rem 0; }
.exit-form input[type="email"]{
  width:100%;
  padding:.95rem 1rem;
  border:1px solid var(--border);
  border-radius:.95rem;
  margin:.8rem 0;
}
.exit-small{ color:var(--muted); font-size:.9rem; margin-top:.6rem; }

/* Confirmation */
.confirmation-section{ display:none; }
#confirmation:target{ display:block; }

/* ===== VIDEO SECTION (5min) ===== */
.video-section{ margin-top:64px; }

.video-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:20px;
  padding:28px;
  max-width:1100px;
  margin:0 auto;
  box-shadow:0 26px 80px -72px var(--shadow-lg);
}
.video-header h2{ margin-top:0; }

.video-subtitle{
  margin-top:6px;
  color:var(--muted);
  max-width:760px;
}

/* Wrapper = cover visible while video loads */
.video-wrapper{
  margin-top:18px;
  position:relative;
  width:100%;
  aspect-ratio:16 / 9;
  background-size:cover;
  background-position:center;
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow:0 22px 60px -52px rgba(0,0,0,.18);
}

.video-wrapper video.long-video{
  width:100%;
  height:100%;
  display:block;
  background:transparent; /* avoid black box */
  object-fit:cover;
}

.video-cta{
  margin-top:18px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

/* Responsive */
@media (max-width: 920px){
  .hero-content{ grid-template-columns:1fr; }
  .hero-text{ text-align:center; }
  .hero-cta{ justify-content:center; }
  .trust-badges{ justify-content:center; }
}
@media (max-width: 768px){
  .nav{ padding:.9rem 1rem; }
  .nav-links{ gap:.8rem; font-size:.95rem; justify-content:center; }
  .container{ padding:1.3rem; }
  .email-form{ flex-direction:column; }
  .email-form input, .email-form button{ width:100%; }
  .sticky-cta{ padding:.8rem 1rem; }
}
@media (max-width: 640px){
  .video-card{ padding:18px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; animation:none !important; }
  section{ opacity:1 !important; transform:none !important; }
}
/* ===== HERO VIDEO CENTER (FR + EN) ===== */
.hero-visual{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  position:relative; /* ensures the play button (.video-hint) stays positioned correctly */
}

.hero-visual .video-caption{
  text-align:center;
  max-width:640px;
  margin-left:auto;
  margin-right:auto;
}

.hero-visual > div[style*="margin-top:14px"]{
  justify-content:center !important;
}
