/*
 * «E28» selector.css — Elegir la institución (login/selector.ctp)
 *
 * Fondo propio: la bandera (venezuela.png) bajo un velo azul noche, más denso
 * a la izquierda para que el texto se lea. Cada institución es una hoja
 * membretada: el logo arriba, renglones y el nombre como en un oficio.
 */
:root {
    --ss-noche: #06142b;
    --ss-tinta: #17202e;
    --ss-tinta-suave: #5b6779;
    --ss-renglon: #e2e6ed;
    --ss-hoja: #ffffff;
    --ss-oro: #e8b923;
    --ss-foco: #ffd54a;
}

.ss-pagina {
    margin: 0;
    min-height: 100vh;
    color: #fff;
    background-color: var(--ss-noche);
    background-image:
        linear-gradient(100deg, rgba(6, 20, 43, .94) 0%, rgba(6, 20, 43, .82) 42%, rgba(6, 20, 43, .5) 100%),
        url(/assets/img/venezuela.png);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ss-marco {
    box-sizing: border-box;
    max-width: 1040px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 56px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
}

/* ── Cabecera ──────────────────────────────────────────────────────────── */
.ss-cabeza { max-width: 640px; }
.ss-sistema {
    margin: 0 0 14px;
    font-size: .95rem;
    color: rgba(255, 255, 255, .72);
}
.ss-sistema i { color: var(--ss-oro); margin-right: 6px; }
.ss-titulo {
    margin: 0 0 12px;
    font-size: clamp(1.9rem, 4.2vw, 2.9rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -.015em;
    color: #fff;
}
.ss-guia {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .78);
}

/* ── Hojas ─────────────────────────────────────────────────────────────── */
.ss-hojas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 28px;
    max-width: 860px;
}

.ss-hoja {
    --fold: 34px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 300px;
    padding: 30px 30px 24px 34px;
    border: 0;
    border-radius: 4px;
    text-align: left;
    color: var(--ss-tinta);
    background:
        linear-gradient(225deg, transparent var(--fold), var(--ss-hoja) var(--fold));
    box-shadow: 0 18px 40px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .2);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
    animation: ss-llega .55s cubic-bezier(.2, .7, .2, 1) backwards;
    animation-delay: calc(var(--i, 0) * 110ms + 120ms);
}
/* La esquina doblada, como una hoja que se levanta */
.ss-hoja::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: var(--fold);
    height: var(--fold);
    background: linear-gradient(45deg, #cfd5df 0%, #eef1f5 48%, transparent 50%);
    border-bottom-left-radius: 3px;
    box-shadow: -2px 2px 4px rgba(0, 0, 0, .12);
    transition: width .25s ease, height .25s ease;
}
/* Filo de color: aparece al pasar o enfocar */
.ss-hoja::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    border-radius: 4px 0 0 4px;
    background: var(--ss-oro);
    transform: scaleY(.18);
    transform-origin: top;
    transition: transform .3s ease;
}
.ss-hoja:hover,
.ss-hoja:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 26px 50px rgba(0, 0, 0, .42), 0 3px 8px rgba(0, 0, 0, .22);
}
.ss-hoja:hover { --fold: 44px; }
.ss-hoja:hover::before,
.ss-hoja:focus-visible::before { width: 44px; height: 44px; }
.ss-hoja:hover::after,
.ss-hoja:focus-visible::after { transform: scaleY(1); }
.ss-hoja:focus { outline: none; }
.ss-hoja:focus-visible { outline: 3px solid var(--ss-foco); outline-offset: 4px; }

.ss-membrete {
    display: flex;
    align-items: center;
    height: 92px;
}
.ss-logo {
    display: block;
    max-height: 92px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}
.ss-renglones { display: grid; gap: 7px; }
.ss-renglones i { display: block; height: 2px; border-radius: 2px; background: var(--ss-renglon); }
.ss-renglones i:nth-child(2) { width: 82%; }
.ss-renglones i:nth-child(3) { width: 58%; }

.ss-nombre {
    font-size: 1.32rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--ss-tinta);
    flex: 1;
}

.ss-pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px dashed var(--ss-renglon);
}
.ss-siglas {
    font-size: .95rem;
    font-weight: 600;
    color: var(--ss-tinta-suave);
    letter-spacing: .02em;
}
.ss-entrar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .95rem;
    color: var(--ss-noche);
    background: #f3f5f8;
    transition: background .2s ease;
}
.ss-hoja:hover .ss-entrar,
.ss-hoja:focus-visible .ss-entrar { background: var(--ss-oro); }

/* Entrando: la hoja elegida muestra la espera; las demás se apagan */
.ss-cargando {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(6, 20, 43, .25);
    border-top-color: var(--ss-noche);
    border-radius: 50%;
    animation: ss-gira .7s linear infinite;
}
.ss-hojas.ss-ocupado .ss-hoja { pointer-events: none; }
.ss-hojas.ss-ocupado .ss-hoja:not(.ss-elegida) { opacity: .45; transform: none; }
.ss-hoja.ss-elegida .ss-entrar { background: var(--ss-oro); }
.ss-hoja.ss-elegida .ss-cargando { display: inline-block; }
.ss-hoja.ss-elegida .ss-entrar .fa-door-open { display: none; }

.ss-vacio {
    max-width: 560px;
    padding: 16px 18px;
    border-radius: 6px;
    color: var(--ss-tinta);
    background: #fff4d6;
}
.ss-vacio i { color: #a86200; margin-right: 6px; }

@keyframes ss-llega {
    from { opacity: 0; transform: translateY(24px) rotate(-.6deg); }
    to   { opacity: 1; transform: none; }
}
@keyframes ss-gira { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
    .ss-marco { padding: 32px 16px; gap: 28px; justify-content: flex-start; }
    .ss-pagina { background-attachment: scroll; }
    .ss-hoja { min-height: 0; padding: 24px 22px 20px 26px; }
    .ss-membrete { height: 72px; }
    .ss-logo { max-height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
    .ss-hoja { animation: none; transition: none; }
    .ss-hoja::before, .ss-hoja::after, .ss-entrar { transition: none; }
    .ss-hoja:hover, .ss-hoja:focus-visible { transform: none; }
}
