:root {
    color-scheme: light;
    --login-primary: #3347c7;
    --login-purple: #4a55e8;
    --login-teal: #18bdb7;
    --login-ink: #18235a;
    --login-muted: #7885b2;
    --login-input: #eef3ff;
    --login-line: #c9d7ff;
}

* { box-sizing: border-box; }

body.eg-login-page {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    color: var(--login-ink);
    background:
        radial-gradient(ellipse 70% 48% at 5% 44%, rgba(155,177,255,.55), transparent 72%),
        radial-gradient(ellipse 68% 42% at 98% 56%, rgba(128,152,255,.42), transparent 70%),
        linear-gradient(145deg, #3347c7 0%, #4657dc 48%, #687ef2 100%);
    font-family: Poppins, Inter, Arial, sans-serif;
}

.login-shell { width: 100%; min-height: 100vh; min-height: 100svh; margin: 0 auto; padding: 10px 24px 26px; }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; min-height: 150px; }
.login-brand-logo { display: block; width: min(440px, 38vw); height: auto; max-height: 104px; object-fit: contain; }
.login-decoration { position: absolute; pointer-events: none; }
.login-decoration-dots {
    top: 28px; left: max(3vw, calc((100vw - 1380px) / 2)); width: 92px; height: 78px;
    background-image: radial-gradient(circle, rgba(255,255,255,.4) 0 5px, transparent 5.5px);
    background-size: 28px 28px;
}
.login-decoration-cap { top: 22px; right: max(4vw, calc((100vw - 1360px) / 2)); width: 72px; height: 72px; color: #fff; }
.login-decoration-cap svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; }
.login-decoration-cap svg path:last-child { stroke: #25d7d1; }

.login-school-badge {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 18px;
    width: min(500px, calc(100% - 28px));
    min-height: 88px;
    margin: 0 auto -44px;
    padding: 12px 22px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(71,91,193,.2);
}
.login-school-logo { width: min(180px, 38%); height: 62px; flex: 0 0 auto; padding: 4px 8px; border: 1px solid #e4e9f3; border-radius: 10px; background: #fff; object-fit: contain; }
.login-school-name { flex: 1 1 auto; min-width: 0; padding-left: 17px; border-left: 2px solid #d5ddff; color: #25366f; font-size: clamp(16px, 1.4vw, 19px); font-weight: 700; line-height: 1.25; }
.login-country-flag { display: block; width: 29px; height: 20px; flex: 0 0 auto; border-radius: 2px; object-fit: cover; box-shadow: 0 1px 3px rgba(18,35,80,.16); }
span.login-country-flag { width: auto; height: auto; border-radius: 0; box-shadow: none; font-size: 29px; line-height: 1; }

.login-panel {
    position: relative;
    isolation: isolate;
    width: min(900px, 100%);
    min-height: 0;
    margin: 0 auto;
    padding: 72px 58px 28px;
    overflow: hidden;
    border-radius: 30px;
    background: linear-gradient(180deg, #fff 0%, #fff 72%, #f9fbff 100%);
    box-shadow: 0 20px 52px rgba(25,43,120,.22);
}
.login-panel::before, .login-panel::after { position: absolute; z-index: -1; right: -10%; bottom: -105px; left: -10%; height: 205px; content: ""; border-radius: 50% 50% 0 0 / 52% 52% 0 0; }
.login-panel::before { bottom: -126px; background: rgba(213,225,255,.4); transform: rotate(-4deg); }
.login-panel::after { background: linear-gradient(180deg, rgba(232,240,255,.1), rgba(220,233,255,.78)); transform: rotate(3deg); }

.login-form { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 760px; margin: 0 auto; }
.login-identity-column, .login-pin-column { min-width: 0; }
.login-identity-column { display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.login-pin-column { display: flex; flex-direction: column; align-items: center; }
.login-input-wrap { display: flex; align-items: center; gap: 13px; min-height: 58px; padding: 0 20px; border: 1.5px solid var(--login-line); border-radius: 13px; background: var(--login-input); transition: border-color .16s ease, box-shadow .16s ease; }
.login-input-wrap:focus-within, .login-pin-entry:focus-within { border-color: var(--login-purple); box-shadow: 0 0 0 3px rgba(74,85,232,.1); }
.login-input-wrap > svg { width: 29px; height: 29px; flex: 0 0 auto; fill: none; stroke: var(--login-purple); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.login-input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--login-ink); background: transparent; font: inherit; font-size: 19px; }
.login-input-wrap input::placeholder { color: var(--login-muted); opacity: 1; }
.login-pin-heading { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0 0 8px; color: var(--login-purple); font-size: 21px; font-weight: 700; }
.login-pin-heading svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }

.login-pin-entry { position: relative; display: flex; justify-content: center; align-items: center; width: min(230px, 100%); height: 22px; margin: 0 auto 7px; border: 1px solid transparent; border-radius: 8px; }
.login-pin-entry:focus-within { border-color: var(--login-line); background: rgba(238,243,255,.7); }
.login-pin-entry input { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; padding: 0 10px; border: 0; border-radius: inherit; outline: 0; color: var(--login-ink); background: transparent; font: inherit; font-size: 18px; letter-spacing: .32em; text-align: center; cursor: text; }
.login-pin-entry.is-manual-password input { opacity: 1; padding: 0 12px; color: var(--login-ink); background: var(--login-input); font: inherit; letter-spacing: .15em; text-align: center; }
.login-pin-dots { display: flex; justify-content: center; align-items: center; gap: 13px; pointer-events: none; }
.login-pin-entry.has-value .login-pin-dots { display: none; }
.login-pin-dots i { width: 8px; height: 8px; border-radius: 50%; background: #c8d1f5; }
.login-pin-dots i.is-filled { background: var(--login-purple); }
.login-pin-entry.is-manual-password .login-pin-dots { visibility: hidden; }
.login-keypad { display: grid; grid-template-columns: repeat(3, 102px); justify-content: center; gap: 8px; width: 322px; max-width: 100%; margin: 0 auto; }
.pin-key { min-height: 51px; padding: 0; border: 0; border-top: 0; border-radius: 11px; color: var(--login-ink); background: #f0f2ff; font: inherit; font-size: 22px; font-weight: 700; cursor: pointer; transition: background-color .14s ease, transform .14s ease; appearance: none; }
.pin-key:hover { background: #e4e8ff; }
.pin-key:active { transform: scale(.97); }
.pin-key:focus-visible, .login-submit:focus-visible { outline: 3px solid #25d7d1; outline-offset: 3px; }
.pin-key-delete { color: #707ba7; }
.pin-key-delete svg { width: 23px; height: 23px; fill: currentColor; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.pin-key-spacer { min-height: 51px; border: 0; background: transparent; }
.login-submit-row { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.login-form.is-manual-password .login-submit-row { position: static; display: flex; justify-content: center; width: auto; height: auto; margin: 9px auto 0; overflow: visible; clip-path: none; }
.login-submit { min-width: 150px; min-height: 42px; padding: 8px 24px; border: 0; border-radius: 11px; color: #fff; background: var(--login-purple); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.login-submit:hover { background: #3e48d4; }
.login-recovery-wrap { position: relative; z-index: 1; text-align: center; }
.login-recovery { display: inline-flex; justify-content: center; align-items: center; gap: 10px; padding: 0; border: 0; color: var(--login-teal); background: transparent; font: inherit; font-size: 15px; font-weight: 600; text-align: center; cursor: pointer; }
.login-recovery:hover { color: #079a96; }
.login-recovery svg { width: 27px; height: 27px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.login-recovery-notice { width: fit-content; max-width: 100%; margin: 9px auto 0; padding: 9px 14px; border: 1px solid #ccefeb; border-radius: 12px; color: #147e7a; background: rgba(237,251,249,.96); font-size: 13px; box-shadow: 0 6px 18px rgba(44,107,145,.1); }
.login-recovery-notice[hidden] { display: none; }
.login-environment-label { display: block; margin: 0; color: #8092d5; font-size: 11px; line-height: 1.2; text-align: center; }
.login-brand-signature { margin: 0 auto; padding: 0 10px; color: #a6aab2; font-family: Montserrat, Poppins, Inter, Arial, sans-serif; font-size: 10px; font-weight: 400; line-height: 1.35; text-align: center; }
.login-brand-signature strong { color: inherit; font-family: Montserrat, Poppins, Inter, Arial, sans-serif; font-size: 1.02em; font-weight: 800; letter-spacing: .04em; }
.login-brand-signature-mobile { display: none; }
.login-footer { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; color: #8092d5; font-size: 12px; font-weight: 600; }
.login-footer-caption { display: flex; justify-content: center; align-items: center; gap: 12px; }
.login-footer-caption::before, .login-footer-caption::after { width: 64px; height: 1px; content: ""; background: #cad5ff; }
.login-footer img { display: block; width: 176px; height: auto; }
.login-error { position: relative; z-index: 1; margin: -10px auto 16px; padding: 9px 12px; border: 1px solid #fecaca; border-radius: 10px; color: #991b1b; background: #fff1f2; font-size: 13px; text-align: center; }
.login-remember-wrap { display: none; }

@media (max-width: 700px) {
    body.eg-login-page { min-height: 100svh; background: linear-gradient(155deg, #3347c7 0%, #4657dc 54%, #7187f5 100%); }
    .login-shell { display: flex; flex-direction: column; height: 100svh; min-height: 100svh; overflow-y: auto; padding: max(12px, env(safe-area-inset-top)) 0 0; }
    .login-brand { position: relative; order: 1; flex: 0 0 clamp(112px, 18svh, 148px); width: 100%; min-height: 0; margin: 0 auto; padding: 0; }
    .login-brand-logo { position: absolute; top: 50%; left: 50%; align-self: center; width: min(270px, 70vw); max-height: 62px; margin: 0; object-position: center; transform: translate(-50%, -50%); }
    .login-decoration-dots { top: 10px; left: 0; width: 48px; height: 43px; background-size: 15px 15px; background-image: radial-gradient(circle, rgba(255,255,255,.4) 0 2.5px, transparent 3px); }
    .login-decoration-cap { top: 8px; right: 0; width: 38px; height: 38px; }
    .login-school-badge { order: 2; flex: 0 1 auto; justify-content: center; gap: 12px; width: fit-content; max-width: calc(100% - 28px); min-height: 52px; margin: 0 auto 12px; padding: 4px 12px; border-radius: 0; background: transparent; box-shadow: none; }
    .login-school-logo { width: auto; max-width: 145px; height: 46px; flex: 0 1 auto; padding: 2px 4px; object-fit: contain; }
    .login-school-name { flex: 0 1 auto; padding-left: 12px; border-left-color: rgba(255,255,255,.5); color: #fff; font-size: 14px; text-align: center; }
    .login-country-flag { width: 25px; height: 17px; }
    .login-panel, .login-form, .login-identity-column { display: contents; }
    .login-panel::before, .login-panel::after { display: none; }
    .login-error { order: 4; width: calc(100% - 40px); margin: 0 20px 12px; }
    .login-user-wrap { order: 5; width: calc(100% - 48px); min-height: 54px; margin: 0 auto 12px; border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.12); }
    .login-remember-wrap { order: 6; display: flex; justify-content: center; align-items: center; gap: 9px; width: calc(100% - 36px); margin: 0 auto 15px; color: rgba(255,255,255,.94); font-size: 12px; text-align: center; }
    .login-remember-wrap input { width: 17px; height: 17px; margin: 0; accent-color: #19c2ba; }
    .login-input-wrap > svg { width: 25px; height: 25px; stroke: #fff; }
    .login-input-wrap input { color: #fff; font-size: 17px; }
    .login-input-wrap input::placeholder { color: rgba(255,255,255,.86); }
    .login-pin-column { order: 7; display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; width: 100%; min-height: 0; margin-top: 0; padding: clamp(22px, 3.2svh, 28px) 24px 12px; border-radius: 32px 32px 0 0; background: #fff; box-shadow: 0 -12px 32px rgba(21,35,115,.12); }
    .login-pin-heading { gap: 10px; margin: 0 0 10px; color: #4f2384; font-size: clamp(20px, 3svh, 23px); }
    .login-pin-heading svg { width: 27px; height: 27px; }
    .login-pin-entry { flex: 0 0 22px; height: 22px; margin-bottom: 10px; }
    .login-pin-dots { gap: 13px; }
    .login-pin-dots i { width: 9px; height: 9px; }
    .login-keypad { flex: 1 1 auto; align-content: center; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, clamp(42px, 6.2svh, 52px)); gap: clamp(5px, 1.1svh, 9px); width: min(100%, 340px); min-height: 0; }
    .pin-key, .pin-key-spacer { min-height: 0; }
    .pin-key { border-radius: 10px; background: #edf2ff; font-size: clamp(22px, 6vw, 30px); font-weight: 500; }
    .pin-key:hover { background: #e2eaff; }
    .pin-key-delete svg { width: 30px; height: 30px; }
    .login-submit-row { display: none; }
    .login-support-column { order: 8; flex: 0 0 auto; width: 100%; padding: 10px 20px max(14px, env(safe-area-inset-bottom)); border-radius: 0 0 28px 28px; background: #fff; text-align: center; }
    .login-form.is-manual-password .login-submit-row { display: flex; margin: 8px auto 0; }
    .login-recovery-wrap { display: flex; justify-content: center; margin: 0 auto; }
    .login-recovery { min-height: 40px; gap: 8px; padding: 8px 0; color: #32beb6; font-size: 17px; font-weight: 500; }
    .login-recovery svg { display: none; }
    .login-recovery-notice { margin-top: 10px; padding: 10px 13px; font-size: 13px; }
    .login-environment-label { margin: 10px auto 2px; padding: 6px 0; color: #8092d5; }
    .login-brand-signature { font-size: 10px; }
    .login-brand-signature-mobile { display: block; margin: 7px auto 0; padding: 0 10px; color: #a6aab2; }
    .login-footer { display: none; }
}

@media (min-width: 1024px) {
    .login-shell { padding-top: 0; }
    .login-brand { min-height: 112px; }
    .login-brand-logo { width: min(420px, 34vw); max-height: 86px; }
    .login-school-badge { min-height: 72px; margin-bottom: -36px; }
    .login-school-logo { height: 50px; }
    .login-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; max-height: 85vh; padding: 48px 54px 30px; }
    .login-form { display: contents; }
    .login-error { position: absolute; top: 12px; right: 54px; left: 54px; margin: 0 auto; }
    .login-panel:has(.login-error) { padding-top: 82px; }
    .login-identity-column { grid-column: 1; grid-row: 1; gap: 0; }
    .login-pin-column { grid-column: 2; grid-row: 1 / span 2; }
    .login-support-column { grid-column: 1; grid-row: 2; align-self: start; }
    .login-support-column { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
    .login-recovery-wrap { width: 100%; text-align: center; }
    .login-recovery { justify-content: center; }
    .login-recovery-notice { margin-inline: auto; }
    .login-footer { align-items: center; text-align: center; }
    .login-footer-caption { justify-content: center; }
    .login-footer img { width: 150px; }
}

@media (min-width: 701px) and (max-height: 850px) {
    .login-shell { padding-top: 4px; }
    .login-brand { min-height: 118px; }
    .login-brand-logo { max-height: 82px; }
    .login-school-badge { min-height: 76px; margin-bottom: -38px; }
    .login-school-logo { height: 54px; }
    .login-panel { padding-top: 62px; }
    .login-support-column { text-align: center; }
    .login-footer img { width: 150px; }
}

@media (max-width: 360px) {
    .login-shell { padding-inline: 0; }
    .login-school-badge { gap: 7px; padding-inline: 10px; }
    .login-school-logo { width: auto; max-width: 120px; }
    .login-school-name { padding-left: 8px; font-size: 13px; }
    .login-country-flag { width: 23px; height: 15px; }
    .login-pin-column { padding-inline: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
