/* ============================================================
   Las Chichas del 73 — Estilos (art déco, verde & oro)
   ============================================================ */

:root {
  --verde-profundo: #06231a;
  --verde-oscuro: #07120d;
  --oro: #d4af37;
  --oro-claro: #f0d77b;
  --oro-oscuro: #b8902a;
  --crema: #f5ecd0;
  --sombra: rgba(0, 0, 0, 0.6);
}

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

html, body {
  min-height: 100%;
}

body {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--crema);
  background-color: var(--verde-oscuro);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ---------- Tipografía ---------- */
h1, h2, h3, .deco {
  font-family: "Cinzel", "Times New Roman", serif;
  letter-spacing: 0.08em;
  color: var(--oro);
}

a { color: var(--oro-claro); }

/* ============================================================
   HOME — fondo con la foto
   ============================================================ */
.home {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--verde-oscuro) url("../assets/fondo.jpg") center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  /* La foto ya trae el título; situamos el formulario en la zona
     central-baja (la "pista" del suelo de la imagen). */
  align-items: flex-end;
}

.home::before {
  /* velo oscuro para legibilidad del formulario */
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center 78%, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 45%, rgba(0,0,0,0) 70%);
  pointer-events: none;
}

.home .gate {
  position: relative;
  margin-bottom: 2.5vh;
}

/* ============================================================
   Tarjeta / panel déco
   ============================================================ */
.panel {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(160deg, rgba(8,40,29,0.92), rgba(4,20,14,0.94));
  border: 1px solid var(--oro);
  box-shadow: 0 0 0 4px rgba(212,175,55,0.12), 0 18px 48px var(--sombra);
  border-radius: 4px;
  padding: 28px 26px 30px;
  text-align: center;
  backdrop-filter: blur(3px);
}

/* Panel de la clave: más compacto */
.panel--gate {
  max-width: 360px;
  padding: 22px 22px 24px;
}
.panel--gate .panel-title {
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}
.panel--gate .panel-sub {
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.panel--gate {
  background: linear-gradient(160deg, rgba(8,40,29,0.78), rgba(4,20,14,0.82));
}

/* esquinas déco decorativas */
.panel .corner {
  position: absolute;
}

.panel-title {
  font-size: 1.5rem;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.panel-sub {
  font-size: 1.02rem;
  color: var(--crema);
  opacity: 0.85;
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.35;
}

.divider {
  width: 60px;
  height: 1px;
  margin: 14px auto;
  background: linear-gradient(90deg, transparent, var(--oro), transparent);
  position: relative;
}
.divider::after {
  content: "❖";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--oro);
  font-size: 12px;
  background: transparent;
}

/* ============================================================
   Formularios
   ============================================================ */
.field {
  text-align: left;
  margin-bottom: 16px;
}

label {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oro-claro);
  margin-bottom: 7px;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 13px 14px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.1rem;
  color: var(--crema);
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--oro-oscuro);
  border-radius: 3px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input::placeholder { color: rgba(245,236,208,0.45); }

input:focus,
select:focus {
  border-color: var(--oro-claro);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.18);
}

select option { background: var(--verde-profundo); color: var(--crema); }

/* Botón déco */
.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 18px;
  margin-top: 6px;
  font-family: "Cinzel", serif;
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--verde-oscuro);
  background: linear-gradient(180deg, var(--oro-claro), var(--oro), var(--oro-oscuro));
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: transform .08s ease, filter .2s;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }

.msg {
  margin-top: 14px;
  font-size: 1rem;
  min-height: 1.2em;
}
.msg.error { color: #ff9a8b; }
.msg.ok { color: var(--oro-claro); }

/* sacudida al fallar la clave */
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease both; }

/* ============================================================
   Páginas internas (cuestionario / invitación)
   ============================================================ */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at top, rgba(8,55,40,0.55), transparent 60%),
    var(--verde-oscuro);
  padding: 40px 18px 60px;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
}

.page-header {
  text-align: center;
  margin-bottom: 28px;
}
.page-header h1 {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  text-transform: uppercase;
}
.page-header p {
  opacity: 0.8;
  font-style: italic;
  margin-top: 6px;
}

.card {
  background: linear-gradient(160deg, rgba(8,40,29,0.7), rgba(4,20,14,0.8));
  border: 1px solid var(--oro-oscuro);
  border-radius: 4px;
  padding: 22px 22px 24px;
  margin-bottom: 18px;
}

/* Pregunta */
.q-title {
  font-family: "Cinzel", serif;
  color: var(--oro-claro);
  font-size: 1.05rem;
  margin-bottom: 14px;
  line-height: 1.35;
}

.options { list-style: none; display: grid; gap: 10px; }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--oro-oscuro);
  border-radius: 3px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  font-size: 1.08rem;
}
.option:hover { background: rgba(212,175,55,0.08); }
.option input { accent-color: var(--oro); width: 18px; height: 18px; flex: none; }
.option.selected { border-color: var(--oro-claro); background: rgba(212,175,55,0.12); }

/* ============================================================
   Invitación
   ============================================================ */
.invite-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--verde-oscuro) url("../assets/fondo.jpg") center center / cover no-repeat fixed;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.invite-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at center 28%, rgba(212,175,55,0.12), transparent 60%),
    rgba(2, 10, 7, 0.72);
  pointer-events: none;
}

.invite-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  padding: 40px 18px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tarjeta con doble marco dorado */
.invite-card {
  position: relative;
  width: 100%;
  text-align: center;
  color: var(--crema);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.12), transparent 55%),
    linear-gradient(160deg, rgba(7,30,21,0.96), rgba(3,14,9,0.97));
  border: 2px solid var(--oro);
  box-shadow:
    0 0 26px rgba(212,175,55,0.20),
    0 0 0 1px rgba(212,175,55,0.45) inset,
    0 26px 70px var(--sombra);
  border-radius: 3px;
  padding: 7px;
  backdrop-filter: blur(2px);
}
/* marco interior fino */
.invite-inner {
  position: relative;
  border: 1px solid rgba(212,175,55,0.55);
  border-radius: 2px;
  padding: 44px 30px 40px;
}

/* esquinas ornamentadas (SVG) */
.invite-corner {
  position: absolute;
  width: 42px;
  height: 42px;
  z-index: 2;
}
.invite-corner.tl { top: 5px; left: 5px; }
.invite-corner.tr { top: 5px; right: 5px; transform: rotate(90deg); }
.invite-corner.br { bottom: 5px; right: 5px; transform: rotate(180deg); }
.invite-corner.bl { bottom: 5px; left: 5px; transform: rotate(270deg); }

/* Texto con degradado dorado */
.gold-text {
  background: linear-gradient(180deg, #fff3c4 0%, #f0d77b 28%, #d4af37 55%, #9c7414 80%, #e7c869 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 7px rgba(0,0,0,0.55));
}

/* Ornamentos */
.deco-fan {
  display: block;
  width: 152px;
  height: auto;
  margin: 0 auto 4px;
}
.deco-rule {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 16px auto;
}

.invite-eyebrow {
  font-family: "Cinzel", serif;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--oro-claro);
  opacity: 0.92;
  margin: 4px 0 12px;
  text-indent: 0.4em;
}

.invite-title {
  font-family: "Cinzel Decorative", "Cinzel", serif;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.28;
  font-size: clamp(1.55rem, 5.6vw, 2.5rem);
  letter-spacing: 0.07em;
  word-spacing: 0.4em;
}

.invite-querida {
  font-family: "Cinzel", serif;
  font-size: 1.28rem;
  font-weight: 600;
  margin: 18px 0 14px;
}

.invite-texto {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.22rem;
  line-height: 1.5;
  margin: 12px auto;
  max-width: 470px;
}
.invite-texto strong { color: var(--oro-claro); font-weight: 600; }
.invite-texto em { color: var(--oro-claro); font-style: italic; }

.invite-imprimir-aviso {
  font-size: 1.08rem;
  opacity: 0.92;
}

/* Bloque fecha / lugar / hora */
.invite-detalles {
  list-style: none;
  margin: 24px auto 18px;
  max-width: 430px;
  display: grid;
  gap: 16px;
  padding: 24px 0;
  position: relative;
}
.invite-detalles::before,
.invite-detalles::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--oro), transparent);
}
.invite-detalles::before { top: 0; }
.invite-detalles::after { bottom: 0; }

.invite-detalles li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detalle-label {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--oro);
  opacity: 0.9;
}
.detalle-valor {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.4rem;
  color: var(--crema);
  font-weight: 600;
}

.invite-lema {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.55rem, 5.6vw, 2.2rem);
  line-height: 1.25;
  margin: 22px auto 8px;
  max-width: 480px;
}

.invite-secreto {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.02rem;
  font-style: italic;
  opacity: 0.84;
  line-height: 1.45;
  max-width: 450px;
  margin: 8px auto 0;
}
.invite-secreto strong { color: var(--oro-claro); font-weight: 600; }

.invite-print-btn {
  width: auto;
  min-width: 260px;
  margin-top: 30px;
}

/* ---- Impresión: todo en UNA sola hoja ---- */
@media print {
  @page { size: A4; margin: 8mm; }
  body.invite-page {
    background: #ffffff !important;
    display: block;
  }
  .invite-page::before { display: none !important; }
  .invite-wrap { max-width: 100%; padding: 0; }
  .invite-card {
    background: linear-gradient(160deg, #07261b, #030f0a) !important;
    box-shadow: none;
    border: 2px solid #b8902a;
    backdrop-filter: none;
    page-break-inside: avoid;
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .gold-text {
    -webkit-text-fill-color: #e7c259 !important;
    color: #e7c259 !important;
    filter: none;
  }

  /* Compactamos espacios y tamaños para que quepa en una página */
  .invite-inner { padding: 22px 26px 20px; }
  .deco-fan { width: 96px; margin-bottom: 0; }
  .invite-eyebrow { margin: 2px 0 6px; font-size: 0.68rem; letter-spacing: 0.34em; }
  .invite-title { font-size: 1.85rem; line-height: 1.12; }
  .deco-rule { margin: 8px auto; max-width: 240px; }
  .invite-querida { font-size: 1.1rem; margin: 8px 0 6px; }
  .invite-texto { font-size: 1.02rem; line-height: 1.34; margin: 6px auto; }
  .invite-imprimir-aviso { font-size: 0.96rem; }
  .invite-detalles { margin: 12px auto 8px; padding: 12px 0; gap: 9px; }
  .detalle-label { font-size: 0.66rem; }
  .detalle-valor { font-size: 1.18rem; }
  .invite-lema { font-size: 1.5rem; line-height: 1.2; margin: 12px auto 4px; }
  .invite-secreto { font-size: 0.9rem; line-height: 1.35; margin-top: 4px; }

  .invite-print-btn { display: none !important; }
  canvas { display: none !important; }
}

/* ============================================================
   Modal "no superado"
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 10, 7, 0.82);
  backdrop-filter: blur(4px);
  z-index: 100;
}
.modal-overlay.visible {
  display: flex;
  animation: fade-in 0.2s ease both;
}

.modal-box {
  width: 100%;
  max-width: 380px;
  text-align: center;
  background: linear-gradient(160deg, rgba(8,40,29,0.97), rgba(4,20,14,0.98));
  border: 2px solid var(--oro);
  border-radius: 4px;
  box-shadow: 0 0 0 5px rgba(212,175,55,0.12), 0 24px 60px var(--sombra);
  padding: 30px 26px 28px;
  animation: pop-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.modal-titulo {
  font-size: 1.5rem;
  text-transform: uppercase;
}
.modal-texto {
  font-size: 1.12rem;
  color: var(--crema);
  margin: 4px 0 22px;
  line-height: 1.4;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
  .panel { padding: 24px 20px 26px; }
  .panel--gate { padding: 20px 18px 22px; }
  .panel-title { font-size: 1.25rem; }
  .home .gate { margin-bottom: 1.5vh; }
}
