/* =========================================================================
   Fiesta de 15 — hoja de estilos
   Paleta romántica rosa/crema. Todo mobile-first: los invitados entran
   por QR desde el celular.
   ========================================================================= */

:root {
  --crema: #fdf6f0;
  --crema-hondo: #f6e7de;
  --papel: #fffbf8;
  --rosa: #e8b4b8;
  --rosa-suave: #f4d9db;
  --rosa-fuerte: #c9737f;
  --vino: #7a3b52;
  --texto: #4a3640;
  --tenue: #a9959c;
  --oro: #c9a86c;

  --sombra-sutil: 0 1px 2px rgba(122, 59, 82, 0.06),
    0 4px 16px rgba(122, 59, 82, 0.06);
  --sombra-media: 0 2px 4px rgba(122, 59, 82, 0.08),
    0 12px 32px rgba(122, 59, 82, 0.1);
  --sombra-alta: 0 8px 24px rgba(122, 59, 82, 0.14),
    0 24px 60px rgba(122, 59, 82, 0.16);

  --radio: 18px;
  --radio-chico: 12px;

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --script: "Parisienne", "Snell Roundhand", cursive;
  --sans: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--texto);
  background-color: var(--crema);
  /* Halos rosados difusos: dan profundidad sin cargar una imagen. */
  background-image: radial-gradient(
      ellipse 60% 45% at 15% 0%,
      rgba(232, 180, 184, 0.28),
      transparent 60%
    ),
    radial-gradient(
      ellipse 50% 40% at 90% 12%,
      rgba(244, 217, 219, 0.4),
      transparent 62%
    ),
    radial-gradient(
      ellipse 70% 50% at 50% 100%,
      rgba(232, 180, 184, 0.2),
      transparent 65%
    );
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ layout */

.envoltorio {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

/* -------------------------------------------------------------- portada */

.portada {
  text-align: center;
  margin-bottom: 30px;
}

.marco-foto {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto 20px;
}

.marco-foto::before {
  /* Aro exterior fino, separado de la foto: el detalle de "marco" */
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid var(--rosa);
  border-radius: 50%;
  opacity: 0.75;
}

.marco-foto img,
.marco-foto .sin-foto {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 4px solid var(--papel);
  box-shadow: var(--sombra-media);
}

.marco-foto .sin-foto {
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--rosa-suave), var(--crema-hondo));
  color: var(--rosa-fuerte);
  font-family: var(--script);
  font-size: 2.6rem;
}

.titulo {
  font-family: var(--script);
  font-size: clamp(3.4rem, 17vw, 4.6rem);
  font-weight: 400;
  line-height: 0.95;
  margin: 0;
  color: var(--vino);
  /* El script tiene descendentes largos; el padding evita el recorte. */
  padding-bottom: 0.12em;
}

.nombre-cumple {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rosa-fuerte);
  margin: 6px 0 0;
}

.datos-fiesta {
  /* Flex y no texto corrido: con separadores inline, un lugar largo cortaba
     a mitad de palabra y el punto quedaba colgado al final del renglón. */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tenue);
  margin: 14px auto 0;
  max-width: 30ch;
}

.datos-fiesta span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* El separador va pegado al dato anterior (::after y no ::before del
   siguiente) para que al cortar el renglón no quede un punto huérfano
   abriendo la línea de abajo. */
.datos-fiesta span:not(:last-child)::after {
  content: "·";
  color: var(--rosa);
}

.bienvenida {
  font-family: var(--serif);
  font-size: 1.18rem;
  font-style: italic;
  color: var(--texto);
  margin: 18px auto 0;
  max-width: 34ch;
  line-height: 1.5;
}

/* ------------------------------------------------------------- ornamento */

.ornamento {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0;
  color: var(--rosa);
}

.ornamento::before,
.ornamento::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rosa), transparent);
}

.ornamento svg {
  width: 15px;
  height: 15px;
  flex: none;
}

/* ---------------------------------------------------------------- tarjeta */

.tarjeta {
  background: var(--papel);
  border: 1px solid rgba(232, 180, 184, 0.45);
  border-radius: var(--radio);
  padding: 24px 20px;
  box-shadow: var(--sombra-sutil);
}

/* ------------------------------------------------------------------ campos */

.campo {
  margin-bottom: 20px;
}

.campo:last-child {
  margin-bottom: 0;
}

.campo > label,
.rotulo {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vino);
  margin-bottom: 7px;
}

.ayuda {
  font-size: 0.78rem;
  color: var(--tenue);
  margin: 6px 0 0;
  line-height: 1.4;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--texto);
  background: var(--crema);
  border: 1px solid var(--rosa-suave);
  border-radius: var(--radio-chico);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
  /* Evita el zoom automático de iOS al enfocar un input. */
  font-size: max(1.05rem, 16px);
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--tenue);
  opacity: 0.75;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--rosa-fuerte);
  background: var(--papel);
  box-shadow: 0 0 0 3px rgba(201, 115, 127, 0.16);
}

textarea {
  resize: vertical;
  min-height: 104px;
  line-height: 1.5;
}

.dupla {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 400px) {
  .dupla {
    grid-template-columns: 1fr 1fr;
  }
}

/* -------------------------------------------------------------- seccion */

.seccion {
  border-top: 1px dashed var(--rosa-suave);
  margin-top: 24px;
  padding-top: 22px;
}

.seccion-titulo {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--vino);
  margin: 0 0 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.seccion-titulo small {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tenue);
  background: var(--crema-hondo);
  padding: 3px 8px;
  border-radius: 999px;
}

.seccion-bajada {
  font-size: 0.85rem;
  color: var(--tenue);
  margin: 0 0 16px;
}

/* ------------------------------------------------------------------ foto */

.foto-zona {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.foto-vista {
  position: relative;
  margin-top: 14px;
  border-radius: var(--radio-chico);
  overflow: hidden;
  border: 1px solid var(--rosa-suave);
  background: var(--crema);
}

.foto-vista img {
  width: 100%;
  display: block;
  max-height: 300px;
  object-fit: cover;
}

.foto-quitar {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: rgba(74, 54, 64, 0.72);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.foto-quitar:hover {
  background: rgba(74, 54, 64, 0.9);
}

input[type="file"] {
  display: none;
}

/* ---------------------------------------------------------------- botones */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #d68a94, var(--rosa-fuerte));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(201, 115, 127, 0.32);
  transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.boton:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px rgba(201, 115, 127, 0.42);
}

.boton:active {
  transform: translateY(1px) scale(0.995);
}

.boton:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.boton-suave {
  color: var(--vino);
  background: var(--crema-hondo);
  border: 1px solid var(--rosa-suave);
  box-shadow: none;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  padding: 11px 14px;
}

.boton-suave:hover {
  background: var(--rosa-suave);
  filter: none;
  box-shadow: none;
}

.boton svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.boton-enviar {
  margin-top: 26px;
  padding: 16px;
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------- errores */

.errores {
  background: #fdecee;
  border: 1px solid #f0c2c8;
  border-left: 3px solid var(--rosa-fuerte);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: #8f3d4c;
}

.errores ul {
  margin: 0;
  padding-left: 16px;
}

.errores p {
  margin: 0;
}

/* ---------------------------------------------------------------- gracias */

.gracias {
  text-align: center;
  padding: 40px 0;
}

.gracias-marca {
  width: 76px;
  height: 76px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--rosa-suave), var(--crema-hondo));
  border: 1px solid var(--rosa);
  color: var(--rosa-fuerte);
}

.gracias-marca svg {
  width: 34px;
  height: 34px;
}

.gracias h1 {
  font-family: var(--script);
  font-size: 3rem;
  color: var(--vino);
  margin: 0 0 8px;
  font-weight: 400;
  padding-bottom: 0.1em;
}

.gracias p {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--texto);
  margin: 0 auto 28px;
  max-width: 32ch;
}

/* ------------------------------------------------------------------- pie */

.pie {
  text-align: center;
  margin-top: 28px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--tenue);
}

.pie a {
  color: var(--rosa-fuerte);
  text-decoration: none;
}

/* ------------------------------------------------------- modal de camara */

.camara {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #241a1f;
  display: none;
  flex-direction: column;
}

.camara[open],
.camara.abierta {
  display: flex;
}

.camara-visor {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #241a1f;
}

.camara-visor video,
.camara-visor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* La cámara frontal se ve espejada, como un espejo real. */
.camara-visor video.espejo {
  transform: scaleX(-1);
}

.camara-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
  background: #1b1317;
}

.camara-barra button {
  border: none;
  background: none;
  color: #f0dde2;
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 10px 6px;
}

.disparador {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid rgba(255, 255, 255, 0.35) !important;
  background-clip: padding-box;
  flex: none;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.disparador:active {
  transform: scale(0.92);
}

.camara-aviso {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  text-align: center;
  color: #f0dde2;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ------------------------------------------------------------ accesible */

.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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