/* ============================================================
   SIAE — Acceso al sistema  ·  v1.3 (refinado)
   Escuela Secundaria General Federal No. 2
   "Fray Matías Antonio de Córdova y Ordóñez"

   Principios: tarjeta compacta, menos adornos, líneas finas,
   tipografía con aire y movimiento discreto. Sin scroll.
   ============================================================ */

:root {
    --navy-950: #070d24;
    --navy-900: #0d1b46;
    --navy-800: #16295f;
    --navy-700: #1f3677;
    --gold: #b8932a;
    --gold-soft: #d9bb66;
    --gold-bright: #ecd48e;
    --orange: #e0621a;
    --blue: #1565d8;
    --paper: #fcfaf4;
    --ink: #1c2336;
    --ink-soft: #667088;
    --line: rgba(28, 35, 54, 0.12);
    --danger: #a4302a;
    --danger-bg: #fbebe9;

    --font-display: 'Fraunces', 'Georgia', serif;
    --font-ui: 'Plus Jakarta Sans', system-ui, sans-serif;

    --radius-card: 20px;
    --radius-input: 11px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: var(--font-ui);
    background: #f0f4fb;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ====================== FONDO ====================== */
.scene {
    --ox: 0px; --oy: 0px;
    position: fixed;
    inset: 0;
    z-index: 0;
    background: #f0f4fb;
    overflow: hidden;
}

.scene-photo {
    position: absolute;
    inset: -30px;
    background: url('../img/fondos/fondo2.jpeg') center 58% / cover no-repeat;
    filter: blur(6px) saturate(1.05) brightness(1.12);
    translate: calc(var(--ox) * 0.4) calc(var(--oy) * 0.4);
    transform: scale(1.06);
    animation: sceneDrift 45s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes sceneDrift {
    from { transform: scale(1.06) translate3d(0, 0, 0); }
    to   { transform: scale(1.11) translate3d(-1%, -0.8%, 0); }
}

.scene-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 60% at 50% 50%, rgba(255, 255, 255, 0.5), transparent 78%),
        linear-gradient(180deg,
            rgba(247, 249, 254, 0.68) 0%,
            rgba(240, 245, 253, 0.56) 50%,
            rgba(229, 237, 250, 0.72) 100%);
}

.scene-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 62%, rgba(12, 26, 69, 0.08) 100%);
    pointer-events: none;
}

.scene-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    translate: var(--ox) var(--oy);
    will-change: transform;
}

.scene-orb--gold   { width: 420px; height: 420px; top: -150px; right: 10%;   background: rgba(217, 187, 102, 0.36); animation: orbFloat 16s ease-in-out infinite alternate; }
.scene-orb--blue   { width: 480px; height: 480px; bottom: -220px; right: 22%; background: rgba(21, 101, 216, 0.16);  animation: orbFloat 19s ease-in-out -4s infinite alternate-reverse; }
.scene-orb--orange { width: 380px; height: 380px; bottom: -170px; left: 8%;   background: rgba(224, 98, 26, 0.14);   animation: orbFloat 21s ease-in-out -8s infinite alternate; }

@keyframes orbFloat {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(30px, -24px, 0) scale(1.1); }
}

.gold-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.gold-particles span {
    position: absolute;
    width: 3px; height: 3px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 14s linear infinite;
    box-shadow: 0 0 6px rgba(184, 147, 42, 0.6);
}

@keyframes particleFloat {
    0%   { opacity: 0; transform: translateY(100vh) scale(0.4); }
    10%  { opacity: 0.5; }
    90%  { opacity: 0.3; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ====================== CONTENEDOR ====================== */
.login-container {
    position: relative;
    z-index: 1;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 4vh, 40px) clamp(12px, 2.4vw, 28px);
}

.tilt {
    width: 100%;
    max-width: 940px;
    height: min(100%, 600px);
    transition: transform 0.4s ease-out;
    will-change: transform;
}

/* ====================== TARJETA ====================== */
.credential {
    --mx: 50%; --my: -40%;
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    background: var(--paper);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow:
        0 40px 80px -20px rgba(12, 26, 69, 0.34),
        0 14px 30px -10px rgba(12, 26, 69, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.8);
    opacity: 0;
    transform: translateY(22px) scale(0.98);
    animation: credentialIn 0.9s var(--ease) forwards;
}

.credential::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.10), transparent 62%);
    opacity: 0;
    transition: opacity 0.4s;
}

.credential:hover::before { opacity: 1; }

/* Franja fina naranja → azul (Entradas / Salidas) */
.credential::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    z-index: 3;
    background: linear-gradient(90deg, var(--orange), #f2a15e, var(--blue), #5b97ec, var(--orange));
    background-size: 200% 100%;
    animation: barSlide 12s linear infinite;
}

@keyframes barSlide { to { background-position: 200% 0; } }

.credential-ribbon {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 3;
    background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-bright) 50%, var(--gold) 80%, transparent);
    transform: scaleX(0);
    transform-origin: center;
    animation: ribbonGrow 1.1s 0.5s var(--ease) forwards;
}

@keyframes ribbonGrow   { to { transform: scaleX(1); } }
@keyframes credentialIn { to { opacity: 1; transform: translateY(0) scale(1); } }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Panel de identidad ---------- */
.id-panel {
    position: relative;
    flex: 0 0 40%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: clamp(30px, 6vh, 46px) clamp(24px, 2.8vw, 36px) clamp(14px, 2.4vh, 22px);
    color: #eef3f9;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 8%, rgba(217, 187, 102, 0.18), transparent 50%),
        radial-gradient(circle at 90% 100%, rgba(74, 99, 166, 0.34), transparent 55%),
        linear-gradient(175deg, var(--navy-800) 0%, var(--navy-900) 50%, var(--navy-950) 100%);
}

/* Marco interior muy fino */
.id-panel::after {
    content: '';
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(217, 187, 102, 0.20);
    border-radius: 12px;
    pointer-events: none;
}

.id-panel-inner {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.id-panel-inner > :not(h1) { animation: fadeUp 0.8s var(--ease) both; }
.id-panel-inner > .brand-stage  { animation-delay: 0.40s; }
.id-panel-inner > .brand-desc   { animation-delay: 0.52s; }
.id-panel-inner > .id-rule      { animation-delay: 0.60s; }
.id-panel-inner > .school-name  { animation-delay: 0.68s; }
.id-panel-inner > .school-motto { animation-delay: 0.76s; }
.id-panel-inner > .school-clave { animation-delay: 0.84s; }

.brand-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(130px, 32vh, 214px);
    height: clamp(130px, 32vh, 214px);
    margin-bottom: clamp(2px, 1vh, 10px);
}

.brand-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.brand-ring--1 {
    inset: 0;
    border: 1px solid rgba(217, 187, 102, 0.22);
    animation: ringBreath 6s ease-in-out infinite;
}

.brand-ring--3 {
    inset: 14%;
    background: radial-gradient(circle, rgba(217, 187, 102, 0.20) 0%, transparent 70%);
    animation: crestGlow 6s ease-in-out infinite;
}

@keyframes ringBreath {
    0%, 100% { transform: scale(0.97); opacity: 0.6; }
    50%      { transform: scale(1.03); opacity: 1; }
}

.brand-logo {
    position: relative;
    z-index: 1;
    display: block;
    width: auto;
    height: 62%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 10px;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.5));
    animation: logoFloat 8s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

.brand-desc {
    font-size: clamp(0.88rem, 2.1vh, 1rem);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.3px;
    color: #cbd8e8;
    max-width: 270px;
}

.id-rule {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 140px;
    margin: clamp(10px, 2.6vh, 20px) 0;
}

.id-rule::before, .id-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-soft));
}

.id-rule::after { transform: scaleX(-1); }

.id-rule i {
    width: 5px; height: 5px;
    background: var(--gold-soft);
    transform: rotate(45deg);
}

.school-name {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.9vh, 1.42rem);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.2px;
    max-width: 300px;
    color: #fff;
}

.school-motto {
    margin-top: clamp(5px, 1vh, 8px);
    font-size: clamp(0.86rem, 2vh, 0.96rem);
    font-style: italic;
    line-height: 1.5;
    color: #a3b5ca;
    max-width: 280px;
}

.school-clave {
    margin-top: clamp(10px, 2vh, 16px);
    padding: 5px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--gold-soft);
    border: 1px solid rgba(217, 187, 102, 0.32);
    border-radius: 999px;
}

.id-panel-footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.id-clock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    color: var(--gold-bright);
    letter-spacing: 0.3px;
    opacity: 0.92;
}

.id-clock::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #4ade80;
    animation: livePulse 2.4s ease-out infinite;
}

@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
    70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ---------- Divisoria ---------- */
.perforation {
    flex: 0 0 1px;
    z-index: 2;
    background-image: linear-gradient(to bottom, rgba(184, 147, 42, 0.45) 0 5px, transparent 5px 11px);
    background-size: 1px 11px;
    background-repeat: repeat-y;
}

/* ---------- Panel de acceso ---------- */
.access-panel {
    position: relative;
    flex: 1;
    min-height: 0;
    padding: clamp(46px, 9vh, 68px) clamp(28px, 4.4vw, 54px) clamp(14px, 2.6vh, 24px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(184, 147, 42, 0.09), transparent 70%),
        linear-gradient(180deg, #fffefb 0%, var(--paper) 100%);
    opacity: 0;
    animation: fadeUp 0.8s 0.45s var(--ease) forwards;
}

/* ---------- Escudo (icon.png): esquina superior derecha ---------- */
.crest-wrap {
    position: absolute;
    top: clamp(12px, 2.4vh, 20px);
    right: clamp(14px, 1.8vw, 22px);
    width: clamp(120px, 14vh, 120px);
    height: clamp(120px, 14vh, 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: crestIn 1s 0.7s var(--spring) backwards;
    transition: transform 0.4s var(--spring);
}

.crest-wrap:hover { transform: scale(1.06) rotate(-3deg); }

.crest-wrap::before {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184, 147, 42, 0.30) 0%, rgba(184, 147, 42, 0.07) 48%, transparent 70%);
    animation: crestGlow 6s ease-in-out infinite;
}

.crest {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%; height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(12, 26, 69, 0.28));
}

@keyframes crestIn {
    from { opacity: 0; transform: scale(0.5) rotate(-12deg); }
    to   { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes crestGlow {
    0%, 100% { opacity: 0.6; transform: scale(0.95); }
    50%      { opacity: 1;   transform: scale(1.05); }
}

/* ---------- Encabezado ---------- */
.access-header { margin-bottom: clamp(12px, 3vh, 26px); text-align: center; }

.access-header h2 {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 6.2vh, 3rem);
    font-weight: 500;
    letter-spacing: -0.3px;
    line-height: 1.1;
    color: var(--navy-900);
}

.access-header p {
    margin-top: clamp(4px, 0.9vh, 8px);
    font-size: clamp(0.96rem, 2.3vh, 1.12rem);
    color: var(--ink-soft);
}

.access-header::after {
    content: '';
    display: block;
    width: 56px; height: 1px;
    margin: clamp(10px, 2vh, 16px) auto 0;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: lineGrow 1.1s 0.9s var(--ease) backwards;
}

@keyframes lineGrow { from { transform: scaleX(0); } }

/* ---------- Alerta ---------- */
.alert-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--danger-bg);
    border: 1px solid rgba(164, 48, 42, 0.22);
    border-left: 3px solid var(--danger);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-input);
    font-size: 0.94rem;
    font-weight: 500;
    margin-bottom: clamp(10px, 1.8vh, 18px);
    animation: shake 0.45s ease, alertIn 0.4s var(--ease);
}

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-box i { font-size: 1.05rem; flex-shrink: 0; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ---------- Formulario ---------- */
.access-form { display: flex; flex-direction: column; gap: clamp(10px, 2vh, 16px); }

.field {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUp 0.6s var(--ease) forwards;
}

.field:nth-of-type(1) { animation-delay: 0.55s; }
.field:nth-of-type(2) { animation-delay: 0.65s; }

.field label {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--navy-800);
    margin-bottom: clamp(4px, 0.9vh, 7px);
    transition: color 0.25s var(--ease);
}

.field:focus-within label { color: #8a6d0c; }

.field-control { position: relative; display: flex; align-items: center; }

/* Icono sin cajita: más limpio */
.field-icon {
    position: absolute;
    left: 18px;
    display: flex; align-items: center; justify-content: center;
    color: #8b93a6;
    font-size: 1.25rem;
    pointer-events: none;
    transition: color 0.25s var(--ease), transform 0.35s var(--spring);
}

.field-control input {
    width: 100%;
    height: clamp(46px, 7.6vh, 60px);
    padding: 0 54px 0 54px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-input);
    color: var(--ink);
    font-size: 1.06rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.field-control input::placeholder { color: #a8aebb; }
.field-control input:hover { border-color: rgba(184, 147, 42, 0.5); }

.field-control input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 147, 42, 0.16);
}

.field-control:focus-within .field-icon { color: #8a6d0c; transform: scale(1.08); }

.field-toggle {
    position: absolute;
    right: 7px;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #8b93a6;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.field-toggle:hover { background: rgba(28, 35, 54, 0.06); color: var(--ink); }
.field-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.field-hint {
    margin-top: 6px;
    font-size: 0.86rem;
    color: #8f6f0c;
    display: none;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.field-hint.is-visible { display: flex; animation: alertIn 0.3s var(--ease); }

/* ---------- Botón ---------- */
.submit-btn {
    position: relative;
    overflow: hidden;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 5px 5px 22px;
    background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-900) 60%, var(--navy-950) 100%);
    border: 1px solid rgba(217, 187, 102, 0.45);
    border-radius: var(--radius-input);
    color: #fff;
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 10px 22px -6px rgba(12, 26, 69, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUp 0.6s 0.75s var(--ease) forwards;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 35%;
    background: linear-gradient(100deg, transparent, rgba(236, 212, 142, 0.26), transparent);
    transform: translateX(-130%);
    animation: btnSweep 8s 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes btnSweep {
    0%        { transform: translateX(-130%); }
    30%, 100% { transform: translateX(380%); }
}

.submit-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -6px rgba(12, 26, 69, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.btn-icon {
    width: clamp(40px, 6.6vh, 48px);
    height: clamp(40px, 6.6vh, 48px);
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: var(--navy-950);
    font-size: 1.25rem;
    border-radius: 8px;
    transition: transform 0.25s var(--ease);
}

.submit-btn:hover .btn-icon { transform: translateX(3px); }

.submit-btn.is-loading { pointer-events: none; opacity: 0.85; }
.submit-btn.is-loading .btn-icon i { display: inline-block; animation: spin 0.7s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.access-footer {
    margin-top: clamp(10px, 2.2vh, 20px);
    padding-top: clamp(8px, 1.6vh, 14px);
    border-top: 1px solid var(--line);
    text-align: center;
}

.access-footer span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.86rem;
    color: var(--ink-soft);
}

.access-footer i { color: var(--gold); }

/* ====================== LOGO CGT ====================== */
.corner-logo {
    position: fixed;
    left: 12px;
    bottom: 10px;
    width: clamp(34px, 3.8vw, 52px);
    height: auto;
    z-index: 30;
    filter: drop-shadow(0 4px 8px rgba(12, 26, 69, 0.3));
}

/* ============================================================
   RESPONSIVE — sin scroll en ningún tamaño
   ============================================================ */

@media (min-width: 1500px) and (min-height: 880px) {
    .tilt { max-width: 1020px; height: min(100%, 660px); }
}

@media (max-width: 920px) and (min-width: 701px) {
    .id-panel { flex-basis: 38%; padding-left: 20px; padding-right: 20px; }
    .access-panel { padding-left: 28px; padding-right: 28px; }
    .brand-desc, .school-motto { max-width: 180px; }
}

/* Alto reducido: compactar */
@media (max-height: 700px) {
    .id-rule { display: none; }
    .brand-desc { margin-top: 4px; }
    .school-name { margin-top: 12px; }
}

@media (max-height: 600px) {
    .school-motto { display: none; }
    .school-clave { padding: 3px 12px; font-size: 0.7rem; }
    .access-header p { display: none; }
    .id-panel { padding-top: 26px; }
}

@media (max-height: 500px) {
    .school-motto, .school-clave, .id-panel-footer, .access-footer { display: none; }
    .credential { border-radius: 16px; }
}

/* ---------- MÓVIL / VERTICAL: paneles apilados ---------- */
@media (max-width: 700px) {
    .tilt { max-width: 440px; height: min(100%, 700px); }
    .credential { flex-direction: column; border-radius: 18px; }

    .id-panel { flex: none; padding: 14px 18px; }

    .id-panel::after,
    .school-motto,
    .id-rule,
    .id-panel-footer,
    .brand-ring { display: none; }

    .id-panel-inner {
        flex: none;
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 14px;
        align-items: center;
        justify-items: start;
        text-align: left;
    }

    .brand-stage { grid-row: 1 / span 3; width: auto; height: auto; margin: 0; }
    .brand-logo { height: clamp(60px, 10.4vh, 82px); animation: none; }
    .brand-desc { font-size: 0.78rem; max-width: none; text-align: left; }
    .school-name { font-size: clamp(1rem, 2.5vh, 1.14rem); max-width: none; margin-top: 2px; }
    .school-clave { margin-top: 6px; padding: 2px 10px; font-size: 0.7rem; align-self: start; }

    .perforation {
        flex: 0 0 1px;
        background-image: linear-gradient(to right, rgba(184, 147, 42, 0.45) 0 5px, transparent 5px 11px);
        background-size: 11px 1px;
        background-repeat: repeat-x;
    }

    .access-panel { padding: clamp(14px, 3vh, 22px) 22px clamp(12px, 2.4vh, 20px); }

    .crest-wrap {
        top: clamp(8px, 1.8vh, 14px);
        right: 14px;
        width: clamp(56px, 10vh, 72px);
        height: clamp(56px, 10vh, 72px);
    }

    .crest-wrap::before { inset: -8px; }

    .access-header { text-align: left; padding-right: 82px; }
    .access-header h2 { font-size: clamp(1.9rem, 5.2vh, 2.4rem); }
    .access-header::after { margin-left: 0; }
}

@media (max-width: 700px) and (max-height: 700px) {
    .access-footer, .school-clave { display: none; }
}

@media (max-width: 700px) and (max-height: 600px) {
    .brand-desc { display: none; }
}

@media (max-width: 700px) and (max-height: 560px) {
    .access-header p { display: none; }
    .id-panel { padding: 10px 16px; }
}

@media (max-width: 400px) {
    .login-container { padding: 10px; }
    .corner-logo { display: none; }
}

/* ---------- HORIZONTAL en celular (muy bajo) ---------- */
@media (max-height: 440px) and (orientation: landscape) {
    .login-container { padding: 8px 12px; }
    .tilt { max-width: 820px; height: 100%; }
    .credential { flex-direction: row; }
    .id-panel { flex: 0 0 36%; padding: 12px 14px; }
    .id-panel-inner { display: flex; flex-direction: column; text-align: center; }
    .id-panel-inner > * { justify-self: center; }
    .brand-stage { grid-row: auto; }
    .brand-logo { height: 58px; }
    .access-panel { padding: 12px 20px; }
    .access-header { text-align: center; padding-right: 0; margin-bottom: 8px; }
    .access-header::after { margin-left: auto; }
    .access-header h2 { font-size: 1.5rem; }
    .field-control input { height: 38px; }
    .btn-icon { width: 32px; height: 32px; }
    .access-form { gap: 8px; }
    .perforation {
        flex: 0 0 1px;
        background-image: linear-gradient(to bottom, rgba(184, 147, 42, 0.45) 0 5px, transparent 5px 11px);
        background-size: 1px 11px;
        background-repeat: repeat-y;
    }
    .crest-wrap { width: 40px; height: 40px; top: 8px; right: 10px; }
    .corner-logo { display: none; }
}