/* Kontuak v3 — pantalla de acceso (login.php, recordar.php)
   Referencia: C:\laragon\www\maquetas\kontuak-b3.html#login */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
    --marca: #0096b2;
    --marca-osc: #00476b;
    --enlace: #007a91;
    --fondo: #f3f5f8;
    --sup: #fff;
    --borde: #e3e8ee;
    --borde-ctrl: #87919e;
    --texto: #1d2530;
    --texto2: #5b6573;
    --placeholder: #626b76;
    --error: #b42318;
    --foco: #0096b2;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.acceso {
    margin: 0;
    font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--texto);
    background: var(--sup);
}
::selection { background: rgba(0, 150, 178, .22); }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; border-radius: 6px; }

.acceso-marco {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);  /* marca: 1/3, acceso: 2/3 */
}

/* Panel de marca */
.acceso-marca {
    background: var(--marca-osc);
    color: #fff;
    padding: 44px 48px;
    display: flex;
    flex-direction: column;
}
.acceso-marca .logo img { height: 34px; width: auto; display: block; }
.acceso-marca h2 {
    font-size: 30px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.6px;
    max-width: 15ch;
    margin: auto 0 16px;
    color: #fff;
}
.acceso-marca p { color: rgba(255, 255, 255, .82); max-width: 42ch; margin: 0 0 auto; font-size: 15px; }
.acceso-marca .sello {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    font-size: 13px;
    color: rgba(255, 255, 255, .88);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    padding: 6px 12px;
}

/* Formulario */
.acceso-form {
    display: flex;
    flex-direction: column;
    padding: 24px 32px;
}
.acceso-form .logo-movil { display: none; }

/* Selector de idioma (includes/idioma_acceso.php) */
.idioma { align-self: flex-end; display: flex; gap: 2px; border: 1px solid var(--borde); border-radius: 8px; padding: 2px; margin: 0; }
.idioma button {
    border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 13px; color: var(--texto2);
    padding: 5px 12px; border-radius: 6px;
    transition: background-color 150ms ease, color 150ms ease;
}
.idioma button:hover { color: var(--texto); }
.idioma button[aria-pressed="true"] { background: var(--fondo); color: var(--texto); font-weight: 500; }
.acceso-form form:not(.idioma) {  /* el selector de idioma también es un <form> */
    width: 100%;
    max-width: 360px;
    margin: auto;
    display: grid;
    gap: 16px;
}
.acceso-form h1 { font-size: 24px; font-weight: 600; letter-spacing: -.4px; margin: 0; line-height: 1.25; }
.acceso-form .sub { color: var(--texto2); margin: 6px 0 0; }

.campo { display: flex; flex-direction: column; gap: 5px; }
.campo label { font-size: 13px; font-weight: 500; color: var(--texto2); margin: 0; }
/* Contraseña: el enlace «He olvidado…» va tras el campo en el HTML (orden del Tab)
   pero se pinta a la derecha de la etiqueta */
.campo.con-olvido { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "et olv" "ctrl ctrl"; gap: 5px 8px; align-items: baseline; }
.campo.con-olvido > label { grid-area: et; justify-self: start; }
.campo.con-olvido > .enlace { grid-area: olv; font-size: 13px; }
.campo.con-olvido > .con-boton { grid-area: ctrl; }
.ctrl {
    height: 44px;
    width: 100%;
    border: 1px solid var(--borde-ctrl);
    border-radius: 8px;
    padding: 0 12px;
    font: inherit;
    font-size: 15px;
    color: var(--texto);
    background: var(--sup);
    caret-color: var(--marca);
}
.ctrl::placeholder { color: var(--placeholder); }
.ctrl:hover { border-color: var(--texto2); }
.ctrl:focus { outline: 0; border-color: var(--foco); box-shadow: 0 0 0 1px var(--foco); }
.con-boton { position: relative; }
.con-boton .ctrl { padding-right: 46px; }
.ver-pass {
    position: absolute;
    right: 3px;
    top: 3px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--texto2);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.ver-pass i { pointer-events: none; }  /* el clic llega al botón, que lleva el data-password-toggle */
.ver-pass:hover { background: var(--fondo); color: var(--texto); }

.enlace { color: var(--enlace); font-weight: 500; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.enlace:hover { color: var(--marca-osc); text-decoration-color: currentColor; }

/* Interruptor «Mantener la sesión iniciada» (casilla real, dibujada como interruptor) */
.interr { position: relative; display: inline-flex; align-items: center; gap: 10px; justify-self: start; cursor: pointer; font-size: 14px; color: var(--texto); margin: 0; font-weight: 400; }
.interr input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.interr .sw { width: 36px; height: 22px; border-radius: 999px; background: #87919e; position: relative; flex: none; transition: background-color 180ms ease; }
.interr .sw::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform 180ms var(--ease-out);
}
.interr input:checked + .sw { background: var(--marca-osc); }
.interr input:checked + .sw::after { transform: translateX(14px); }
.interr input:focus-visible + .sw { outline: 2px solid var(--foco); outline-offset: 2px; }

.enlace.volver { justify-self: center; font-size: 13.5px; }
.ayuda { font-size: 12.5px; color: var(--texto2); }

/* Páginas de estado sin formulario (revisa.php) */
.acceso-caja { width: 100%; max-width: 360px; margin: auto; display: grid; gap: 16px; }
.icono-estado {
    width: 52px; height: 52px; border-radius: 12px;
    display: grid; place-items: center;
    background: #e6f0f5; color: var(--marca-osc); font-size: 22px;
}
.acceso-caja .nota { margin: 0; font-size: 13.5px; color: var(--texto2); }
.btn-entrar.como-boton { display: grid; place-items: center; text-decoration: none; }
.btn-entrar.como-boton:hover { color: #fff; }
.btn-entrar {
    height: 46px;
    border: 1px solid var(--marca-osc);
    border-radius: 8px;
    background: var(--marca-osc);
    color: #fff;
    font: inherit;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: transform 160ms var(--ease-out), background-color 150ms ease;
}
.btn-entrar:hover { background: #003a58; }
.btn-entrar:active { transform: scale(.97); }

/* Error de acceso (includes/mensajes.php) */
.acceso-form .message_div p:empty,
.acceso-form .message_div > p { display: none; }
.acceso-form .alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #f5c2bd;
    background: #fdecea;
    color: var(--error);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0;
}
.acceso-form .alert p { margin: 0; text-align: left !important; display: block; }
.acceso-form .alert::before { content: "\f06a"; font-family: "Font Awesome 7 Free"; font-weight: 900; }
.acceso-form .alert-success { border-color: #bfe3cf; background: #e8f5ee; color: #1f7a4d; }
.acceso-form .alert-success::before { content: "\f058"; }

.acceso-pie { text-align: center; font-size: 12.5px; color: var(--texto2); margin-top: 16px; }

@media (max-width: 860px) {
    .acceso-marco { grid-template-columns: 1fr; }
    .acceso-marca { display: none; }
    .acceso-form { padding: 24px 20px; }
    .acceso-form .logo-movil { display: block; margin: 16px auto 0; height: 34px; width: auto; }  /* SVG: nítido a cualquier tamaño */
}
@media (hover: none) {
    .btn-entrar:hover { background: var(--marca-osc); }
    .ctrl:hover { border-color: var(--borde-ctrl); }
}
@media (prefers-reduced-motion: reduce) {
    .btn-entrar:active { transform: none; }
    .interr .sw, .interr .sw::after { transition: none; }
}
