/* aparatos.css — la página del enlace suelto de aparatos (aparatos.html).
 *
 * La hoja de aparatos trae su propio estilo (perfil.css, .pf-enlinea); esto
 * es sólo el marco: la cabecera corta, los pasos y el formulario final, con
 * el mismo vocabulario —arena, tinta, naranja sólo en lo elegido—.
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&display=swap');
@font-face {
  font-family: 'Satoshi';
  src: url('assets/fonts/Satoshi-Variable.ttf') format('truetype');
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --ap-ink: #1F271B;
  --ap-muted: #6b7280;
  --ap-soft: #a8adaa;
  --ap-sand: #f6f3ef;
  --ap-line: #ece7e0;
  --ap-orange: #ff4500;
  --ap-bg: #fffcf9;
  color-scheme: light;
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }

body.ap-body {
  margin: 0;
  background: var(--ap-bg);
  color: var(--ap-ink);
  font-family: 'Satoshi', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
}
.ap-body a { color: #c2410c; }

/* ── cabecera ─────────────────────────────────────────────────────────── */
.ap-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 24px;
}
.ap-logo img { display: block; height: 34px; width: auto; }
.ap-top-der { display: flex; align-items: center; gap: 14px; }
.ap-lang { font-size: 14px; font-weight: 700; color: var(--ap-muted) !important; text-decoration: none; }
.ap-wa {
  padding: 9px 16px;
  border-radius: 100px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(31, 39, 27, 0.1);
  font-size: 14px;
  font-weight: 700;
  color: var(--ap-ink) !important;
  text-decoration: none;
  white-space: nowrap;
}
.ap-wa:hover { color: var(--ap-orange) !important; }

/* ── marco ────────────────────────────────────────────────────────────── */
.ap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 64px;
}
.ap-paso { max-width: 720px; margin: 0 auto; }
#apPaso2 { max-width: none; }

.ap h1 {
  margin: 8px 0 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(28px, 4.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.ap-hola {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ap-orange);
}
.ap-intro { margin: 0 0 24px; max-width: 62ch; font-size: 16.5px; color: var(--ap-muted); }

/* Pasos: una línea partida en tres, con el nombre debajo. Lo hecho en
   tinta, el actual en naranja, lo que falta en gris. */
.ap-pasos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-width: 720px;
  margin: 8px auto 30px;
}
.ap-paso-btn {
  display: block;
  padding: 10px 0 0;
  border: none;
  border-top: 3px solid var(--ap-line);
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  color: var(--ap-soft);
  cursor: pointer;
}
.ap-paso-btn b { font-weight: 400; margin-right: 6px; font-variant-numeric: tabular-nums; }
.ap-paso-btn.hecho { border-top-color: var(--ap-ink); color: var(--ap-muted); }
.ap-paso-btn[aria-current="step"] { border-top-color: var(--ap-orange); color: var(--ap-ink); }
.ap-paso-btn:disabled { cursor: default; }
.ap-paso-btn:focus-visible { outline: 2px solid var(--ap-orange); outline-offset: 3px; }

/* ── tarjetas y campos ───────────────────────────────────────────────── */
.ap-tarjeta {
  display: block;
  margin: 0 0 14px;
  padding: 20px 22px;
  border: none;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 39, 27, 0.06);
  min-width: 0;
}
fieldset.ap-tarjeta legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; }
fieldset.ap-tarjeta legend + * { clear: both; }
.ap-campo { display: flex; flex-direction: column; gap: 7px; margin: 0 0 18px; }
.ap-tarjeta > .ap-campo:last-child, .ap-tarjeta.ap-campo { margin-bottom: 14px; }
.ap-rot { display: block; font-size: 15px; font-weight: 700; }
.ap-rot-2 { margin-top: 8px; }
.ap-rot em, .ap-campo em {
  font-style: normal;
  font-weight: 400;
  font-size: 13px;
  color: var(--ap-soft);
  margin-left: 4px;
}
.ap-campo > span:not(.ap-rot):not(.ap-kwh) { font-size: 13.5px; font-weight: 700; color: #59615a; }
.ap-campo small, .ap-nota { font-size: 13.5px; color: var(--ap-muted); }
.ap-nota { margin: 2px 0 12px; }
.ap-nota-pie { margin: -4px 0 0; }

/* Sólo en las tarjetas de la página: la hoja de aparatos tiene sus campos. */
.ap-tarjeta input[type="text"], .ap-tarjeta input[type="tel"], .ap-tarjeta input[type="email"],
.ap-tarjeta select, .ap-tarjeta textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--ap-line);
  border-radius: 14px;
  background: var(--ap-bg);
  font: inherit;
  font-size: 16px;   /* 16 px: con menos, el iPhone hace zoom al escribir */
  color: var(--ap-ink);
  outline: none;
  transition: border-color 0.15s ease;
}
.ap-tarjeta textarea { resize: vertical; min-height: 88px; }
.ap-tarjeta input:focus, .ap-tarjeta select:focus, .ap-tarjeta textarea:focus { border-color: var(--ap-orange); background: #fff; }
.ap-kwh { display: flex; align-items: center; gap: 10px; }
.ap-kwh input { max-width: 180px; font-family: 'Space Grotesk', sans-serif; }
.ap-kwh i { font-style: normal; color: var(--ap-muted); font-size: 14px; }

.ap-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  border-radius: 18px;
  background: var(--ap-sand);
}
.ap-seg button {
  border: none;
  border-radius: 14px;
  padding: 10px 16px;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ap-muted);
  cursor: pointer;
}
.ap-seg button[aria-pressed="true"] {
  background: #fff;
  color: var(--ap-ink);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(31, 39, 27, 0.12), inset 0 0 0 1.5px var(--ap-orange);
}
.ap-seg button:focus-visible { outline: 2px solid var(--ap-orange); outline-offset: 2px; }

.ap-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ap-checks label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--ap-sand);
  font-size: 14.5px;
  line-height: 1.35;
  cursor: pointer;
}
.ap-checks input { margin: 2px 0 0; width: 17px; height: 17px; accent-color: var(--ap-orange); flex: none; }
.ap-checks label:has(input:checked) { background: #fff3ec; box-shadow: inset 0 0 0 1.5px #ffd2bd; }

.ap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; margin-top: 10px; }
#apGenerar .ap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ap-fotos { display: flex; flex-wrap: wrap; gap: 10px; }
.ap-fotos:not(:empty) { margin-bottom: 12px; }
.ap-foto { position: relative; margin: 0; width: 92px; height: 92px; }
.ap-foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }
.ap-foto button {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--ap-ink);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.ap-err-foto { margin: 8px 0 0; font-size: 13.5px; color: #c2410c; }
.ap-err-foto:empty { display: none; }
.ap-trampa { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0; }

.ap-resumen {
  display: inline-block;
  margin: 0 0 18px;
  padding: 8px 14px;
  border-radius: 100px;
  background: #fff1e4;
  font-weight: 700;
  font-size: 14.5px;
  color: #c2410c;
}
.ap-resumen.vacio { background: var(--ap-sand); color: var(--ap-muted); font-weight: 400; border-radius: 14px; }

.ap-error {
  margin: 4px 0 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fdecea;
  color: #b42318;
  font-size: 14.5px;
}
.ap-legal { margin: 14px 0 0; font-size: 12.5px; color: var(--ap-soft); text-align: right; }

/* ── botones ──────────────────────────────────────────────────────────── */
.ap-acciones { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ap-acciones-izq { justify-content: flex-start; }
.ap-acciones-centro { justify-content: center; }
.ap-btn, .ap-btn-sec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 100px;
  padding: 14px 28px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease, color 0.15s ease;
}
.ap-btn { background: var(--ap-orange); color: #fff !important; box-shadow: 0 8px 22px rgba(255, 69, 0, 0.3); }
.ap-btn:hover { filter: brightness(0.95); transform: translateY(-1px); }
.ap-btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.ap-btn-sec { background: #fff; color: var(--ap-ink) !important; box-shadow: 0 1px 4px rgba(31, 39, 27, 0.12); }
.ap-btn-sec:hover { color: var(--ap-orange) !important; }
.ap-btn:focus-visible, .ap-btn-sec:focus-visible { outline: 2px solid var(--ap-orange); outline-offset: 3px; }
.ap-foto-btn { padding: 11px 18px; font-size: 14.5px; }

/* ── hecho ────────────────────────────────────────────────────────────── */
.ap-listo { text-align: center; padding-top: 40px; }
.ap-listo .ap-intro { margin-left: auto; margin-right: auto; }
.ap-listo-ico {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(140deg, #ff8c42, #ff4500);
  color: #fff;
  box-shadow: 0 12px 30px rgba(255, 69, 0, 0.3);
}
.ap-listo-ico svg { width: 34px; height: 34px; }

/* ── teléfono ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .ap-top { padding: 14px 16px; }
  .ap-logo img { height: 28px; }
  .ap { padding: 0 16px 48px; }
  .ap-pasos { margin-bottom: 22px; }
  .ap-paso-btn { font-size: 13px; }
  .ap-tarjeta { padding: 18px 16px; border-radius: 20px; }
  .ap-grid, #apGenerar .ap-grid, .ap-checks { grid-template-columns: minmax(0, 1fr); }
  .ap-acciones .ap-btn { flex: 1; }
  .ap-acciones-centro { flex-direction: column; align-items: stretch; }
  .ap-legal { text-align: left; }
}
