/* =========================================================
   MoFBE Login — harbor split layout
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,560;9..144,650&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
    --ink: #16324f;
    --water: #2f6fe6;
    --water-deep: #1d4ed8;
    --water-bright: #5b95ff;
    --muted: #5d7190;
    --danger: #9f2c23;
    --paper: #f3f7fc;
    --line: #d5e2f0;
    --radius: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Source Sans 3", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(340px, 0.95fr);
    min-height: 100vh;
}

.login-aside {
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.25rem 4.75rem 4.25rem 2.5rem;
    background:
        radial-gradient(ellipse 70% 55% at 15% 0%, rgba(140, 196, 255, 0.45), transparent 55%),
        radial-gradient(ellipse 50% 40% at 90% 80%, rgba(18, 74, 196, 0.35), transparent 60%),
        linear-gradient(165deg, #5b95ff 0%, var(--water) 42%, var(--water-deep) 100%);
}

.login-aside__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 520px);
    animation: rise 0.55s ease both;
}

.login-art {
    width: 100%;
    height: auto;
}

.login-modules__label {
    margin: 1.15rem 0 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}

.login-modules {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem 0.55rem;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.login-modules li {
    display: flex;
    flex: 0 0 31%;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    line-height: 1.2;
}

.login-modules__icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 1.5px dashed rgba(255, 255, 255, 0.62);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
}

.login-modules__icon svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

.login-aside__waves {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 18%;
    pointer-events: none;
}

.login-crest {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: -48px;
    width: 96px;
    height: 96px;
    margin-top: -48px;
    padding: 7px;
    border-radius: 50%;
    background: #fff;
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.28),
        0 12px 28px rgba(18, 52, 120, 0.28);
}

.login-crest img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.login-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.login-main {
    display: grid;
    place-items: center;
    padding: 2rem 1.75rem 2rem 4.25rem;
    background:
        radial-gradient(ellipse 55% 45% at 100% 0%, rgba(47, 111, 230, 0.08), transparent 70%),
        var(--paper);
}

.login-panel {
    width: 100%;
    max-width: 400px;
    animation: rise 0.55s 0.08s ease both;
}

.login-head {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.4rem;
}

.login-head__mark {
    width: 46px;
    height: 46px;
    padding: 4px;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
    box-shadow: 0 0 0 2px rgba(47, 111, 230, 0.45);
}

.login-head__org {
    margin: 0;
    font-family: Fraunces, Georgia, serif;
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    color: #163a78;
    line-height: 1.1;
}

.login-head__sys {
    margin: 0.1rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.login-panel h2 {
    margin: 0;
    font-family: Fraunces, Georgia, serif;
    font-size: 2rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #163a78;
}

.login-lead {
    margin: 0.35rem 0 1.4rem;
    color: var(--muted);
    font-size: 0.98rem;
}

.login-alert {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid #f0c8c4;
    background: #fdf4f3;
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
}

.login-field {
    margin-bottom: 0.95rem;
}

.login-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink);
}

.login-input {
    position: relative;
}

.login-input > svg {
    position: absolute;
    top: 50%;
    left: 0.9rem;
    width: 18px;
    height: 18px;
    fill: #7d949a;
    transform: translateY(-50%);
    pointer-events: none;
}

.login-input input {
    width: 100%;
    height: 50px;
    padding: 0 2.8rem 0 2.7rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.98rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input input::placeholder {
    color: #8fa3a9;
}

.login-input input:hover {
    border-color: #b7c9cd;
}

.login-input input:focus {
    border-color: var(--water);
    box-shadow: 0 0 0 4px rgba(47, 111, 230, 0.16);
}

.login-reveal {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.login-reveal svg {
    width: 18px;
    height: 18px;
    fill: #6d868c;
}

.login-reveal .icon-hide {
    display: none;
}

.login-reveal.is-visible .icon-show {
    display: none;
}

.login-reveal.is-visible .icon-hide {
    display: block;
}

.login-reveal:hover svg,
.login-reveal:focus-visible svg {
    fill: var(--water);
}

.login-reveal:focus-visible {
    outline: 2px solid var(--water);
    outline-offset: 1px;
}

.login-row {
    display: flex;
    align-items: center;
    margin: 0.15rem 0 1.2rem;
}

.login-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.login-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--water);
    cursor: pointer;
}

.login-submit {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--water-bright) 0%, var(--water) 100%);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.28);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.login-submit:hover {
    background: var(--water-deep);
    box-shadow: 0 10px 22px rgba(29, 78, 216, 0.32);
}

.login-submit:active {
    transform: translateY(1px);
}

.login-submit:focus-visible {
    outline: 3px solid rgba(47, 111, 230, 0.45);
    outline-offset: 2px;
}

.login-foot {
    margin: 1.6rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid #e3ebe8;
    text-align: center;
    font-size: 0.75rem;
    color: #7d949a;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-aside__body,
    .login-panel {
        animation: none !important;
    }
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-aside {
        min-height: 0;
        padding: 1.25rem 1.1rem 1.8rem;
    }

    .login-aside__body {
        width: min(100%, 420px);
    }

    .login-modules__icon {
        width: 48px;
        height: 48px;
    }

    .login-crest {
        display: none;
    }

    .login-head {
        display: flex;
    }

    .login-main {
        min-height: 0;
        padding: 1.5rem 1.15rem 2rem;
    }

    .login-panel h2 {
        font-size: 1.7rem;
    }
}

@media (max-width: 480px) {
    .login-input input,
    .login-submit {
        height: 48px;
    }
}
