:root {
  --Marine-blue: hsl(213, 96%, 18%);
  --Purplish-blue: hsl(243, 100%, 62%);
  --Pastel-blue: hsl(228, 100%, 84%);
  --Light-blue: hsl(206, 94%, 87%);
  --Strawberry-red: hsl(354, 84%, 57%);

  --Cool-gray: hsl(231, 11%, 63%);
  --Light-gray: hsl(229, 24%, 87%);
  --Magnolia: hsl(217, 100%, 97%);
  --Alabaster: hsl(231, 100%, 99%);
  --White: hsl(0, 0%, 100%);
}

/* Reset / base */
* {
  box-sizing: border-box;
  font-family: "Ubuntu", sans-serif;
  padding: 0;
  margin: 0;
}
img {
  max-width: 100%;
  display: block;
}
.hidden {
  display: none !important;
}

/* Layout viewport */
body {
  background-color: var(--Magnolia);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 20px;
}

/* Form container */
.form {
  width: 900px;
  max-width: calc(100% - 40px);
  background-color: var(--White);
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  overflow: hidden;
  position: relative;
  z-index: 10;
}

/* Ensure cover sits above everything (see .cover below) */
.form-container {
  display: block;
  padding: 2rem;
}

/* Hide any leftover sidebar */
.form-sidebar {
  display: none !important;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ====== COVER / PORTADA ====== */
/* coloca una imagen de portada a pantalla completa; cambia la ruta a tu imagen */
.cover {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  background-image: url('./assets/images/Moderno\ Buzón\ de\ Correo\ Cambio\ de\ Domicilio\ Tarjeta.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(0,0,0,0.2);
}

/* overlay para mejorar contraste */
.cover-overlay {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column; /* 🔹 necesario para que el botón se pueda empujar abajo */
}

/* botón en PC (alineado a la derecha, abajo) */
.enter-btn {
  background-color: var(--Marine-blue);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.25rem;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(32,58,86,0.18);
  transition: transform .12s ease, box-shadow .12s ease;

  /* 🔹 Alineación en PC */
  margin-top: auto;        /* empuja hacia abajo */
  margin-bottom: 190px;     /* separa del borde inferior */
  margin-left: auto;       /* lo empuja a la derecha */
  margin-right: 550px;      /* separación del borde derecho */
  align-self: flex-end;    /* asegura la posición en flexbox */
}

.enter-btn:hover,
.enter-btn:focus {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(32,58,86,0.22);
}

.cover.hidden { display: none !important; }
body.cover-open { overflow: hidden; }

/* 🔹 SOLO en móviles */
@media screen and (max-width: 600px) {
  .cover {
    background-size: contain;        
    background-repeat: no-repeat;
    background-position: center 180px; /* ajusta más arriba o abajo */
    background-color: #fff;
    min-height: 85vh;                
  }

  .enter-btn {
    position: fixed;   /* fijo al fondo */
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 320px;
    font-size: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    z-index: 999;

    /* 🔹 resetea márgenes de PC */
    margin: 0;
    align-self: center;
  }
}




/* Visual helpers */
.circle {
  width: 40px;
  height: 40px;
  border: 2px solid var(--White);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--White);
  font-weight: 700;
}
.active .circle {
  background-color: var(--Light-blue) !important;
  color: var(--Marine-blue) !important;
}
.err {
  border: 2px solid var(--Strawberry-red) !important;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.step-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.step-content span {
  text-transform: uppercase;
  color: var(--Light-gray);
  font-size: 13px;
}
.step-content b {
  text-transform: uppercase;
  color: var(--White);
}

/* ---------- STEPS VISIBILITY CONTROL ---------- */
/* Hide all steps by default; show the one with .active */
.stp {
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  min-height: 420px;
  gap: 1rem;
  position: relative;
}

/* The only visible step must have the .active class */
.stp.active {
  display: flex;
}

/* Header shared styles */
.stp .header {
  margin-bottom: 0.5rem;
  padding-top: 0.5rem;
  line-height: 1.4;
}
.header .title {
  color: var(--Marine-blue);
  font-size: 28px;
  font-weight: 700;
}
.header .exp {
  color: var(--Cool-gray);
  margin-top: 8px;
}

/* Buttons container */
.btns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 30;
}

/* Prev / Next buttons */
.prev-stp {
  margin-top: 1.5rem;
  border: none;
  font-weight: 700;
  background-color: transparent;
  padding: 0.8rem 1.2rem;
  border-radius: 7px;
  color: var(--Cool-gray);
  cursor: pointer;
}
.next-stp {
  margin-top: 1.5rem;
  border: none;
  padding: 0.9rem 1.3rem;
  border-radius: 8px;
  background-color: var(--Marine-blue);
  color: var(--White);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(32,58,86,0.15);
}

/* ---------- STEP 1 (kept for reuse) ---------- */
.step-1 {
  width: 100%;
}
.step-1 form {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
  gap: 1rem;
}
.label {
  color: var(--Marine-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.step-1 form input {
  padding: 1rem;
  border: 1px solid var(--Cool-gray);
  border-radius: 7px;
  font-weight: 500;
  font-size: 1rem;
}
.step-1 form input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 78, 255, 0.08);
  border-color: var(--Purplish-blue);
}
form input::placeholder {
  font-weight: 500;
  font-size: 1rem;
  font-family: inherit;
}
form .error {
  display: none;
  color: var(--Strawberry-red);
  font-size: 0.9rem;
  font-weight: 700;
}

/* -----------------------------
   STEP 2 (Select plan) - GRID
   ----------------------------- */
.step-2 form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 columnas: 3 en fila 1, resto en fila 2 */
  gap: 1.75rem;
  align-items: start;
  justify-items: center; /* centra las tarjetas en sus celdas (fila 2 quedará centrada) */
  margin-top: 8px;
  padding-inline: 0.5rem;
}

/* Plan cards (imagen ocupa toda la carta; texto overlay en bottom) */
.plan-card {
  border: 2px solid var(--Light-gray);
  border-radius: 12px;
  padding: 0;                /* quitamos padding para que la imagen ocupe todo */
  width: 100%;               /* ocupa la celda completa */
  max-width: 380px;
  min-width: 220px;
  min-height: 260px;        /* altura para que las imágenes grandes quepan */
  display: block;
  cursor: pointer;
  background-color: white;
  transition: transform .12s ease, box-shadow .18s ease, border-color .12s ease;
  position: relative;       /* necesario para overlay */
  z-index: 2;
  overflow: hidden;         /* recortar la imagen */
}

/* Hover y estado seleccionado */
.plan-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(34,50,99,0.06);
}
.plan-card.selected {
  border-color: var(--Purplish-blue);
  box-shadow: 0 0 0 6px rgba(99,78,255,0.06);
}

/* Imagen llena la carta */
.plan-card img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* llena el contenedor sin deformarse */
  display: block;
  vertical-align: middle;
}

/* Plan info: overlay en la parte inferior para texto legible */
.plan-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}
.plan-info b {
  color: #fff; /* blanco sobre la imagen */
  font-weight: 700;
  font-size: 1.02rem;
}
.plan-info span {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Switcher */
.switcher {
  background-color: var(--Magnolia);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  margin: 2rem 0;
  justify-content: center;
  border-radius: 6px;
}
.monthly, .yearly {
  color: var(--Cool-gray);
  font-weight: 500;
}
.sw-active { color: var(--Marine-blue); }

/* Toggle slider */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--Marine-blue);
  border-radius: 34px;
  transition: 0.25s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.25s;
}
input:checked + .slider:before {
  transform: translateX(26px);
}

/* ---------- STEP 3 (Add-ons or single textarea) ---------- */
.step-3 form {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 8px;
}

/* Legacy box style (safe to keep) */
.box {
  border: 1px solid var(--Cool-gray);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  background-color: white;
  transition: background-color .12s ease, border-color .12s ease;
}
.box:hover { border-color: var(--Purplish-blue); }
.description {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-left: 12px;
}
.price {
  margin-left: auto;
  color: var(--Purplish-blue);
}
.ad-selected {
  border: 1px solid var(--Purplish-blue);
  background-color: rgba(99,78,255,0.03);
}
.step-3 form input {
  accent-color: var(--Purplish-blue);
  transform: scale(1.2);
  user-select: none;
}
.description label {
  color: var(--Marine-blue);
  font-weight: 700;
  user-select: none;
}
.description small {
  color: var(--Cool-gray);
  font-weight: 700;
}

/* NEW: single-box for the single textarea (Step 3 improved look) */
#additional-form {
  max-width: 980px;
  margin: 18px auto 0;
  padding: 8px 0;
  box-sizing: border-box;
  width: 100%;
}
.single-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid #e6eaf3;
  box-shadow: 0 4px 18px rgba(11,34,66,0.03);
}
.single-box label {
  font-weight: 700;
  color: #0b2a55;
  font-size: 15px;
}
.single-box .help {
  color: #7b8695;
  font-size: 13px;
  margin: 6px 0 0;
}
.single-box textarea {
  width: 100%;
  min-height: 220px;
  max-width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.4;
  border-radius: 10px;
  border: 1px solid #d6dbe6;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
  color: #1f334f;
  background: #fbfdff;
}
.single-box textarea:focus {
  outline: none;
  box-shadow: 0 4px 14px rgba(5,42,87,0.08);
  border-color: #2c6ef3;
}

/* Botones area for step 3 (keeps consistent look) */
.stp.step-3 .btns {
  max-width: 980px;
  margin: 22px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  box-sizing: border-box;
}

/* ---------- STEP 4 (Summary) ---------- */
.step-4 {
  margin-top: 8px;
}
.selection-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}
.selection-container {
  background-color: var(--Magnolia);
  padding: 1.5rem;
  border-radius: 8px;
}
.selected {
  border: 2px solid var(--Purplish-blue);
  background-color: var(--Magnolia);
}
.selected-plan {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  color: var(--Marine-blue);
  font-weight: 700;
}
.selected-addon {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  color: var(--Cool-gray);
  font-weight: 500;
  font-size: 0.9rem;
}
.selected-addon .servic-price {
  color: var(--Marine-blue);
}
.total {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--Cool-gray);
}
.total b {
  color: var(--Purplish-blue);
  font-size: 1.2rem;
}

/* show user suggestion area styling */
.selection-container .user-suggestion {
  margin-top: 12px;
  white-space: pre-wrap;
  font-style: italic;
  color: #2b3b58;
}

/* ---------- STEP 5 (Thank you) ---------- */
.step-5 {
  align-items: center;
  width: 100%;
  text-align: center;
  justify-content: center;
  margin: auto;
  flex-direction: column;
  gap: 1rem;
  display: none; /* la visibilidad la maneja .stp.active */
}
.step-5 img {
  width: 120px;
  height: auto;
}
.step-5 .header {
  padding-top: 0;
}

/* ---------- RESPONSIVE ---------- */
/* large -> medium screens: ajustar máximos */
@media screen and (max-width: 1400px) {
  .plan-card {
    max-width: 340px;
    min-width: 220px;
    min-height: 240px;
  }
  /* ahora las imágenes usan cover: si quieres reducir en este breakpoint, puedes ajustar altura de la carta */
}

/* slight reduction */
@media screen and (max-width: 1200px) {
  .plan-card {
    max-width: 300px;
    min-width: 200px;
    min-height: 220px;
  }
}

/* Switch to 2 columns on tablets / small desktops */
@media screen and (max-width: 800px) {
  .form {
    top: 6%;
    max-width: 820px;
    width: calc(100% - 24px);
    padding: 0;
  }

  .form-container {
    padding: 1.5rem;
  }

  /* Buttons area pinned on mobile */
  .btns {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,1));
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 60;
    box-shadow: 0 -8px 20px rgba(32,58,86,0.06);
  }

  /* add bottom padding to active step so fixed btns don't cover content */
  .stp.active { padding-bottom: 120px; }

  .step-2 form {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 por fila */
    gap: 1rem;
  }
  .plan-card {
    min-height: 200px;
    padding: 0;
    max-width: none;
    min-width: 160px;
  }
  .plan-card img { object-fit: cover; } /* sigue llenando la carta */
  .stp { gap: 1rem; width: 100%; }
  .stp .header {
    padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    line-height: 1.3;
  }
  .switcher { margin: 1.2rem 0; }

  /* Step 3 improvements on small screens */
  #additional-form { margin: 8px auto 0; }
  .single-box textarea { min-height: 160px; }
  .stp.step-3 .btns {
    margin-top: 12px;
  }
}

/* mobile very small: 1 per row */
@media screen and (max-width: 420px) {
  .step-2 form {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .plan-card { width: 100%; min-height: 140px; padding: 0; }
  .plan-card img { object-fit: cover; }

  /* Buttons stacked for small devices (when pinned) */
  .btns { flex-direction: column-reverse; align-items: stretch; height: auto; position: fixed; bottom: 0; padding: 12px; gap: 8px; }
  .next-stp { width: 100%; }
  .prev-stp { width: 100%; text-align: left; padding-left: 0; }
}

/* accessibility focus */
.plan-card:focus,
.plan-card:focus-within {
  outline: 3px solid rgba(99,78,255,0.12);
  outline-offset: 4px;
}

/* small polish: ensure textarea inherits font settings and line-height for good legibility */
textarea, input, button {
  font-family: inherit;
  line-height: 1.45;
}

/* optional: smooth transitions for textarea height/box-shadow */
.single-box textarea {
  transition: box-shadow 0.18s ease, border-color 0.15s ease;
}
