/* ==========================================================================
   ACTAROO - Paginas de acceso (form.html y las que se le parezcan)
   Mismo sistema que la portada: crema #FEF8E9, marron #1A1109, verde azulado #42757E,
   DM Sans alojada en el servidor, botones e inputs en pildora, tarjetas de 24px.
   Los errores no usan rojo: van en marron, en negrita y con un aviso "!".
   ========================================================================== */

@font-face { font-family: "DM Sans"; font-weight: 400; font-style: normal; font-display: swap;
    src: url("../fonts/dm-sans-latin-400.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-style: normal; font-display: swap;
    src: url("../fonts/dm-sans-latin-500.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 700; font-style: normal; font-display: swap;
    src: url("../fonts/dm-sans-latin-700.woff2") format("woff2"); }

:root {
    --cream: #fef8e9;
    --sand: #f5edd6;
    --sand-2: #ebe0c2;
    --ink: #1a1109;
    --ink-soft: #3a2f24;
    --teal: #42757e;
    --teal-dark: #2f5960;
    --teal-deep: #274a50;
    --teal-tint: #e3eeef;
    --white: #ffffff;
    --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --r: 24px;
    --frame: 32px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100svh;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 8px; }

.auth-page { min-height: 100svh; display: flex; flex-direction: column; }

/* ---------- Cabecera ---------- */

.auth-top { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--frame); height: 96px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-top .logo img { height: 56px; width: auto; }
.back-home { display: inline-flex; align-items: center; padding: 10px 22px; border-radius: 999px;
    background: var(--sand); color: var(--ink); font-weight: 700; font-size: 1rem; text-decoration: none;
    transition: background .18s; }
.back-home:hover { background: var(--sand-2); }

/* ---------- Cuerpo: propuesta + formulario ---------- */

.auth-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px var(--frame) 72px;
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: start; }

.auth-aside { position: sticky; top: 24px; background: var(--teal-deep); color: var(--cream); border-radius: var(--r); padding: 44px 40px 40px; }
.auth-aside h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.auth-aside .lead { margin-top: 16px; font-size: 1.1rem; line-height: 1.5; color: var(--cream); opacity: .9; }
.pasos-mini { list-style: none; margin-top: 30px; display: grid; gap: 18px; }
.pasos-mini li { display: grid; grid-template-columns: 38px 1fr; gap: 14px; align-items: start; font-size: 1.05rem; line-height: 1.4; }
.pasos-mini .n { width: 38px; height: 38px; border-radius: 50%; background: var(--cream); color: var(--ink);
    display: grid; place-items: center; font-weight: 700; }
.pasos-mini strong { display: block; font-weight: 700; }
.pastilla { display: inline-flex; align-items: center; gap: 10px; margin-top: 32px; padding: 8px 18px 8px 8px;
    border-radius: 999px; background: var(--teal-tint); color: var(--ink); font-weight: 700; font-size: 1rem; }
.pastilla .ico { width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: var(--white);
    display: grid; place-items: center; font-size: 1rem; }

.auth-form-container { background: var(--white); border-radius: var(--r); padding: 36px 40px 40px; }

/* ---------- Pestanas ---------- */

.auth-tabs { display: flex; gap: 6px; padding: 6px; margin-bottom: 28px; background: var(--sand); border-radius: 999px; }
.tab-button { flex: 1; padding: 12px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink);
    font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; transition: background .18s, color .18s; }
.tab-button:hover:not(.active) { background: var(--sand-2); }
.tab-button.active { background: var(--teal); color: var(--white); }

.auth-form { display: none; }
.auth-form.active { display: block; }

/* ---------- Campos ---------- */

.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 1rem; color: var(--ink); }
.form-input { width: 100%; padding: 14px 22px; border: 2px solid var(--sand-2); border-radius: 999px; background: var(--cream);
    color: var(--ink); font: inherit; font-size: 1.05rem; transition: border-color .18s, background .18s; }
.form-input:focus { outline: none; border-color: var(--teal); background: var(--white); }
.form-input.error { border-color: var(--ink); background: var(--white); }
.password-input-container { position: relative; }
.form-input.with-toggle { padding-right: 84px; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 7px 14px; border: 0;
    border-radius: 999px; background: var(--sand); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.password-toggle:hover { background: var(--sand-2); }

.error-message { display: none; margin-top: 8px; padding-left: 4px; font-size: .95rem; font-weight: 700; color: var(--ink); }
.error-message.show { display: flex; gap: 8px; align-items: flex-start; }
.error-message.show::before { content: "!"; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
    background: var(--ink); color: var(--cream); font-size: .8rem; line-height: 20px; text-align: center; }

.message { display: none; margin-bottom: 20px; padding: 14px 20px; border-radius: 18px; background: var(--teal-tint); color: var(--ink); font-weight: 500; }
.message.show { display: block; }

/* ---------- Botones ---------- */

.auth-button { width: 100%; padding: 16px 30px; border: 0; border-radius: 999px; background: var(--teal); color: var(--white);
    font: inherit; font-size: 1.15rem; font-weight: 700; cursor: pointer; transition: background .18s, transform .18s; }
.auth-button:hover { background: var(--teal-dark); transform: translateY(-2px); }
.auth-button:active { transform: translateY(0); }
.auth-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.google-signin-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 24px;
    border: 2px solid var(--sand-2); border-radius: 999px; background: var(--white); color: var(--ink);
    font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: border-color .18s, background .18s; }
.google-signin-btn:hover:not(:disabled) { border-color: var(--teal); background: var(--cream); }
.google-signin-btn:disabled { opacity: .6; cursor: wait; }
.google-icon { width: 22px; height: 22px; }

.google-signin-divider { display: block; text-align: center; margin: 22px 0; color: var(--ink-soft); font-size: .95rem; font-weight: 500; }

.auth-links { margin-top: 20px; text-align: center; }
.auth-links a { font-weight: 700; color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.auth-links a:hover { color: var(--ink); }

/* ---------- Casillas ---------- */

.checkbox-group { display: flex; align-items: flex-start; gap: 12px; }
.custom-checkbox { position: relative; flex: none; width: 26px; height: 26px; margin-top: 1px; cursor: pointer; }
.custom-checkbox input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.checkmark { position: absolute; inset: 0; border: 2px solid var(--sand-2); border-radius: 8px; background: var(--cream); transition: background .18s, border-color .18s; }
.custom-checkbox input:checked + .checkmark { background: var(--teal); border-color: var(--teal); }
.custom-checkbox input:checked + .checkmark::after { content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px;
    border: solid var(--white); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.custom-checkbox input:focus-visible + .checkmark { outline: 3px solid var(--teal); outline-offset: 2px; }
.checkbox-label { font-size: .98rem; line-height: 1.5; color: var(--ink-soft); }
.checkbox-label a { color: var(--teal-dark); font-weight: 700; text-underline-offset: 3px; }
.checkbox-label a:hover { color: var(--ink); }

.terms-box { margin: 4px 0 22px; padding: 16px 18px; border-radius: 18px; background: var(--sand); }
.terms-note { margin: 8px 0 0 38px; font-size: .88rem; color: var(--ink-soft); }

/* ---------- Pie ---------- */

.footer { padding: 28px var(--frame) 36px; text-align: center; font-size: .95rem; color: var(--ink-soft); background: var(--sand); }
.footer p + p { margin-top: 8px; }
.footer a { color: var(--ink); text-decoration: none; font-weight: 500; margin: 0 10px; }
.footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer .footer-brand a { margin: 0; font-weight: 700; }

/* ---------- Ventanas (avisos y recuperar contrasena) ---------- */

.modal { display: none; position: fixed; z-index: 10000; inset: 0; background: rgba(26, 17, 9, .55); }
.modal .modal-content { background: var(--white); margin: 12vh auto 0; width: 90%; max-width: 420px; border-radius: var(--r); overflow: hidden; }
.modal .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 26px; background: var(--sand); }
.modal .modal-header h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.modal .modal-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--white); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.modal .modal-close:hover { background: var(--cream); }
.modal .modal-body { padding: 28px 26px; text-align: center; }
.modal .modal-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; font-weight: 700; }
.modal .modal-icon.success { background: var(--teal); color: var(--white); }
.modal .modal-icon.error { background: var(--ink); color: var(--cream); }
.modal .modal-message { margin-bottom: 20px; font-size: 1.05rem; font-weight: 500; line-height: 1.5; }
.modal .modal-progress { height: 4px; background: var(--sand); border-radius: 2px; overflow: hidden; }
.modal .modal-progress-bar { height: 100%; width: 0; background: var(--teal); transition: width .1s linear; }

/* ---------- Pantallas pequenas ---------- */

@media (max-width: 960px) {
    .auth-main { grid-template-columns: 1fr; gap: 28px; padding-bottom: 56px; }
    .auth-aside { position: static; padding: 26px 24px 24px; }
    .auth-aside .lead, .pasos-mini { display: none; }
    .pastilla { margin-top: 18px; }
}
@media (max-width: 560px) {
    :root { --frame: 18px; }
    .auth-top { height: 76px; }
    .auth-top .logo img { height: 44px; }
    .back-home { padding: 8px 16px; font-size: .95rem; }
    .auth-form-container { padding: 26px 20px 30px; }
    .auth-aside h1 { font-size: 1.7rem; }
    .pastilla { font-size: .95rem; }
    .footer a { display: inline-block; margin: 4px 8px; }
}
