/* ============================================
   Cooeducar — Elige tu detalle
   Diseño amigable, limpio y profesional
   ============================================ */

:root {
  --verde: #1e7b34;
  --verde-oscuro: #166329;
  --verde-suave: #e8f5ec;
  --verde-claro: #d4edda;
  --amarillo: #f2c94c;
  --amarillo-oscuro: #e6b73d;
  --amarillo-suave: #fef9e7;
  --blanco: #ffffff;
  --gris-900: #1a2e22;
  --gris-600: #4a6354;
  --gris-400: #7a8f82;
  --gris-200: #c5d4cb;
  --error: #b91c1c;
  --sombra-sm: 0 2px 8px rgba(26, 46, 34, 0.06);
  --sombra-md: 0 6px 20px rgba(26, 46, 34, 0.08);
  --sombra-lg: 0 14px 40px rgba(26, 46, 34, 0.12);
  --sombra-card: 0 4px 16px rgba(26, 46, 34, 0.06);
  --radio: 14px;
  --radio-lg: 22px;
  --radio-xl: 28px;
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-titulo: "Fraunces", Georgia, serif;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gris-900);
  background: linear-gradient(165deg, #f0f7f2 0%, #e8f2ec 35%, #f5faf6 70%, #eef6f1 100%);
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 360px) {
  body {
    font-size: 0.9375rem;
  }
}

/* ---- App contenedor (responsive) ---- */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
@media (min-width: 400px) {
  .app {
    padding: 2rem 1.5rem 4rem;
  }
}
.app.app--wide {
  max-width: 720px;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 560px) {
  .app.app--wide {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ---- Header ---- */
.site-header {
  flex-shrink: 0;
  margin-bottom: 2.25rem;
  padding: 1.25rem 0;
}
.site-header__inner {
  text-align: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand__logo {
  max-height: 48px;
  max-width: 160px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(26, 46, 34, 0.08));
}
@media (min-width: 400px) {
  .brand__logo {
    max-height: 56px;
    max-width: 200px;
  }
}
.brand__name {
  font-family: var(--font-titulo);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--verde);
}
@media (min-width: 400px) {
  .brand__name {
    font-size: 1.85rem;
  }
}
.badge {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--verde-oscuro);
  background: linear-gradient(135deg, var(--verde-suave) 0%, var(--verde-claro) 100%);
  border-radius: 100px;
  letter-spacing: 0.03em;
  box-shadow: var(--sombra-sm);
}

/* ---- Main / Steps ---- */
.main {
  flex: 1;
}

.step {
  animation: stepIn 0.4s ease-out;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.step__content {
  background: var(--blanco);
  border-radius: var(--radio-xl);
  padding: 2.25rem 1.75rem;
  box-shadow: var(--sombra-md);
  border: 1px solid rgba(197, 212, 203, 0.5);
}
.step__content--wide {
  padding: 2.25rem 1.75rem;
}
@media (min-width: 560px) {
  .step__content--wide {
    padding: 2.5rem 2rem;
  }
}
.step__content--narrow {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  padding: 2.75rem 2rem;
}

.step__welcome {
  font-size: 1.05rem;
  color: var(--gris-900);
  background: linear-gradient(90deg, var(--amarillo-suave) 0%, #fefce8 100%);
  border-left: 4px solid var(--amarillo);
  padding: 1.1rem 1.35rem;
  border-radius: 0 var(--radio) var(--radio) 0;
  margin: 0 0 1.75rem;
  line-height: 1.55;
  box-shadow: var(--sombra-sm);
}
.step__greeting {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--verde);
  margin: 0 0 1rem;
}
.step__title {
  font-family: var(--font-titulo);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gris-900);
  margin: 0 0 0.6rem;
  line-height: 1.25;
}
.step__title--success {
  font-size: 1.7rem;
  color: var(--verde);
}
.step__desc {
  font-size: 0.975rem;
  color: var(--gris-600);
  margin: 0 0 1.75rem;
  line-height: 1.55;
}

/* ---- Formulario ---- */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.form__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gris-900);
  display: block;
}
.form__input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--gris-900);
  background: #f8faf9;
  border: 2px solid var(--gris-200);
  border-radius: var(--radio);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form__input::placeholder {
  color: var(--gris-400);
}
.form__input:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 4px rgba(30, 123, 52, 0.12);
}
.form__message {
  margin: 0;
  font-size: 0.9rem;
  min-height: 1.4em;
}
.form__message--error {
  color: var(--error);
}
.form__message--ok {
  color: var(--verde);
}
.form__message--info {
  color: var(--gris-600);
}

/* ---- Ya votó: resumen con imagen ---- */
.ya-voto-resumen {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--verde-suave);
  border: 1px solid rgba(30, 123, 52, 0.2);
  border-radius: var(--radio-lg);
}
.ya-voto-resumen__texto {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gris-900);
  margin: 0 0 1rem;
}
.ya-voto-resumen__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: var(--blanco);
  border-radius: var(--radio);
  padding: 1rem;
  max-width: 280px;
  margin: 0 auto;
}
.ya-voto-resumen__img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: var(--radio);
}
.ya-voto-resumen__titulo {
  font-family: var(--font-titulo);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--verde);
  margin: 0;
  text-align: center;
}
.ya-voto-resumen__captura {
  font-size: 0.9rem;
  color: var(--gris-600);
  margin: 1rem 0 0;
}

/* ---- Botón ---- */
.btn {
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radio);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  min-height: 48px;
  touch-action: manipulation;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn--primary {
  background: var(--verde);
  color: var(--blanco);
}
.btn--primary:hover:not(:disabled) {
  background: var(--verde-oscuro);
  box-shadow: 0 4px 16px rgba(30, 123, 52, 0.25);
  transform: translateY(-1px);
}
.btn--elegir {
  background: var(--verde);
  color: var(--blanco);
}
.btn--elegir:hover:not(:disabled) {
  background: var(--verde-oscuro);
  box-shadow: 0 4px 16px rgba(30, 123, 52, 0.25);
  transform: translateY(-1px);
}
.btn--secondary {
  background: var(--blanco);
  color: var(--gris-600);
  border: 2px solid var(--gris-200);
}
.btn--secondary:hover:not(:disabled) {
  background: #f4f8f5;
  border-color: var(--gris-400);
}

/* ---- Modal confirmación (estilo Cooeducar, responsive) ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] {
  display: none;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 46, 34, 0.4);
  cursor: pointer;
}
.modal__box {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow: auto;
  background: var(--blanco);
  border-radius: var(--radio-xl);
  box-shadow: var(--sombra-lg);
  border: 1px solid var(--gris-200);
  padding: 1.75rem;
}
.modal__titulo {
  font-family: var(--font-titulo);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gris-900);
  margin: 0 0 0.75rem;
  line-height: 1.3;
}
.modal__detalle {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--verde);
  margin: 0 0 1rem;
}
.modal__imagen {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: var(--radio);
  background: #f4f8f5;
  margin-bottom: 1.25rem;
}
.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}
.modal__actions .btn {
  min-height: 48px;
  min-width: 120px;
}

@media (max-width: 380px) {
  .modal__box {
    padding: 1.25rem;
  }
  .modal__titulo {
    font-size: 1.2rem;
  }
  .modal__actions {
    flex-direction: column;
  }
  .modal__actions .btn {
    width: 100%;
  }
}

/* ---- Grid de detalles (responsive) ---- */
.detalles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}
@media (min-width: 560px) {
  .detalles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }
}
@media (max-width: 359px) {
  .detalles-grid {
    gap: 1rem;
  }
}

/* Tarjeta de detalle: imagen + título + descripción + botón Elegir */
.articulo-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  padding: 0;
  font-family: inherit;
  color: var(--gris-900);
  background: var(--blanco);
  border: 1px solid var(--gris-200);
  border-radius: var(--radio-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(26, 46, 34, 0.08);
  animation: cardIn 0.4s ease-out backwards;
  transition: box-shadow 0.25s, transform 0.2s, border-color 0.2s;
}
.articulo-card:hover {
  box-shadow: 0 10px 28px rgba(26, 46, 34, 0.12);
  border-color: rgba(30, 123, 52, 0.3);
}
.articulo-card:nth-child(1) { animation-delay: 0.05s; }
.articulo-card:nth-child(2) { animation-delay: 0.1s; }
.articulo-card:nth-child(3) { animation-delay: 0.15s; }
.articulo-card:nth-child(4) { animation-delay: 0.2s; }
.articulo-card:nth-child(5) { animation-delay: 0.25s; }
.articulo-card:nth-child(6) { animation-delay: 0.3s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Imagen completa (sin recortar): contain + altura suficiente */
.articulo-card .articulo-img-wrap {
  width: 100%;
  min-height: 200px;
  padding: 1.5rem;
  background: linear-gradient(180deg, #f0f5f2 0%, #e5ede8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.articulo-card .articulo-img-wrap--error::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--verde-suave) 0%, #e0ebe3 100%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 24 24' fill='none' stroke='%234a6354' stroke-width='1.5' stroke-linecap='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 64px;
}
.articulo-card .articulo-img {
  width: 100%;
  height: auto;
  max-height: 260px;
  display: block;
  object-fit: contain;
  object-position: center;
}

.articulo-card .articulo-body {
  padding: 1.4rem 1.5rem 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

/* Título del detalle */
.articulo-card .articulo-titulo {
  font-family: var(--font-titulo);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--gris-900);
  margin: 0 0 0.6rem 0;
  padding: 0;
}

/* Descripción */
.articulo-card .articulo-desc {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--gris-600);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Botón Elegir */
.articulo-card .btn--elegir {
  margin: 1.25rem 1.5rem 1.5rem;
  width: 100%;
  max-width: 100%;
  cursor: pointer;
}

/* Tarjeta agotada: desvanecida y no se puede votar */
.articulo-card--agotado {
  opacity: 0.55;
  pointer-events: none;
}
.articulo-card--agotado:hover {
  box-shadow: 0 2px 12px rgba(26, 46, 34, 0.08);
  border-color: var(--gris-200);
}
.articulo-card--agotado .articulo-img-wrap {
  position: relative;
}
.articulo-card__badge-agotado {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: #94a3b8;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  z-index: 1;
}
.articulo-card__agotado {
  display: block;
  margin: 1.25rem 1.5rem 1.5rem;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gris-600);
  background: var(--gris-200, #e5e7eb);
  border-radius: var(--radio);
}

/* ---- Paso gracias ---- */
.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(145deg, var(--verde) 0%, #25903f 100%);
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(30, 123, 52, 0.35);
  animation: successPop 0.5s ease-out 0.1s backwards;
}
@keyframes successPop {
  0% { opacity: 0; transform: scale(0.5); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
.step__confirmacion {
  font-size: 1rem;
  font-weight: 600;
  color: var(--verde);
  margin: 0.5rem 0 0;
  line-height: 1.4;
}
.step__elegido-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gris-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1.25rem 0 0.5rem;
}
.step__elegido-titulo {
  font-family: var(--font-titulo);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--verde);
  background: var(--verde-suave);
  border: 2px solid rgba(30, 123, 52, 0.25);
  border-radius: var(--radio);
  padding: 1rem 1.25rem;
  margin: 0;
  line-height: 1.3;
}
.step__thanks {
  font-size: 1.05rem;
  color: var(--gris-600);
  line-height: 1.6;
  margin: 1.25rem 0 0;
}
.step__captura {
  font-size: 0.95rem;
  color: var(--gris-400);
  line-height: 1.5;
  margin: 0.75rem 0 0;
}

/* ---- Footer ---- */
.site-footer {
  flex-shrink: 0;
  text-align: center;
  margin-top: auto;
  padding-top: 2.5rem;
}
.site-footer__text {
  font-size: 0.875rem;
  color: var(--gris-400);
  margin: 0;
}
