/* =============================================================
   ESTILOS PRINCIPALES - Ruleta Ferrevolt
   Mobile-first | Paleta: #C8102E #1A1A1A #2A9D8F #F4A261
   ============================================================= */

/* === VARIABLES CSS === */
:root {
  --primario:      #C8102E;
  --primario-dark: #a00d24;
  --secundario:    #1A1A1A;
  --acento-verde:  #2A9D8F;
  --acento-amarillo: #F4A261;
  --fondo:         #FFFFFF;
  --fondo-gris:    #F5F5F5;
  --texto:         #1A1A1A;
  --texto-suave:   #6B7280;
  --borde:         #E5E7EB;
  --sombra:        0 4px 24px rgba(0,0,0,.08);
  --radio:         12px;
  --radio-sm:      8px;
  --fuente:        'Poppins', sans-serif;
}

/* === RESET Y BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--fuente);
  background: var(--fondo-gris);
  color: var(--texto);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--primario); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === HEADER === */
.site-header {
  background: var(--secundario);
  color: #fff;
  padding: 1rem 1.5rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.site-header .logo-text {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--primario);
  text-transform: uppercase;
}

.site-header .tagline {
  font-size: .75rem;
  color: #aaa;
  letter-spacing: 1px;
}

/* === CONTENEDOR PRINCIPAL === */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.container-wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* === HERO / TÍTULO === */
.hero {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
}

.hero h1 {
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 800;
  color: var(--secundario);
  margin-bottom: .5rem;
  line-height: 1.2;
}

.hero h1 span { color: var(--primario); }

.hero p {
  color: var(--texto-suave);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* === TARJETA === */
.card {
  background: var(--fondo);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

/* === FORMULARIO === */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--texto);
  margin-bottom: .4rem;
}

.form-group label span.req { color: var(--primario); }

.form-control {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid var(--borde);
  border-radius: var(--radio-sm);
  font-size: 1rem;
  font-family: var(--fuente);
  color: var(--texto);
  background: var(--fondo);
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primario);
  box-shadow: 0 0 0 3px rgba(200,16,46,.15);
}

.form-control.is-invalid {
  border-color: var(--primario);
}

.form-control.is-valid {
  border-color: var(--acento-verde);
}

.form-feedback {
  font-size: .8rem;
  margin-top: .3rem;
  display: none;
}

.form-feedback.error { color: var(--primario); display: block; }
.form-feedback.valid { color: var(--acento-verde); display: block; }

/* === BOTONES === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .875rem 2rem;
  border: none;
  border-radius: var(--radio-sm);
  font-family: var(--fuente);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  letter-spacing: .5px;
}

.btn-primary {
  background: var(--primario);
  color: #fff;
  box-shadow: 0 4px 15px rgba(200,16,46,.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primario-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,16,46,.4);
}

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

.btn-full { width: 100%; }

.btn-secondary {
  background: var(--secundario);
  color: #fff;
}

.btn-secondary:hover {
  background: #333;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primario);
  color: var(--primario);
}

.btn-outline:hover {
  background: var(--primario);
  color: #fff;
}

.btn-lg {
  padding: 1.1rem 2.5rem;
  font-size: 1.1rem;
}

/* === BADGE DE CONDICIONES === */
.badge-monto {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, var(--primario), var(--primario-dark));
  color: #fff;
  border-radius: 50px;
  padding: .5rem 1.25rem;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

/* === SEPARADOR CON TEXTO === */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--texto-suave);
  font-size: .875rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--borde);
}

/* === RULETA (Canvas) === */
.ruleta-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
}

.ruleta-container {
  position: relative;
  width: 420px;
  max-width: 100%;
}

/* Indicador (flecha) que apunta al premio ganador */
.ruleta-indicador {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid var(--primario);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
  z-index: 10;
}

#canvas-ruleta {
  border-radius: 50%;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  display: block;
  max-width: 100%;
}

.btn-girar {
  font-size: 1.2rem;
  padding: 1rem 3rem;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--primario), var(--primario-dark));
  color: #fff;
  border: none;
  font-family: var(--fuente);
  font-weight: 800;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 6px 25px rgba(200,16,46,.4);
  letter-spacing: 1px;
}

.btn-girar:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(200,16,46,.5);
}

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

/* === RESULTADO === */
.resultado-wrapper {
  text-align: center;
  padding: 2rem 1rem;
}

.confetti-text {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: bounce .6s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}

.resultado-titulo {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 800;
  color: var(--secundario);
  margin-bottom: .5rem;
}

.resultado-premio {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 700;
  color: var(--primario);
  margin: 1rem 0;
}

.cupon-box {
  background: var(--fondo-gris);
  border: 3px dashed var(--borde);
  border-radius: var(--radio);
  padding: 1.5rem;
  margin: 1.5rem auto;
  max-width: 400px;
}

.cupon-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: .5rem;
}

.cupon-codigo {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 900;
  color: var(--secundario);
  letter-spacing: 4px;
  word-break: break-all;
}

.cupon-vencimiento {
  font-size: .9rem;
  color: var(--texto-suave);
  margin-top: .75rem;
}

.info-email {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radio-sm);
  padding: 1rem 1.25rem;
  font-size: .9rem;
  color: #166534;
  margin: 1rem auto;
  max-width: 400px;
}

/* === ALERTAS / MENSAJES === */
.alert {
  padding: .875rem 1.25rem;
  border-radius: var(--radio-sm);
  font-size: .9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

/* === SPINNER / LOADING === */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* === FOOTER === */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--texto-suave);
  font-size: .8rem;
  border-top: 1px solid var(--borde);
  margin-top: 2rem;
}

/* === UTILITARIOS === */
.text-center { text-align: center; }
.text-muted   { color: var(--texto-suave); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-none { display: none !important; }

/* === RESPONSIVE === */
@media (min-width: 640px) {
  .container { padding: 2rem 1.5rem; }
  .card { padding: 2.5rem; }
  .hero h1 { font-size: 2.2rem; }
}

@media (min-width: 768px) {
  .hero { padding: 3rem 1.5rem 2rem; }
}

/* === reCAPTCHA badge (mantener visible según TOS) === */
.grecaptcha-badge {
  z-index: 1000;
}

/* === CHECKBOX TÉRMINOS === */
.terminos-group {
  background: var(--fondo-gris);
  border: 2px solid var(--borde);
  border-radius: var(--radio-sm);
  padding: .875rem 1rem;
}

.terminos-group.is-invalid {
  border-color: var(--primario);
}

.terminos-label {
  display: flex !important;
  align-items: flex-start;
  gap: .65rem;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 400 !important;
  margin-bottom: 0 !important;
  line-height: 1.5;
}

.terminos-label input[type="checkbox"] {
  margin-top: .15rem;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primario);
  cursor: pointer;
}

.terminos-link {
  color: var(--primario);
  font-weight: 600;
  text-decoration: underline;
}

