/* ============================================================
   IDIOMASOFÍA® — Lead Capture Form
   CSS  |  Marca: Sky Blue + Orange  |  Fredoka One + Nunito
   ============================================================ */

/* ── RESET & TOKENS ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-deep:    #0A3D6B;
  --blue-mid:     #1565C0;
  --blue-sky:     #42A5F5;
  --blue-light:   #E3F2FD;
  --orange:       #FF6D00;
  --orange-light: #FF8F00;
  --orange-glow:  #FFB74D;
  --white:        #FFFFFF;
  --gray-100:     #F7F9FC;
  --gray-300:     #CBD5E0;
  --gray-500:     #718096;
  --gray-700:     #2D3748;
  --success:      #2E7D32;
  --error:        #C62828;

  --font-display: 'Fredoka One', cursive;
  --font-body:    'Nunito', sans-serif;

  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  40px;

  --shadow-card: 0 20px 60px rgba(10, 61, 107, 0.15), 0 4px 16px rgba(10, 61, 107, 0.08);
  --shadow-btn:  0 8px 24px rgba(255, 109, 0, 0.45);
  --shadow-input:0 2px 8px rgba(21, 101, 192, 0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family:  var(--font-body);
  background:   var(--blue-deep);
  color:        var(--gray-700);
  min-height:   100vh;
  overflow-x:   hidden;
}

/* ── BACKGROUND TEXTURE ──────────────────────────────────── */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(66,165,245,.35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 85% 110%, rgba(255,109,0,.18) 0%, transparent 55%),
    radial-gradient(ellipse 100% 100% at 50% 50%, var(--blue-deep) 0%, #05243F 100%);
}

.bg-canvas::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
.page-wrapper {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 64px;
}

/* ── LOGO HEADER ─────────────────────────────────────────── */
.logo-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
  animation: fadeDown .6s ease both;
}

.logo-wordmark {
  font-family: var(--font-display);
  font-size:   clamp(28px, 5vw, 40px);
  color:       var(--white);
  letter-spacing: .5px;
}

.logo-wordmark span {
  color: var(--orange-glow);
}

.logo-tagline {
  font-size:    13px;
  font-weight:  600;
  color:        rgba(255,255,255,.55);
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

/* ── HERO COPY ───────────────────────────────────────────── */
.hero {
  text-align: center;
  max-width:  560px;
  margin-bottom: 40px;
  animation: fadeDown .7s .1s ease both;
}

.hero__badge {
  display:        inline-flex;
  align-items:    center;
  gap:            6px;
  background:     rgba(255,109,0,.15);
  border:         1px solid rgba(255,109,0,.4);
  border-radius:  var(--radius-xl);
  padding:        6px 16px;
  font-size:      12px;
  font-weight:    800;
  color:          var(--orange-glow);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom:  20px;
}

.hero__badge svg { width: 14px; height: 14px; flex-shrink: 0; }

.hero__title {
  font-family:  var(--font-display);
  font-size:    clamp(28px, 5.5vw, 46px);
  color:        var(--white);
  line-height:  1.15;
  margin-bottom: 16px;
}

.hero__title em {
  font-style: normal;
  color:       var(--blue-sky);
}

.hero__title .accent {
  color: var(--orange-glow);
}

.hero__sub {
  font-size:   clamp(15px, 2vw, 18px);
  color:       rgba(255,255,255,.72);
  line-height: 1.65;
}

/* ── TRUST PILLS ─────────────────────────────────────────── */
.trust-pills {
  display:        flex;
  flex-wrap:      wrap;
  justify-content:center;
  gap:            10px;
  margin-top:     24px;
}

.pill {
  display:      flex;
  align-items:  center;
  gap:          6px;
  background:   rgba(255,255,255,.08);
  border:       1px solid rgba(255,255,255,.14);
  border-radius:var(--radius-xl);
  padding:      5px 14px;
  font-size:    13px;
  font-weight:  700;
  color:        rgba(255,255,255,.85);
  backdrop-filter: blur(6px);
}

.pill-icon { font-size: 15px; }

/* ── CARD ────────────────────────────────────────────────── */
.card {
  background:    rgba(255,255,255,.97);
  border-radius: var(--radius-lg);
  box-shadow:    var(--shadow-card);
  padding:       clamp(28px, 5vw, 48px) clamp(24px, 5vw, 44px);
  width:         100%;
  max-width:     480px;
  animation:     fadeUp .7s .2s ease both;
}

.card__headline {
  font-family:   var(--font-display);
  font-size:     clamp(20px, 3.5vw, 26px);
  color:         var(--blue-deep);
  text-align:    center;
  margin-bottom: 6px;
  line-height:   1.2;
}

.card__sub {
  font-size:    14px;
  color:        var(--gray-500);
  text-align:   center;
  margin-bottom:28px;
  line-height:  1.5;
}

/* ── FORM ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display:       block;
  font-size:     13px;
  font-weight:   800;
  color:         var(--blue-deep);
  margin-bottom: 7px;
  letter-spacing:.3px;
  text-transform:uppercase;
}

.input-wrap {
  position:   relative;
  display:    flex;
  align-items:center;
}

.input-icon {
  position:  absolute;
  left:      14px;
  display:   flex;
  align-items:center;
  color:     var(--blue-sky);
  pointer-events: none;
}

.input-icon svg { width: 18px; height: 18px; }

.form-input {
  width:        100%;
  padding:      13px 16px 13px 44px;
  font-family:  var(--font-body);
  font-size:    15px;
  font-weight:  600;
  color:        var(--gray-700);
  background:   var(--gray-100);
  border:       2px solid var(--gray-300);
  border-radius:var(--radius-sm);
  outline:      none;
  transition:   all .2s ease;
  box-shadow:   var(--shadow-input);
}

.form-input::placeholder { color: var(--gray-500); font-weight: 400; }

.form-input:focus {
  border-color: var(--blue-mid);
  background:   var(--white);
  box-shadow:   0 0 0 4px rgba(66,165,245,.2), var(--shadow-input);
}

.form-input.is-error {
  border-color: var(--error);
  background:   #FFF5F5;
}

.form-input.is-valid {
  border-color: var(--success);
}

.field-error {
  display:    none;
  margin-top: 5px;
  font-size:  12px;
  font-weight:700;
  color:      var(--error);
}

.field-error.visible { display: block; }

/* ── PREFIX SELECTOR (WhatsApp) ──────────────────────────── */
.input-wrap--phone .form-input {
  padding-left: 72px;
}

.phone-prefix {
  position:    absolute;
  left:        0;
  height:      100%;
  display:     flex;
  align-items: center;
  padding:     0 12px 0 14px;
  font-size:   14px;
  font-weight: 800;
  color:       var(--blue-deep);
  background:  var(--blue-light);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: 2px solid var(--gray-300);
  gap:         4px;
  white-space: nowrap;
  pointer-events: none;
}

/* ── CTA BUTTON ──────────────────────────────────────────── */
.btn-cta {
  display:        flex;
  align-items:    center;
  justify-content:center;
  gap:            10px;
  width:          100%;
  padding:        16px 24px;
  margin-top:     8px;
  font-family:    var(--font-display);
  font-size:      clamp(17px, 2.5vw, 20px);
  letter-spacing: .5px;
  color:          var(--white);
  background:     linear-gradient(135deg, var(--orange), var(--orange-light));
  border:         none;
  border-radius:  var(--radius-md);
  cursor:         pointer;
  box-shadow:     var(--shadow-btn);
  transition:     all .22s ease;
  position:       relative;
  overflow:       hidden;
}

.btn-cta::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.2), transparent);
  opacity: 0;
  transition: opacity .2s;
}

.btn-cta:hover:not(:disabled) {
  transform:  translateY(-2px);
  box-shadow: 0 12px 32px rgba(255,109,0,.55);
}

.btn-cta:hover:not(:disabled)::before { opacity: 1; }

.btn-cta:active:not(:disabled) { transform: translateY(0); }

.btn-cta:disabled {
  opacity: .65;
  cursor:  not-allowed;
  transform: none;
}

.btn-cta svg { width: 22px; height: 22px; flex-shrink: 0; }

/* Spinner dentro del botón */
.spinner {
  width:  20px; height: 20px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}

.btn-cta.loading .btn-text { display: none; }
.btn-cta.loading .btn-icon { display: none; }
.btn-cta.loading .spinner  { display: block; }

/* ── PRIVACY NOTE ────────────────────────────────────────── */
.privacy-note {
  display:     flex;
  align-items: flex-start;
  gap:         8px;
  margin-top:  16px;
  font-size:   12px;
  color:       var(--gray-500);
  line-height: 1.5;
}

.privacy-note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; color: var(--gray-300); }

/* ── SUCCESS STATE ───────────────────────────────────────── */
.success-panel {
  display:        none;
  flex-direction: column;
  align-items:    center;
  text-align:     center;
  gap:            16px;
  padding:        8px 0;
}

.success-panel.visible { display: flex; }

.success-icon {
  width:        72px; height: 72px;
  background:   linear-gradient(135deg, #1B5E20, #2E7D32);
  border-radius:50%;
  display:      flex;
  align-items:  center;
  justify-content:center;
  box-shadow:   0 8px 24px rgba(46,125,50,.35);
  animation:    popIn .5s cubic-bezier(.34,1.56,.64,1) both;
}

.success-icon svg { width: 36px; height: 36px; color: white; }

.success-title {
  font-family: var(--font-display);
  font-size:   22px;
  color:       var(--blue-deep);
  line-height: 1.2;
}

.success-msg {
  font-size:   14px;
  color:       var(--gray-500);
  line-height: 1.6;
  max-width:   320px;
}

.btn-whatsapp {
  display:        flex;
  align-items:    center;
  justify-content:center;
  gap:            10px;
  padding:        14px 28px;
  font-family:    var(--font-display);
  font-size:      18px;
  color:          var(--white);
  background:     linear-gradient(135deg, #1B5E20, #2E7D32);
  border-radius:  var(--radius-md);
  text-decoration:none;
  box-shadow:     0 8px 24px rgba(46,125,50,.4);
  transition:     all .2s ease;
  width:          100%;
  border:         none;
  cursor:         pointer;
  animation:      fadeUp .5s .2s ease both;
}

.btn-whatsapp:hover {
  transform:  translateY(-2px);
  box-shadow: 0 12px 32px rgba(46,125,50,.5);
}

.btn-whatsapp svg { width: 24px; height: 24px; }

/* ── ERROR BANNER ─────────────────────────────────────────── */
.error-banner {
  display:       none;
  align-items:   center;
  gap:           10px;
  background:    #FFF5F5;
  border:        2px solid #FFCDD2;
  border-radius: var(--radius-sm);
  padding:       12px 16px;
  margin-bottom: 16px;
  font-size:     13px;
  font-weight:   700;
  color:         var(--error);
}

.error-banner.visible { display: flex; }
.error-banner svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── SOCIAL PROOF FOOTER ─────────────────────────────────── */
.social-proof {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            12px;
  margin-top:     36px;
  animation:      fadeUp .7s .35s ease both;
}

.avatars {
  display:    flex;
  align-items:center;
}

.avatar {
  width:  38px; height: 38px;
  border-radius: 50%;
  border: 2.5px solid var(--blue-deep);
  background: linear-gradient(135deg, var(--blue-sky), var(--blue-mid));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  color: white;
  margin-left: -10px;
}

.avatar:first-child { margin-left: 0; }

.proof-text {
  font-size:  13px;
  color:      rgba(255,255,255,.6);
  font-weight:700;
}

.proof-text strong { color: var(--orange-glow); }

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0);     }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.4); }
  to   { opacity: 1; transform: scale(1);  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .page-wrapper { padding: 32px 16px 48px; }
  .card { padding: 28px 20px; }
  .trust-pills { gap: 7px; }
  .pill { font-size: 11px; padding: 4px 10px; }
}
