:root {
  --brand:      #af1831;
  --brand-dark: #7a1020;
  --brand-glow: rgba(175,24,49,0.3);
  --ec-yellow:  #FFD100;
  --ec-blue:    #003DA5;
  --ec-red:     #af1831;
  --charcoal:   #181818;
  --dark:       #0f0f0f;
  --mid:        #242424;
  --line:       #333;
  --grey:       #7a7a7a;
  --grey-light: #c2c2c2;
  --white:      #ffffff;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  background: var(--dark);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.hero,
.card,
footer {
  position: relative;
  z-index: 1;
}

.card{
   z-index: 3; 
}

/* ══════════════════════════════
   HERO
══════════════════════════════ */
.hero {
  width: 100%;
  background:
    linear-gradient(170deg, rgba(12, 18, 36, 0.72) 0%, rgba(9, 22, 54, 0.62) 45%, rgba(8, 14, 28, 0.78) 100%),
    url('images/bg.png') center/cover no-repeat;
  padding: 36px 20px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* Subtle radial glow from brand color */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(175,24,49,0.22) 0%, transparent 65%);
  pointer-events: none;
}
/* Ecuador tricolor accent bar at very top */
.tricolor-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  display: flex;
}
.tricolor-bar span:nth-child(1) { flex: 2; background: var(--ec-yellow); }
.tricolor-bar span:nth-child(2) { flex: 1; background: var(--ec-blue); }
.tricolor-bar span:nth-child(3) { flex: 1; background: var(--ec-red); }

/* ── LOGO ── */
.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 0px;
  position: relative;
  z-index: 1;
}

.logo {
  width: clamp(180px, 50vw, 280px);
  height: auto;
}

.logo-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 9vw, 4.6rem);
  letter-spacing: 0.06em;
  color: var(--brand);
  line-height: 1;
  text-shadow: 0 2px 20px rgba(175,24,49,0.4);
  display: inline-flex;
  align-items: center;
}
.logo-o {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em; height: 1em;
  border: 0.08em solid var(--brand);
  border-radius: 50%;
  position: relative;
  margin-left: -0.03em;
  font-size: inherit;
  color: transparent;
}
.logo-o::after {
  content: '🐘';
  font-size: 0.44em;
  position: absolute;
  color: initial;
  filter: grayscale(0.3);
}
.logo-tagline {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: clamp(0.52rem, 1.8vw, 0.75rem);
  letter-spacing: 0.28em;
  color: var(--grey-light);
  text-transform: uppercase;
  margin-top: 2px;
}
.logo-rule {
  width: 100px; height: 1px;
  background: linear-gradient(to right, transparent, var(--brand), transparent);
  margin: 6px auto 0;
}

/* ── PRIZE BANNER ── */
.prize-banner {
  position: relative;
  z-index: 1;
  margin: 4px auto 20px;
  max-width: 500px;
  background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
  border: 1px solid rgba(255,209,0,0.25);
  border-radius: 14px;
  padding: 14px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
}
.prize-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: clamp(0.6rem, 2vw, 0.72rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--grey);
}
.prize-amount {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  line-height: 1;
  color: var(--ec-yellow);
  text-shadow: 0 2px 12px rgba(255,209,0,0.25);
  letter-spacing: -0.01em;
}
.prize-sub {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: clamp(0.62rem, 2vw, 0.78rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-light);
}
/* Thin tricolor stripe below prize number */
.prize-stripe {
  display: flex;
  width: 80px;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.prize-stripe span:nth-child(1) { flex: 2; background: var(--ec-yellow); }
.prize-stripe span:nth-child(2) { flex: 1; background: var(--ec-blue); }
.prize-stripe span:nth-child(3) { flex: 1; background: var(--ec-red); }

/* ── MANNY PLACEHOLDER ── */
.manny-zone {
  position: relative;
  z-index: 1;
  margin: 0 auto 0;
  max-width: 500px;
  width: calc(100% - 40px);
  border-radius: 14px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px 0px 16px;
  text-align: center;
}
.manny-zone img {
  width: 100%;
  max-width: 500px;
  height: auto;
}
.manny-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 0, 0.5);
  background: linear-gradient(135deg, #c9202f 0%, var(--brand-dark) 100%);
  color: var(--white);
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(0.76rem, 2.2vw, 0.9rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(175,24,49,0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.manny-cta:hover {
  transform: translateY(-2px);
  border-color: var(--ec-yellow);
  box-shadow: 0 12px 28px rgba(175,24,49,0.5);
}
.manny-cta:active { transform: translateY(0); }
.manny-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-glow), 0 10px 24px rgba(175,24,49,0.45);
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.manny-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(1.4rem, 5vw, 2rem);
  line-height: 1;
  letter-spacing: 0.04em;
}
.manny-title .word-manny { color: var(--brand); }
.manny-title .word-acierta { color: var(--ec-yellow); }
.manny-hint {
  font-size: 0.72rem;
  color: var(--grey);
  letter-spacing: 0.1em;
  font-style: italic;
}

/* Arc transition */
.hero-arc {
  width: calc(100% + 40px);
  height: 44px;
  background: var(--dark);
  border-radius: 50% 50% 0 0 / 44px 44px 0 0;
  margin-top: 28px;
  margin-left: -20px;
  position: relative;
  z-index: 2;
}

/* ══════════════════════════════
   FORM CARD
══════════════════════════════ */
.card {
  width: calc(100% - 32px);
  max-width: 620px;
  background: var(--mid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(22px, 5vw, 46px) clamp(18px, 5vw, 42px);
  margin: -22px auto 48px;
  position: relative;
  z-index: 3;
  box-shadow: 0 20px 70px rgba(0,0,0,0.65), 0 0 0 1px rgba(175,24,49,0.1);
  animation: slideUp 0.65s cubic-bezier(0.22,1,0.36,1) both;
}
/* Top accent line with Ecuador colors */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(to right, var(--ec-yellow) 0%, var(--ec-yellow) 40%, var(--ec-blue) 40%, var(--ec-blue) 70%, var(--ec-red) 70%, var(--ec-red) 100%);
  opacity: 0.7;
}
@keyframes slideUp {
  from { opacity:0; transform: translateY(28px); }
  to   { opacity:1; transform: translateY(0); }
}

.section-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-bubble {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
  border: 1px solid transparent;
}

.form-bubble.hidden {
  display: none;
}

.form-bubble.is-error {
  color: #ffd9df;
  background: rgba(175, 24, 49, 0.2);
  border-color: rgba(255, 120, 144, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 120, 144, 0.16);
}

.form-bubble.is-success {
  color: #cdfad3;
  background: rgba(46, 126, 63, 0.25);
  border-color: rgba(127, 240, 157, 0.45);
}

.form-step.hidden {
  display: none;
}

.verification-msg {
  margin: 6px 0 12px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--grey-light);
  min-height: 18px;
}

.verification-msg.is-error {
  color: #ffb8c2;
}

.verification-msg.is-success {
  color: #c8f6d0;
}

.terms-field {
  margin: 4px 0 14px;
}

.terms-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-family: 'Lato', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--grey-light);
  line-height: 1.45;
}

.terms-label input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  box-shadow: none;
  accent-color: var(--brand);
  flex-shrink: 0;
}

.terms-label a {
  color: var(--ec-yellow);
  text-decoration: underline;
}

.terms-field.invalid .terms-label {
  color: #ffd4da;
}

.terms-field.invalid input[type="checkbox"] {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-light);
}
label span.req { color: var(--brand); margin-left: 2px; }

input, select {
  background: var(--charcoal);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  color: var(--white);
  font-family: 'Lato', sans-serif;
  font-size: 0.94rem;
  padding: 12px 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
input::placeholder { color: var(--grey); }
input:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
input:hover, select:hover { border-color: #4a4a4a; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--brand);
  pointer-events: none;
}
select option { background: var(--charcoal); color: var(--white); }

/* ── FILE UPLOAD ── */
.upload-reference {
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 209, 0, 0.22);
  border-radius: 10px;
  padding: 12px;
}

.upload-reference-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ec-yellow);
  margin-bottom: 8px;
}

.upload-reference img {
  width: 100%;
  max-width: 280px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: block;
  margin: 0 auto;
}

.upload-reference-note {
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--grey-light);
}

.upload-zone {
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--charcoal);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--brand);
  background: rgba(175,24,49,0.06);
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
  padding: 0; border: none; background: transparent;
}
.upload-icon { font-size: 1.9rem; margin-bottom: 7px; display: block; }
.upload-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem; font-weight: 600;
  color: var(--grey-light); letter-spacing: 0.04em;
}
.upload-sub { font-size: 0.7rem; color: var(--grey); margin-top: 3px; }

.upload-preview {
  margin-top: 10px; display: none;
  align-items: center; gap: 10px;
  background: rgba(175,24,49,0.1);
  border-radius: 6px; padding: 8px 12px;
}
.upload-preview.show { display: flex; }
.upload-preview img {
  width: 46px; height: 46px;
  object-fit: cover; border-radius: 4px;
  border: 1px solid var(--brand);
}
.upload-preview .fname { font-size: 0.78rem; color: var(--grey-light); word-break: break-all; }
.upload-preview .remove-btn {
  margin-left: auto; background: none; border: none;
  color: var(--grey); font-size: 1.1rem; cursor: pointer; padding: 0 4px;
  transition: color 0.2s;
}
.upload-preview .remove-btn:hover { color: var(--brand); }

/* ── SUBMIT ── */
.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #c9202f 0%, var(--brand-dark) 100%);
  color: var(--white);
  border: none; border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(0.9rem, 3vw, 1.05rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 16px;
  cursor: pointer;
  margin-top: 6px;
  position: relative; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 22px rgba(175,24,49,0.4);
}
.submit-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 55%);
  pointer-events: none;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(175,24,49,0.55); }
.submit-btn:active { transform: translateY(0); }

.verify-btn {
  margin-top: 0;
}

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

/* ── SUCCESS ── */
.success-msg {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 20px 0;
  animation: fadeIn 0.5s ease both;
}
@keyframes fadeIn { from{opacity:0;transform:scale(0.95)} to{opacity:1;transform:scale(1)} }
.success-msg .checkmark {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9202f, var(--brand-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 28px rgba(175,24,49,0.5);
}
.success-msg h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 1.4rem; color: var(--white);
}
.success-msg p { color: var(--grey); font-size: 0.88rem; line-height: 1.7; }
.success-reminder {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(255, 209, 0, 0.08);
  border: 1px solid rgba(255, 209, 0, 0.4);
  border-radius: 10px;
  color: #c2c2c2;
  font-size: 0.84rem;
  line-height: 1.65;
  text-align: left;
}
.success-reminder p { color: #c2c2c2; font-size: 0.84rem; margin: 0 0 2px; }
.success-reminder strong { color: #FFD100; }
.reminder-social {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.reminder-social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #FFD100;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
  transition: opacity 0.2s;
}
.reminder-social-link:hover { opacity: 0.75; text-decoration: underline; }

/* ── COUNTDOWN WIDGET ── */
#countdownWidget {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 100;
  background: #ffffff;
  border: 1px solid rgba(175, 24, 49, 0.18);
  border-radius: 12px;
  padding: 15px 18px 17px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
  min-width: 212px;
  overflow: hidden;
}
#countdownWidget::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--ec-yellow) 0%, var(--ec-yellow) 40%, var(--ec-blue) 40%, var(--ec-blue) 70%, var(--ec-red) 70%, var(--ec-red) 100%);
  opacity: 1;
}
.countdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  margin-top: 2px;
}
.countdown-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #555;
  margin: 0;
}
.countdown-units {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  justify-content: center;
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.countdown-num {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.62rem;
  line-height: 1;
  color: var(--brand);
  text-shadow: none;
  min-width: 2ch;
  text-align: center;
  letter-spacing: -0.02em;
}
.countdown-unit-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.51rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
}
.countdown-sep {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--brand);
  line-height: 1;
  margin-top: 1px;
  user-select: none;
}
.countdown-toggle {
  display: none; /* solo visible en móvil */
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: rgba(0,0,0,0.07);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  color: #222;
  font-size: 1.25rem;
  font-weight: 900;
  font-family: 'Montserrat', sans-serif;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.countdown-toggle:hover { background: rgba(0,0,0,0.14); }

@media (max-width: 480px) {
  #countdownWidget {
    top: auto;
    bottom: 16px;
    right: 12px;
    padding: 14px 14px 15px;
    min-width: 178px;
  }
  .countdown-label { font-size: 0.52rem; }
  .countdown-num   { font-size: 1.32rem; }
  .countdown-toggle { display: flex; }

  /* Estado colapsado */
  #countdownWidget.is-collapsed {
    min-width: 0;
    width: 54px;
    height: 54px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #countdownWidget.is-collapsed .countdown-label,
  #countdownWidget.is-collapsed .countdown-units {
    display: none;
  }
  #countdownWidget.is-collapsed .countdown-header {
    margin: 0;
    justify-content: center;
  }
  #countdownWidget.is-collapsed .countdown-toggle {
    width: auto;
    height: auto;
    font-size: 1.6rem;
    color: var(--brand);
    background: none;
    border: none;
  }
}

/* ── CLOSED MESSAGE ── */
.closed-msg {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 20px 0;
  animation: fadeIn 0.5s ease both;
}
.closed-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9202f, var(--brand-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 28px rgba(175,24,49,0.5);
}
.closed-msg h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--white);
}
.closed-msg p {
  color: var(--grey-light);
  font-size: 0.9rem;
  line-height: 1.7;
}
.closed-msg strong {
  color: var(--ec-yellow);
}

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 0 20px 32px;
  font-size: 0.7rem;
  color: var(--grey);
  letter-spacing: 0.05em;
  position: relative;
}
footer::before {
  content: '';
  display: block;
  width: 60px; height: 3px;
  background: linear-gradient(to right, var(--ec-yellow), var(--ec-blue), var(--ec-red));
  border-radius: 2px;
  margin: 0 auto 14px;
  opacity: 0.5;
}
footer a { color: var(--brand); text-decoration: none; }
