/* ===========================================================================
   Alta de clientes Ferrolan — estilo editorial de marca (guía ferrolan.es)
   Montserrat · negro sobre blanco · rojo #C40731 solo para acción.
   Títulos y etiquetas en MAYÚSCULAS. Inputs de esquina recta con borde fino
   (#C3C3C3, igual que la web). Botón rojo en mayúsculas, radio 10px. Ancho completo.
   =========================================================================== */

:root {
    --rojo: #C40731;
    --rojo-osc: #A80628;
    --negro: #000000;
    --tinta: #141414;          /* texto */
    --gris: #6b6b6b;           /* texto secundario / notas */
    --linea: #C3C3C3;          /* borde de campos (como ferrolan.es) */
    --linea-soft: #E6E6E6;     /* divisores */
    --blanco: #ffffff;
    --superficie: #F6F6F6;

    --ok: #15803d;
    --error: #c40731;

    --r-btn: 10px;
    --t: .16s ease;
}

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

body {
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--tinta);
    background: var(--blanco);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---------- Contenedor a ancho completo ---------- */
.page {
    display: block;
    padding: clamp(28px, 4vw, 56px) 0 72px;
}
.card {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    background: var(--blanco);
    padding: 0 clamp(20px, 5vw, 56px);
}
.card--center { max-width: 560px; text-align: center; padding-top: 24px; padding-bottom: 24px; }

/* Modo embebido: dentro de un iframe en una página CMS de PrestaShop. */
html.embedded, html.embedded body { min-height: 0; background: transparent; }
html.embedded .page { padding: 4px 0 24px; }
html.embedded .logo { display: none; }

/* ---------- Cabecera (editorial, a la izquierda) ---------- */
.card__head {
    text-align: left;
    margin-bottom: 36px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--linea-soft);
}
.logo { display: block; margin: 0 0 24px; height: 44px; width: auto; }

h1 {
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -.005em;
    line-height: 1.1;
    margin: 0 0 16px;
    color: var(--negro);
    text-wrap: balance;
}
h1::after { content: ""; display: block; width: 54px; height: 3px; background: var(--rojo); margin-top: 18px; }
.card--center h1::after { margin-left: auto; margin-right: auto; }

.lead { color: var(--gris); font-size: 1.02rem; max-width: 62ch; margin: 0; }
.card--center .lead { margin: 0 auto; }

/* ---------- Toggle de tipo (pestañas editoriales) ---------- */
.toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 460px;
    margin: 0 0 38px;
    border-bottom: 1px solid var(--linea);
}
.toggle__pill {
    font: inherit;
    font-weight: 600;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    padding: 16px 12px;
    border: none;
    background: none;
    color: var(--gris);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color var(--t), border-color var(--t);
}
.toggle__pill:hover:not([aria-checked="true"]) { color: var(--negro); }
.toggle__pill[aria-checked="true"] { color: var(--negro); border-bottom-color: var(--rojo); }
.toggle__pill:focus-visible { outline: 2px solid var(--rojo); outline-offset: 3px; }

/* ---------- Layout de campos ---------- */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 30px;
    margin-bottom: 8px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }

/* Micro-etiquetas en mayúsculas (no afecta a checkboxes ni a la zona de carga) */
.field > label:not(.filedrop),
.checks > legend {
    text-transform: uppercase;
    letter-spacing: .07em;
    font-size: .72rem;
    font-weight: 700;
    color: var(--negro);
}
label { font-size: .9rem; font-weight: 600; color: var(--tinta); }
.opt { text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--gris); font-size: .78rem; }
.req { text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--rojo); font-size: .78rem; }

/* Campos obligatorios: asterisco automático + leyenda */
.field:has(:required) > label:not(.filedrop)::after { content: " *"; color: var(--rojo); }
.form-legend { font-size: .78rem; color: var(--gris); margin: 0 0 24px; text-transform: uppercase; letter-spacing: .06em; }
.form-legend b { color: var(--rojo); }

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    font: inherit;
    font-size: .98rem;
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--linea);
    border-radius: 0;
    background: var(--blanco);
    color: var(--tinta);
    transition: border-color var(--t), box-shadow var(--t);
}
textarea { resize: vertical; min-height: 104px; }
::placeholder { color: #9a9a9a; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--rojo);
    box-shadow: inset 0 0 0 1px var(--rojo);
}
.field.invalid input,
.field.invalid select { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }

/* ---------- Zona de carga de ficheros ---------- */
.filedrop {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px dashed var(--linea);
    border-radius: 0;
    background: var(--superficie);
    cursor: pointer;
    transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.filedrop:hover { border-color: var(--rojo); background: var(--blanco); }
.filedrop:focus-within { border-color: var(--rojo); background: var(--blanco); box-shadow: inset 0 0 0 1px var(--rojo); }
.filedrop.dragover { border-color: var(--rojo); border-style: solid; background: var(--blanco); }

.filedrop__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }

.filedrop__ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    border: 1px solid var(--rojo);
    color: var(--rojo);
    transition: background var(--t), color var(--t), border-color var(--t);
}
.filedrop__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.filedrop__title { font-weight: 600; font-size: .88rem; color: var(--tinta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filedrop__link { color: var(--rojo); text-decoration: underline; }
.filedrop__hint { font-weight: 400; font-size: .76rem; color: var(--gris); }

.filedrop__check { flex: none; margin-left: auto; display: none; place-items: center; width: 28px; height: 28px; border: 1px solid var(--ok); color: var(--ok); }
.filedrop.has-file { border-style: solid; border-color: var(--ok); background: var(--blanco); }
.filedrop.has-file .filedrop__ico { border-color: var(--ok); color: var(--ok); }
.filedrop.has-file .filedrop__check { display: grid; }
.field.invalid .filedrop { border-color: var(--error); border-style: solid; }

.err { color: var(--error); font-size: .78rem; min-height: 1em; }

/* ---------- Checkboxes ---------- */
.checks { border: 1px solid var(--linea); border-radius: 0; padding: 20px; margin: 20px 0; background: var(--blanco); }
.checks legend { padding: 0 8px; }
.checks__grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 20px; margin-top: 6px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .88rem; font-weight: 400; }
.check input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--rojo); flex: none; }
.check--inline { margin: 14px 0; }

.consents { margin: 26px 0; border-top: 1px solid var(--linea-soft); padding-top: 22px; }
.consents a { color: var(--rojo); }

/* ---------- Honeypot oculto ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Botón + spinner ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font: inherit;
    font-weight: 600;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 18px 44px;
    border: none;
    border-radius: var(--r-btn);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--t), box-shadow var(--t);
}
.btn--primary { background: var(--rojo); color: var(--blanco); width: auto; min-width: 280px; margin-top: 12px; }
.btn--primary:hover { background: var(--rojo-osc); }
.btn:focus-visible { outline: 2px solid var(--rojo); outline-offset: 3px; }
.btn[disabled] { opacity: .65; cursor: not-allowed; }

.btn__spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; display: none; animation: spin .7s linear infinite; }
.btn.loading .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Mensaje de formulario ---------- */
.form-msg { margin: 18px 0 0; padding: 14px 16px; border-radius: 0; font-size: .9rem; border-left: 3px solid; }
.form-msg.error { background: #fdf1f3; color: var(--error); border-color: var(--error); }
.form-msg.ok { background: #f0fdf4; color: var(--ok); border-color: var(--ok); }

/* ---------- Footer ---------- */
.card__foot { margin-top: 30px; border-top: 1px solid var(--linea-soft); padding-top: 20px; font-size: .8rem; color: var(--gris); }
.muted { color: var(--gris); }
.cf-turnstile { margin-top: 22px; }

/* ---------- Confirmación ---------- */
.check-icon { margin: 8px 0 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .checks__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .grid, .checks__grid { grid-template-columns: 1fr; }
    .toggle { max-width: none; }
    .btn--primary { width: 100%; min-width: 0; }
    .page { padding: 20px 0 48px; }
    .card { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .btn__spinner { animation: none; }
    * { transition: none !important; }
}
