:root {
    --sim-blue: #0d47a1;
    --sim-blue-light: #1976d2;
    --sim-text: #0f1f3a;
    --sim-muted: #64748b;
    --sim-border: #dce6f0;
    --sim-white: #ffffff;
    --sim-error: #b91c1c;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

body,
button,
input {
    font-family: Arial, Helvetica, sans-serif;
}

body {
    color: var(--sim-text);
    background: #071831;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 42px;
    background:
        linear-gradient(105deg, rgba(5, 20, 42, .94) 0%, rgba(8, 42, 86, .84) 48%, rgba(7, 24, 49, .78) 100%),
        url("../assets/login-fleet-bg.png") center center / cover no-repeat;
}

.login-layout {
    width: min(1160px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    align-items: center;
    gap: 68px;
}

.institutional-panel {
    min-width: 0;
    color: var(--sim-white);
}

.institutional-copy {
    max-width: 620px;
}

.eyebrow {
    margin: 0 0 15px;
    color: rgba(255, 255, 255, .88);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.institutional-panel h1 {
    max-width: 590px;
    margin: 0;
    color: var(--sim-white);
    font-size: clamp(35px, 4vw, 52px);
    line-height: 1.08;
}

.lead {
    max-width: 575px;
    margin: 17px 0 28px;
    color: #dbeafe;
    font-size: 16px;
    line-height: 1.55;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.feature {
    min-height: 112px;
    display: flex;
    gap: 13px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, .20);
    border-radius: 8px;
    background: rgba(10, 36, 70, .24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
}

.feature-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(25, 118, 210, .28);
    color: #b9dcff;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature h2 {
    margin: 1px 0 5px;
    color: var(--sim-white);
    font-size: 14px;
    line-height: 1.25;
}

.feature p {
    margin: 0;
    color: #d6e7fb;
    font-size: 12px;
    line-height: 1.42;
}

.login-card {
    width: 100%;
    padding: 34px 36px 24px;
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: 10px;
    background: #eef2f6;
    box-shadow: 0 25px 60px rgba(0, 10, 30, .32);
}

.brand {
    display: flex;
    justify-content: center;
    padding-bottom: 23px;
    border-bottom: 1px solid #e6edf4;
}

.brand img {
    display: block;
    width: 148px;
    height: auto;
    object-fit: contain;
}

.login-heading {
    margin: 27px 0 23px;
}

.login-heading h2 {
    margin: 0;
    color: var(--sim-text);
    font-size: 25px;
    line-height: 1.25;
}

.login-heading p {
    margin: 7px 0 0;
    color: var(--sim-muted);
    font-size: 14px;
    line-height: 1.45;
}

form {
    display: grid;
    gap: 18px;
}

.field label {
    display: block;
    margin: 0 0 7px;
    color: #293a50;
    font-size: 13px;
    font-weight: 700;
}

.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.field-label-row a {
    color: var(--sim-blue);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.field-label-row a:hover {
    text-decoration: underline;
}

.field input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cbd8e7;
    border-radius: 6px;
    outline: none;
    background: #fbfdff;
    color: var(--sim-text);
    padding: 0 14px;
    font-size: 15px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.field input::placeholder {
    color: #91a0b2;
}

.field input:focus {
    border-color: var(--sim-blue-light);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, .13);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px;
}

.password-toggle {
    width: 38px;
    height: 38px;
    position: absolute;
    top: 5px;
    right: 5px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #53677e;
    cursor: pointer;
}

.password-toggle:hover {
    background: #edf4fb;
    color: var(--sim-blue);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle:focus-visible,
.field-label-row a:focus-visible,
.login-button:focus-visible {
    outline: 3px solid rgba(25, 118, 210, .27);
    outline-offset: 2px;
}

.form-message {
    min-height: 18px;
    margin-top: -4px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.form-message.is-error {
    color: var(--sim-error);
}

.form-message.is-info {
    color: #315d89;
}

.form-message.is-success {
    color: #15803d;
}

.login-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sim-blue);
    border-radius: 6px;
    background: var(--sim-blue);
    color: var(--sim-white);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.login-button:hover:not(:disabled) {
    background: #0a3c89;
    box-shadow: 0 8px 18px rgba(13, 71, 161, .22);
}

.login-button:active:not(:disabled) {
    transform: translateY(1px);
}

.login-button:disabled {
    cursor: wait;
    opacity: .75;
}

.button-loading {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.button-loading[hidden],
.button-label[hidden] {
    display: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .42);
    border-top-color: var(--sim-white);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.login-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 23px;
    padding-top: 16px;
    border-top: 1px solid #e6edf4;
    color: #718197;
    font-size: 11px;
}

.login-footer p {
    margin: 0;
}

.login-footer span {
    white-space: nowrap;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 980px) {
    .login-page {
        padding: 62px 28px 30px;
        background-position: 58% center;
    }

    .login-layout {
        width: min(760px, 100%);
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .login-card {
        width: min(430px, 100%);
        grid-row: 1;
        justify-self: center;
    }

    .institutional-panel {
        grid-row: 2;
    }

    .institutional-copy {
        max-width: 100%;
    }

    .eyebrow,
    .institutional-panel h1,
    .lead {
        display: none;
    }

    .feature-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .feature {
        min-height: 0;
        padding: 11px;
    }

    .feature-icon {
        width: 30px;
        height: 30px;
    }

    .feature p {
        display: none;
    }
}

@media (max-width: 620px) {
    .login-page {
        place-items: start center;
        padding: 60px 16px 24px;
        background-position: 62% center;
    }

    .login-card {
        padding: 27px 22px 21px;
        border-radius: 8px;
    }

    .brand {
        padding-bottom: 19px;
    }

    .brand img {
        width: 136px;
    }

    .login-heading {
        margin: 22px 0 19px;
    }

    .login-heading h2 {
        font-size: 23px;
    }

    .feature-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature {
        align-items: center;
    }

    .feature h2 {
        margin: 0;
        font-size: 12px;
    }

    .login-footer {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .login-page {
        place-items: start center;
        padding: 14px;
        background-position: center center;
    }

    .login-layout {
        width: min(100%, 816px);
        grid-template-columns: 1fr 460px;
        align-items: stretch;
        gap: 14px;
    }

    .login-card {
        width: 100%;
        grid-column: 2;
        grid-row: 1;
        padding: 18px 24px;
    }

    .brand {
        display: none;
    }

    .login-heading {
        margin: 0 0 11px;
    }

    .login-heading h2 {
        font-size: 21px;
    }

    .login-heading p {
        margin-top: 3px;
        font-size: 12px;
    }

    form {
        grid-template-columns: 1fr 1fr;
        gap: 9px 11px;
    }

    .field input,
    .login-button {
        min-height: 42px;
    }

    .password-toggle {
        top: 2px;
    }

    .form-message,
    .login-button {
        grid-column: 1 / -1;
    }

    .login-footer {
        flex-direction: row;
        margin-top: 9px;
        padding-top: 9px;
    }

    .institutional-panel {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        align-items: flex-end;
    }

    .feature-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature {
        padding: 8px;
    }

    .feature-icon {
        display: none;
    }

    .feature h2 {
        font-size: 11px;
    }
}

@media (min-width: 1600px) {
    .login-layout {
        width: min(1280px, 100%);
        grid-template-columns: minmax(0, 1fr) 440px;
        gap: 92px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
