/* Mobile first: estilos básicos para smartphones */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: sans-serif;
  background-color: #0f172a;
  color: #fff;
}

.relative {
  position: relative;
  width: 100%;
}

.hero {
  height: auto;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
}

.overlay h1 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.subscribe-btn {
  display: inline-block;
  width: 80%;
  max-width: 280px;
  padding: 1rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: 9999px;
  background: linear-gradient(to right, #ec4899,#38bdf8,#6366f1);
  color: #fff;
  text-decoration: none;
  transition: transform .3s, box-shadow .3s, background-position .3s;
  background-size: 200% 100%;
  background-position: left;
}
.subscribe-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 15px rgba(0,0,0,0.3);
  background-position: right;
}

/* Modal oculto por defecto */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  overflow-y: auto;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.active {
  display: flex;
}

.modal-container {
  background: #1e293b;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 90%;
  width: 100%;
  color: #fff;
}

/* Grid del formulario */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.form-grid .field {
  width: 100%;
}
.form-grid label {
  display: block;
  margin-bottom: .25rem;
  font-size: .875rem;
  font-weight: 600;
}
.form-grid input,
.form-grid textarea {
  width: 100%;
  padding: .5rem 1rem;
  border: 1px solid #334155;
  border-radius: .5rem;
  background: #374151;
  color: #fff;
  font-size: 1rem;
}
.form-grid input:focus,
.form-grid textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px #38bdf8;
}

/* Botones del formulario */
.btn {
  padding: .5rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.btn-cancel {
  background: #dc2626;
  color: #fff;
}
.btn-cancel:hover {
  background: #b91c1c;
}
.btn-submit {
  background: #4ade80;
  color: #111827;
  border: 2px solid #86efac;
}
.btn-submit:hover {
  background: #22c55e;
  transform: scale(1.05);
}

/* Spinner de carga */
#modalCarga svg {
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==== Media Queries ==== */
@media (min-width: 640px) {
  .overlay h1 {
    font-size: 2.5rem;
  }
  .subscribe-btn {
    font-size: 1.25rem;
  }
}

@media (min-width: 768px) {
  .hero {
    height: 100vh;
  }
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-container {
    max-width: 800px;
    margin-top: 2rem;
  }
}

@media (min-width: 1024px) {
  .overlay h1 {
    font-size: 3rem;
  }
  .subscribe-btn {
    max-width: 320px;
  }
}
