/* ==========================================================
   Hermann & Noemí — invitación
   Mobile first. Medidas sacadas del marco «iPhone 16 - 1»
   (393 × 2725) del Figma.
   ========================================================== */

@font-face {
  font-family: "Funky Vintage";
  src: url("../assets/fonts/funky-vintage-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Funky Vintage";
  src: url("../assets/fonts/funky-vintage-italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --granate: #931637;
  --rosa: #f6bdd6;
  --blanco: #ffffff;

  --fuente: "Funky Vintage", Georgia, "Times New Roman", serif;

  --ancho-campo: 320px;
  --alto-campo: 40px;
  --radio: 65px;
}

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

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

body {
  margin: 0;
  background: var(--blanco);
  color: var(--granate);
  font-family: var(--fuente);
  font-weight: 400;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}

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

h2,
p,
figure {
  margin: 0;
}

/* ---------- Portada ---------- */
/* 7 franjas de ~56px sobre 393px, empezando y terminando en granate */
.portada {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 24px 4px;
  background-color: var(--granate);
  background-image: linear-gradient(90deg, var(--granate) 50%, var(--rosa) 50%);
  background-size: calc(100% * 2 / 7) 100%;
  background-position: left top;
}

.portada__tarjeta {
  /* 385 × 577 en el diseño; también se limita por alto en pantallas bajas */
  width: min(385px, 100%, (100svh - 48px) * 683 / 1024);
}

/* ---------- Foto ---------- */
.foto {
  aspect-ratio: 393 / 461;
  overflow: hidden;
}

.foto img {
  width: 100%;
  height: 100%;
  /* Igual que en el Figma: la foto entera, estirada al hueco */
  object-fit: fill;
}

/* ---------- Títulos ---------- */
.titulo {
  font-size: 24px;
  font-weight: 400;
  text-align: center;
  text-transform: uppercase;
  line-height: 26px;
}

/* ---------- Asistencia ---------- */
.asistencia {
  padding: 42px 16px 0;
}

.formulario {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 36px;
}

.campo {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.campo + .campo {
  margin-top: 29px;
}

.campo label {
  font-size: 16px;
  line-height: 18px;
  font-style: italic;
  text-align: center;
}

.campo input,
.campo select {
  display: block;
  width: min(var(--ancho-campo), 100%);
  height: var(--alto-campo);
  margin-top: 17px;
  padding: 0 20px;
  border: 1px solid var(--granate);
  border-radius: var(--radio);
  background: transparent;
  color: var(--granate);
  font: inherit;
  font-size: 16px;
  text-align: center;
  appearance: none;
}

.campo select {
  text-align-last: center;
  cursor: pointer;
}

/* Sin flechas en el campo numérico, para que se vea igual que los demás */
.campo input[type="number"] {
  -moz-appearance: textfield;
}

.campo input::-webkit-outer-spin-button,
.campo input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.campo input:focus-visible,
.campo select:focus-visible {
  outline: 2px solid var(--granate);
  outline-offset: 2px;
}

.boton {
  width: 117px;
  height: 40px;
  margin-top: 29px;
  border: 0;
  border-radius: var(--radio);
  background: var(--granate);
  color: var(--blanco);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.boton:focus-visible {
  outline: 2px solid var(--granate);
  outline-offset: 3px;
}

/* Sin contenido no ocupa sitio, así el diseño no se mueve */
.campo__error {
  margin-top: 6px;
  font-size: 14px;
  font-style: italic;
  line-height: 16px;
  text-align: center;
}

.campo__error:empty {
  display: none;
}

.campo--error input,
.campo--error select {
  border-width: 2px;
}

/* Trampa para robots: fuera de la vista */
.trampa {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.formulario__gracias {
  margin: 36px auto 48px;
  max-width: 320px;
  font-size: 20px;
  font-style: italic;
  line-height: 26px;
  text-align: center;
}

.formulario__gracias[hidden],
.formulario[hidden] {
  display: none;
}

.boton:disabled {
  opacity: .6;
  cursor: progress;
}

/* ---------- Playlist ---------- */
.playlist {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 10px 50px 11px;
}

.playlist__tocadiscos {
  /* En el diseño el tocadiscos se monta 11px sobre el botón */
  position: relative;
  z-index: -1;
  width: min(372px, 100%);
  margin-top: -11px;
}

.playlist__boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin-top: 21px;
  padding: 0 28px;
  line-height: 1;
  text-decoration: none;
}

/* ---------- Pie: lugar de la celebración ---------- */
/* El bloque granate a todo el ancho del Figma, ahora con el sitio */
.pie {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px max(64px, env(safe-area-inset-bottom));
  background: var(--granate);
  color: var(--blanco);
  text-align: center;
}

.pie__antes {
  color: var(--rosa);
  font-size: 16px;
  font-style: italic;
  line-height: 18px;
}

.pie__lugar {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 400;
  line-height: 32px;
  text-transform: uppercase;
}

.pie__direccion {
  margin-top: 14px;
  font-size: 16px;
  font-style: italic;
  line-height: 22px;
}

.pie__boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin-top: 28px;
  padding: 0 28px;
  background: var(--rosa);
  color: var(--granate);
  line-height: 1;
  text-decoration: none;
}

.pie__boton:focus-visible {
  outline-color: var(--rosa);
}

/* ==========================================================
   Tableta: la foto deja de ocupar todo el ancho
   ========================================================== */
@media (min-width: 600px) {
  .foto {
    max-width: 560px;
    margin-inline: auto;
  }
}

/* ==========================================================
   Ordenador: misma estética, a lo ancho.
   - Portada: franjas de 80px, con una granate centrada.
   - Foto y formulario lado a lado.
   - Tocadiscos y playlist lado a lado.
   ========================================================== */
@media (min-width: 960px) {
  .portada {
    padding-block: 48px;
    /* cada tesela: rosa | granate | rosa → la franja granate queda en el centro */
    background-image: linear-gradient(90deg, var(--rosa) 25%, var(--granate) 25% 75%, var(--rosa) 75%);
    background-size: 160px 100%;
    background-position: center top;
  }

  .portada__tarjeta {
    width: min(520px, 100%, (100svh - 96px) * 683 / 1024);
  }

  .titulo {
    font-size: 32px;
    line-height: 36px;
  }

  .confirmar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 80px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 112px 48px;
  }

  .foto {
    max-width: none;
    margin: 0;
    /* bloque rosa desplazado detrás de la foto, como las franjas */
    box-shadow: 24px 24px 0 var(--rosa);
  }

  .asistencia {
    padding: 0;
  }

  .formulario {
    margin-top: 40px;
  }

  .campo input,
  .campo select {
    width: min(380px, 100%);
  }

  .formulario__gracias {
    margin-bottom: 0;
  }

  .playlist {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "disco titulo"
      "disco boton";
    align-items: end;
    column-gap: 80px;
    row-gap: 0;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 48px 112px;
  }

  .playlist__tocadiscos {
    grid-area: disco;
    align-self: center;
    justify-self: center;
    width: min(460px, 100%);
    margin: 0;
  }

  .playlist .titulo {
    grid-area: titulo;
  }

  .pie {
    padding-block: 96px;
  }

  .pie__lugar {
    font-size: 40px;
    line-height: 44px;
  }

  .playlist__boton {
    grid-area: boton;
    align-self: start;
    justify-self: center;
    margin-top: 28px;
  }
}
