/* ============================================
   Primary-school login stage
   Wide illustrated scene with a focused central login panel.
   ============================================ */

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
}

.login-page.pp-page {
    min-height: 100svh;
    padding: 0;
    background: #fff1d8;
}

.login-shell {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 100svh;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 92px 24px 28px;
    border: 0;
    border-radius: 0;
    background: #ffe7b7;
    box-shadow: none;
}

.login-visual {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
}

.login-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(255, 248, 232, 0.05);
}

.login-visual-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
}

.login-character {
    position: absolute;
    z-index: 1;
    /* Anchored relative to centre so the feet track the (centred) dialog's
       lower edge across viewport heights. */
    bottom: calc(50% - 215px);
    display: block;
    width: clamp(140px, 17vw, 240px);
    height: auto;
    pointer-events: none;
    user-select: none;
}

.login-character-boy {
    right: calc(50% + 231px);
}

.login-character-girl {
    left: calc(50% + 231px);
}

.login-panel {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(430px, calc(100% - 40px));
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 34px;
    border: 2px solid #f0c273;
    border-radius: 8px;
    background: #fffdf8;
    box-shadow: 0 18px 42px rgba(89, 47, 23, 0.24);
}

.login-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.login-progress-bar {
    width: 42px;
    height: 5px;
    border-radius: 3px;
    background: #eadfca;
}

.login-progress-bar.is-active {
    background: #ff8546;
}

.login-progress-bar.is-active:nth-child(2) {
    background: #f5bd3e;
}

.login-progress-text {
    margin-left: 4px;
    color: #8a6b56;
    font-size: 13px;
    font-weight: 700;
}

.login-head {
    margin-bottom: 22px;
}

.login-heading {
    margin: 0;
    color: #503322;
    font-size: clamp(31px, 3vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
}

.login-subtitle {
    margin: 7px 0 0;
    color: #8a6b56;
    font-size: 15px;
    line-height: 1.5;
}

.login-panel .pp-msg {
    margin: -6px 0 18px;
    border-radius: 8px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.login-form .pp-label {
    padding-left: 0;
    color: #60412d;
    font-size: 14px;
}

.login-form .pp-input {
    height: 54px;
    border-color: #efc789;
    border-radius: 8px;
    background: #fff9ec;
}

.login-form .pp-input::placeholder {
    color: #a68a72;
}

.login-form .pp-input:focus {
    border-color: #ff8546;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 133, 70, 0.20);
}

.login-form .pp-input-ico {
    color: #ed7135;
}

.login-form .pp-btn {
    width: 100%;
    height: 54px;
    margin-top: 3px;
    border-radius: 8px;
    background: #ff7f3f;
    box-shadow: 0 6px 0 #db5c22;
    font-size: 18px;
}

.login-form .pp-btn:hover {
    background: #ff914f;
}

.login-form .pp-btn:active {
    box-shadow: 0 2px 0 #db5c22;
}

.login-form .pp-btn:disabled {
    background: #f2b08e;
    box-shadow: 0 6px 0 #cc8b6a;
}

.login-form .pp-btn i {
    font-size: 15px;
}

.login-schoolinfo {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: -6px 0 20px;
    padding: 10px;
    border: 1px solid #efce8b;
    border-radius: 8px;
    background: #fff7dc;
}

.login-school-icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #ffe0c7;
    color: #d85e26;
    font-size: 16px;
}

.login-school-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
}

.login-school-label {
    color: #8a6b56;
    font-size: 11px;
    font-weight: 700;
}

.login-school-name {
    color: #503322;
    font-size: 14px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.login-school-code {
    color: #b45b24;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.login-school-change {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 9px;
    border: 1px solid #e5aa66;
    border-radius: 8px;
    background: #ffffff;
    color: #a9501f;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.login-school-change:hover {
    background: #ffebd7;
}

.login-school-change:focus-visible,
.login-form .pp-btn:focus-visible {
    outline: 3px solid rgba(255, 127, 63, 0.32);
    outline-offset: 3px;
}

@media (min-width: 821px) and (max-height: 800px) {
    .login-page.pp-page {
        padding: 0;
    }

    .login-shell {
        min-height: 100svh;
        padding-top: 78px;
        padding-bottom: 18px;
    }

    .login-panel {
        padding: 25px 30px;
    }

    .login-progress,
    .login-head {
        margin-bottom: 15px;
    }

    .login-schoolinfo {
        margin-bottom: 14px;
        padding: 8px;
    }

    .login-form {
        gap: 12px;
    }

    .login-form .pp-input,
    .login-form .pp-btn {
        height: 49px;
    }
}

@media (max-width: 820px) {
    .login-page.pp-page {
        align-items: flex-start;
        padding: 0;
    }

    .login-shell {
        display: block;
        min-height: 0;
        padding: 0;
    }

    .login-visual {
        position: relative;
        height: clamp(210px, 34vh, 260px);
    }

    .login-visual-image {
        object-position: center center;
    }

    .login-character {
        bottom: -8px;
        width: clamp(84px, 14.5vw, 118px);
    }

    .login-character-boy {
        right: calc(50% + 10px);
    }

    .login-character-girl {
        left: calc(50% + 10px);
    }

    .login-panel {
        width: 100%;
        margin: 0;
        padding: 30px clamp(24px, 7vw, 52px) 36px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .login-page.pp-page {
        padding: 0;
        background: #fffdf8;
    }

    .login-shell {
        min-height: 100svh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-visual {
        height: 210px;
    }

    .login-panel {
        padding: 28px 22px 34px;
    }

    .login-heading {
        font-size: 31px;
    }

    .login-schoolinfo {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .login-school-change {
        grid-column: 2;
        width: fit-content;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-form .pp-btn,
    .login-form .pp-input {
        transition: none;
    }
}
