/* Estilos da enquisa pública. Identidade fala.gal (ver brand.css).
   Limpo e sobrio: fondo branco, texto negro, azul só para acentos. */

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

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.5; font-size: 16px; }

/* ---- Cabeceira ---- */
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
}
.site-header__link { display: block; line-height: 0; }
.site-header__logo { display: block; width: auto; }
.site-header__bar { height: 4px; background: var(--azul); }

/* ---- Estrutura ---- */
.site-main { max-width: 680px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.site-footer {
    border-top: 1px solid var(--gris-300);
    color: var(--gris-700);
    font-size: .875rem;
    text-align: center;
    padding: 1.25rem;
}
.site-footer p { margin: .15rem 0; }

.form-wrap__title { color: var(--gris-900); font-size: 1.6rem; margin: 0 0 .35rem; }
.form-wrap__intro { color: var(--gris-700); margin: 0 0 1.5rem; }
.form-required-note { color: var(--gris-500); font-size: .85rem; margin: 0 0 1rem; }

/* ---- Barra de progreso ---- */
.progress { margin: 0 0 1.5rem; }
.progress__meta {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: .75rem; margin-bottom: .45rem;
}
.progress__step { font-weight: 700; color: var(--gris-900); font-size: .95rem; }
.progress__count { color: var(--gris-500); font-size: .8rem; white-space: nowrap; flex: 0 0 auto; }
.progress__track {
    height: 6px; border-radius: 999px;
    background: var(--gris-100); overflow: hidden;
}
.progress__fill {
    display: block; height: 100%; width: 0;
    background: var(--azul); border-radius: 999px;
    transition: width .25s ease;
}
@media (prefers-reduced-motion: reduce) {
    .progress__fill { transition: none; }
}

/* ---- Pasos ---- */
.step { display: none; }
.step.is-active { display: block; }
.step__title { color: var(--gris-900); font-size: 1.25rem; margin: 0 0 .75rem; }
.step__help { color: var(--gris-700); margin: 0 0 1rem; }
.step__optional { color: var(--gris-500); font-size: .85rem; font-style: italic; margin: 0 0 1rem; }

/* ---- Campos ---- */
.field { margin: 0 0 1.35rem; }
.field > label, fieldset > legend { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--gris-900); }
.field__help { display: block; font-weight: 400; font-size: .85rem; color: var(--gris-500); margin-bottom: .45rem; }
.opt { font-weight: 400; color: var(--gris-500); }

input[type="text"], input[type="email"], select, textarea {
    width: 100%; padding: .6rem .65rem;
    border: 1px solid var(--gris-300); border-radius: 6px;
    font: inherit; color: var(--gris-900); background: var(--branco);
}
input[type="text"], input[type="email"] { height: 2.85rem; line-height: 1.4; }
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--azul); outline-offset: 1px; border-color: var(--azul);
}
textarea { resize: vertical; }

/* P0: input do sitio co sufixo .fala.gal pegado */
.sitio-group { display: flex; align-items: stretch; max-width: 24rem; }
.sitio-group input {
    border-radius: 6px 0 0 6px; text-align: right; min-width: 0; flex: 1;
}
.sitio-group__suffix {
    display: flex; align-items: center; padding: 0 .75rem;
    border: 1px solid var(--gris-300); border-left: 0; border-radius: 0 6px 6px 0;
    background: var(--gris-100); color: var(--gris-700); font-weight: 600;
    white-space: nowrap;
}

.field input.invalid, .field textarea.invalid { border-color: #b3261e; }
.field-error { color: #b3261e; font-size: .82rem; margin: .3rem 0 0; }

fieldset { border: 0; margin: 0 0 1.35rem; padding: 0; }
fieldset.field { margin-bottom: 1.35rem; }

/* ---- Opcións (tarxetas de radio/checkbox) ---- */
.opt-list { display: grid; gap: .5rem; grid-template-columns: 1fr; }
.opt-list--inline { grid-template-columns: repeat(2, minmax(0, 8rem)); }
.opt-card {
    display: flex; align-items: flex-start; gap: .55rem;
    border: 1px solid var(--gris-300); border-radius: 8px;
    padding: .65rem .75rem; cursor: pointer;
    font-weight: 400; color: var(--gris-900);
}
.opt-card input { width: auto; margin: .2rem 0 0; flex: 0 0 auto; accent-color: var(--azul); }
.opt-card span { line-height: 1.35; }
.opt-card:hover { border-color: var(--azul); }
.opt-card:has(input:checked) { border-color: var(--azul); background: var(--azul-08); }
.opt-card:has(input:focus-visible) { outline: 2px solid var(--azul); outline-offset: 1px; }

/* ---- Mockups da renovación (paso 3) ---- */
.mockups { display: grid; gap: .9rem; grid-template-columns: 1fr; margin: 0 0 .5rem; }
@media (min-width: 560px) { .mockups { grid-template-columns: repeat(3, 1fr); } }
.mockup { margin: 0; }
.mockup__btn {
    display: block; width: 100%; padding: 0; border: 0; background: none;
    cursor: zoom-in; border-radius: 8px; line-height: 0;
}
.mockup__btn:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }
.mockup img {
    display: block; width: 100%; height: auto;
    border: 1px solid var(--gris-300); border-radius: 8px;
}
.mockup figcaption {
    font-size: .82rem; color: var(--gris-700); text-align: center; margin-top: .35rem;
}
.mockups__hint { font-size: .8rem; color: var(--gris-500); text-align: center; margin: 0 0 1.5rem; }

/* Mesa de luz dos mockups (ábrena/péchana form.js; sen dependencias). */
.lightbox {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(22, 22, 22, .92);
    display: flex; align-items: center; justify-content: center;
    padding: 1.25rem; cursor: zoom-out;
}
.lightbox img {
    max-width: min(1400px, 96vw); max-height: 92vh; width: auto; height: auto;
    border-radius: 6px; box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
}
.lightbox__close {
    position: fixed; top: .75rem; right: .75rem;
    width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .15); color: #fff;
    font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .3); }
.lightbox__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- Botóns / navegación ---- */
.btn {
    font: inherit; font-weight: 600; cursor: pointer;
    padding: .6rem 1.1rem; border-radius: 6px; border: 1px solid transparent;
}
.btn--primary { background: var(--azul); color: var(--branco); }
.btn--primary:hover { background: #105a94; }
.btn--ghost { background: var(--branco); color: var(--azul); border-color: var(--azul); }
.btn--ghost:hover { background: var(--gris-100); }
.btn:focus-visible { outline: 2px solid var(--gris-900); outline-offset: 2px; }

.form-nav {
    display: flex; gap: .75rem; flex-wrap: wrap;
    margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--gris-300);
}
.form-nav [data-nav="next"], .form-nav [data-nav="submit"] { margin-left: auto; }

/* Banner de erro do envío final. */
.form-global-error {
    margin: 1.25rem 0 0; padding: .7rem .85rem;
    border: 1px solid #b3261e; border-left-width: 4px; border-radius: 6px;
    background: #fcecea; color: #8c1d18; font-size: .9rem;
}
.form-global-error[hidden] { display: none; }
.btn[disabled] { opacity: .85; cursor: progress; }

/* Spinner do estado "enviando" (feedback funcional, non decorativo). */
.btn__spinner {
    display: inline-block; width: .9em; height: .9em; margin-right: .5em;
    border: 2px solid rgba(255, 255, 255, .45); border-top-color: var(--branco);
    border-radius: 50%; vertical-align: -.12em;
    animation: btn-spin .6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn__spinner { animation: none; } }

/* Reinicio do formulario (borra autogardado). Sutil, baixo a navegación. */
.form-reset { text-align: center; margin: 1.25rem 0 0; }
.form-reset[hidden] { display: none; }
.link-reset {
    background: none; border: 0; cursor: pointer;
    color: var(--gris-500); font: inherit; font-size: .85rem;
    text-decoration: underline; text-underline-offset: 2px; padding: .35rem;
}
.link-reset:hover { color: var(--gris-700); }
.link-reset:focus-visible { outline: 2px solid var(--gris-700); outline-offset: 2px; border-radius: 4px; }

/* Honeypot: fóra de pantalla pero non display:none (algúns bots ignórano). */
.hp-field {
    position: absolute !important; left: -9999px !important;
    width: 1px; height: 1px; overflow: hidden;
}

/* ---- Confirmación final ---- */
.confirm { text-align: center; padding: 2rem 1rem; }
.confirm h1 { color: var(--gris-900); }

/* ---- Móbil: texto máis contido en parágrafos e opcións ---- */
@media (max-width: 600px) {
    body { font-size: 15px; }
    .form-wrap__title { font-size: 1.35rem; }
    .form-wrap__intro, .step__help { font-size: .92rem; }
    .step__title { font-size: 1.15rem; }
    .field > label, fieldset > legend { font-size: .95rem; }
    .opt-card { padding: .55rem .65rem; gap: .5rem; }
    .opt-card span { font-size: .95rem; }
    .mockup figcaption { font-size: .78rem; }
    /* OLLO: os controis quedan a 16px — con menos, iOS fai zoom ao enfocalos. */
    input[type="text"], input[type="email"], select, textarea { font-size: 16px; }
}
