/* =========================================================
   Inicio de sesión · diseño split-screen
   Paleta: crema, verde oliva, verde oscuro y dorado suave
   ========================================================= */

.acceso {
    --crema: #F7F2E8;
    --crema-profunda: #EFE6D4;
    --oliva: #536B45;
    --verde: #234C3B;
    --verde-hover: #1B3D2F;
    --dorado: #C5A56A;
    --dorado-suave: #E9DCC0;
    --blanco: #FFFFFF;

    --tinta: #1F2A22;
    --tinta-suave: #5D665E;
    --tinta-tenue: #8A8F86;
    --linea: #E4DCCB;

    --serif: 'Cormorant Garamond', 'Times New Roman', serif;
    --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --radio-control: 14px;

    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--tinta);
    font-family: var(--sans);
    background-color: var(--crema-profunda);
    background-image:
        radial-gradient(circle at 8% 12%, rgba(197, 165, 106, 0.22), transparent 32%),
        radial-gradient(circle at 92% 88%, rgba(83, 107, 69, 0.16), transparent 36%),
        radial-gradient(rgba(35, 76, 59, 0.07) 1px, transparent 1.4px);
    background-size: auto, auto, 22px 22px;
    -webkit-font-smoothing: antialiased;
}

.acceso ::selection {
    background: var(--dorado-suave);
    color: var(--verde);
}

/* ---------- Lienzo y tarjeta ---------- */

.acceso__lienzo {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
}

/* La tarjeta ocupa todo el ancho y alto del dispositivo */
.acceso__tarjeta {
    flex: 1;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 12px;
    padding: 12px;
    background: var(--blanco);
    animation: aparecer 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ---------- Panel izquierdo ---------- */

.acceso__panel {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: clamp(24px, 4vw, 52px) clamp(20px, 4.5vw, 60px) clamp(20px, 3vw, 32px);
}

.marca {
    display: flex;
    align-items: center;
    gap: 14px;
}

.marca__sello {
    display: block;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.marca__texto {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.marca__previo {
    font-family: var(--serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4B3328;
}

.marca__texto strong {
    margin-top: 1px;
    font-family: var(--serif);
    font-size: 30px;
    font-style: italic;
    font-weight: 600;
    color: var(--verde);
    letter-spacing: 0.005em;
}

.marca__texto small {
    margin-top: 4px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--dorado);
}

.acceso__contenido {
    width: 100%;
    max-width: 420px;
    margin: auto;
}

.acceso__titulo {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(36px, 4.2vw, 48px);
    font-weight: 600;
    line-height: 1.05;
    color: var(--verde);
    letter-spacing: -0.01em;
}

.acceso__subtitulo {
    margin: 12px 0 30px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--tinta-suave);
}

/* ---------- Mensajes ---------- */

.mensaje {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.mensaje .ti {
    font-size: 18px;
    margin-top: 1px;
    flex-shrink: 0;
}

.mensaje--error {
    background: #FBEDEA;
    border: 1px solid #F0CFC8;
    color: #8A2E22;
}

.mensaje--exito {
    background: #EAF4EC;
    border: 1px solid #C9E2CE;
    color: #1F5130;
}

/* Páginas de recuperación de contraseña y documentos legales */
.acceso__volver {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    font-size: 14px;
}

/* ---------- Formulario ---------- */

.ingreso {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dato label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tinta);
}

.dato__control {
    position: relative;
    display: flex;
    align-items: center;
}

.dato__control > .ti {
    position: absolute;
    left: 16px;
    font-size: 19px;
    color: var(--tinta-tenue);
    pointer-events: none;
    transition: color 0.2s;
}

.dato__control input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 46px;
    border: 1px solid var(--linea);
    border-radius: var(--radio-control);
    background: var(--crema);
    color: var(--tinta);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.dato__control input:-webkit-autofill,
.dato__control input:-webkit-autofill:hover,
.dato__control input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--tinta);
    -webkit-box-shadow: 0 0 0 40px var(--crema) inset;
    caret-color: var(--tinta);
}

.dato__control input::placeholder {
    color: #A8A99F;
}

.dato__control input:hover {
    border-color: #D3C8B1;
}

.dato__control input:focus {
    outline: none;
    background: var(--blanco);
    border-color: var(--oliva);
    box-shadow: 0 0 0 4px rgba(83, 107, 69, 0.14);
}

.dato__control:focus-within > .ti {
    color: var(--oliva);
}

#contrasena {
    padding-right: 52px;
}

.dato__ver {
    position: absolute;
    right: 6px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--tinta-tenue);
    font-size: 19px;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

.dato__ver:hover {
    color: var(--verde);
    background: rgba(83, 107, 69, 0.08);
}

.dato--error .dato__control input {
    border-color: #C4553F;
    box-shadow: 0 0 0 4px rgba(196, 85, 63, 0.12);
    animation: temblar 0.35s;
}

.ingreso__fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: -2px;
}

/* Casilla personalizada */

.recordar {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--tinta-suave);
    cursor: pointer;
    user-select: none;
}

.recordar input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.recordar__marca {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid #CFC5AF;
    border-radius: 6px;
    background: var(--blanco);
    color: transparent;
    font-size: 14px;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.recordar input:checked + .recordar__marca {
    background: var(--verde);
    border-color: var(--verde);
    color: var(--blanco);
}

.recordar input:focus-visible + .recordar__marca {
    box-shadow: 0 0 0 4px rgba(83, 107, 69, 0.2);
}

.enlace {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--oliva);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: color 0.2s, text-decoration-color 0.2s;
}

.enlace:hover {
    color: var(--verde);
    text-decoration-color: var(--dorado);
}

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

.boton {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    padding: 0 22px;
    border-radius: var(--radio-control);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.boton:active {
    transform: translateY(1px);
}

.boton--primario {
    margin-top: 6px;
    border: 0;
    background: var(--verde);
    color: var(--blanco);
    box-shadow: 0 12px 24px -12px rgba(35, 76, 59, 0.65);
}

.boton--primario:hover {
    background: var(--verde-hover);
    box-shadow: 0 16px 28px -12px rgba(35, 76, 59, 0.7);
}

.boton--primario .ti {
    font-size: 18px;
    transition: transform 0.2s;
}

.boton--primario:hover .ti {
    transform: translateX(3px);
}

.boton.cargando {
    color: transparent;
    pointer-events: none;
}

.boton.cargando::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: var(--blanco);
    border-radius: 50%;
    animation: girar 0.7s linear infinite;
}

.acceso :focus-visible {
    outline: 2px solid var(--dorado);
    outline-offset: 3px;
}

.dato__control input:focus-visible {
    outline: none;
}

/* ---------- Aviso informativo ---------- */

.aviso {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 14px 14px 16px;
    border: 1px solid var(--dorado-suave);
    border-left: 3px solid var(--dorado);
    border-radius: 12px;
    background: #FBF7EE;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tinta-suave);
    animation: aparecer 0.3s ease both;
}

.aviso[hidden] {
    display: none;
}

.aviso > .ti {
    font-size: 18px;
    color: var(--dorado);
    margin-top: 1px;
    flex-shrink: 0;
}

.aviso p {
    flex: 1;
    margin: 0;
}

.aviso__cerrar {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: -4px -4px 0 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--tinta-tenue);
    cursor: pointer;
}

.aviso__cerrar:hover {
    background: rgba(197, 165, 106, 0.16);
    color: var(--tinta);
}

.acceso__legal {
    margin: 0;
    max-width: 440px;
    align-self: center;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
    color: var(--tinta-tenue);
}

.acceso__legal strong {
    font-weight: 600;
    color: var(--tinta-suave);
}

/* ---------- Instalar la aplicación (solo aparece si el navegador lo permite) ---------- */

.instalar-app {
    display: flex;
    justify-content: center;
    max-width: 440px;
    align-self: center;
    width: 100%;
}

.instalar-app__boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--linea, #d9d3c4);
    border-radius: var(--radio-control);
    background: transparent;
    color: var(--verde);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.instalar-app__boton .ti {
    font-size: 18px;
}

.instalar-app__boton:hover {
    border-color: var(--verde);
    background: rgba(35, 76, 59, .06);
}

.instalar-app__boton:focus-visible {
    outline: 2px solid var(--verde);
    outline-offset: 2px;
}

.instalar-app__ios {
    display: flex;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--tinta-suave);
}

.instalar-app__ios .ti {
    flex: none;
    margin-top: 2px;
    font-size: 16px;
}

.instalar-app [hidden] {
    display: none;
}

/* ---------- Panel derecho: fotografía ---------- */

.acceso__foto {
    position: relative;
    overflow: hidden;
    margin: 0;
    border-radius: 20px;
    background: var(--verde);
    isolation: isolate;
}

.acceso__foto img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 68% 50%;
    filter: saturate(1.05) contrast(1.02);
    transform: scale(1.04);
    animation: acercar 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Velo cálido y degradado para la leyenda */
.acceso__foto::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(135deg, rgba(197, 165, 106, 0.22), rgba(197, 120, 60, 0.08) 55%, transparent);
    mix-blend-mode: multiply;
    pointer-events: none;
}

.acceso__foto::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(20, 38, 30, 0.82) 0%, rgba(20, 38, 30, 0.35) 34%, transparent 58%);
    pointer-events: none;
}

.foto__estado {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 12px;
    font-weight: 600;
    color: var(--verde);
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.3);
}

.foto__punto {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--oliva);
    box-shadow: 0 0 0 3px rgba(83, 107, 69, 0.22);
}

.foto__leyenda {
    position: absolute;
    left: clamp(24px, 3.5vw, 44px);
    right: clamp(24px, 3.5vw, 44px);
    bottom: clamp(24px, 3.5vw, 44px);
    z-index: 2;
    color: var(--blanco);
}

.foto__antetitulo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--dorado);
}

.foto__antetitulo::before {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--dorado);
}

.foto__frase {
    max-width: 440px;
    margin: 12px 0 0;
    font-family: var(--serif);
    font-size: clamp(24px, 2.6vw, 34px);
    font-weight: 500;
    line-height: 1.2;
}

.foto__frase em {
    color: var(--dorado-suave);
}

/* ---------- Animaciones ---------- */

@keyframes aparecer {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes acercar {
    from { transform: scale(1.12); }
    to { transform: scale(1.04); }
}

@keyframes girar {
    to { transform: rotate(360deg); }
}

@keyframes temblar {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
    .acceso__tarjeta {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    }

    .foto__frase {
        font-size: 24px;
    }
}

@media (max-width: 860px) {
    .acceso__tarjeta {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .marca {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }

    .acceso__foto {
        order: -1;
        height: clamp(220px, 30vh, 340px);
    }

    .acceso__foto img {
        object-position: 60% 45%;
    }

    .acceso__foto::after {
        background: linear-gradient(to top, rgba(20, 38, 30, 0.88) 0%, rgba(20, 38, 30, 0.5) 50%, rgba(20, 38, 30, 0.05) 85%);
    }

    .foto__frase {
        font-size: 22px;
        max-width: 380px;
    }

    .acceso__contenido {
        margin: 0 auto;
    }
}

/* ---------- Móvil ---------- */

@media (max-width: 560px) {
    .acceso__tarjeta {
        padding: 10px;
    }

    .acceso__foto {
        height: 190px;
        border-radius: 20px;
    }

    .foto__leyenda {
        left: 20px;
        right: 20px;
        bottom: 18px;
    }

    .foto__frase {
        font-size: 19px;
        margin-top: 8px;
    }

    .foto__estado {
        top: 14px;
        right: 14px;
        padding: 6px 12px;
    }

    .acceso__panel {
        gap: 24px;
        padding: 18px 10px 14px;
    }

    .acceso__subtitulo {
        margin-bottom: 24px;
    }
}

/* Firma del software bajo el texto legal */
.acceso__firma {
    display: block;
    align-self: center;
    margin-top: 10px;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--tinta-tenue);
}

.acceso__firma .marca-sistema__nombre {
    font-weight: 600;
    color: var(--tinta-suave);
}
