* {
    box-sizing: border-box;
}

:root {
    --navy: #071d4d;
    --navy-dark: #061a47;
    --ink: #132754;
    --muted: #65748e;
    --placeholder: #8290a8;
    --line: #d9e0ea;
    --focus: #8aa2cf;
    --page: #eef2f8;
    --danger: #c53b43;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;
    color: var(--ink);
    background:
        radial-gradient(
            circle at 8% 7%,
            rgba(255, 255, 255, 0.98),
            transparent 29%
        ),
        radial-gradient(
            circle at 91% 8%,
            rgba(193, 210, 237, 0.52),
            transparent 25%
        ),
        linear-gradient(
            135deg,
            #e9eef6 0%,
            #f8fafc 51%,
            #e7edf6 100%
        );
}

button,
input {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px;
    position: relative;
    overflow: hidden;
}

/* Subtle corner geometry from the reference */
.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.login-page::before {
    width: 500px;
    height: 500px;
    right: -275px;
    top: -285px;
    border-radius: 50%;
    border: 1px solid rgba(91, 121, 169, 0.10);
    box-shadow:
        0 0 0 42px rgba(91, 121, 169, 0.025),
        0 0 0 84px rgba(91, 121, 169, 0.018);
}

.login-page::after {
    width: 360px;
    height: 360px;
    left: -245px;
    bottom: -240px;
    border-radius: 50%;
    border: 1px solid rgba(91, 121, 169, 0.10);
}

/* Main reference card */
.login-shell {
    width: min(1088px, 100%);
    min-height: 826px;

    display: grid;
    grid-template-columns: 44% 56%;

    overflow: hidden;

    background: #ffffff;
    border: 1px solid rgba(144, 158, 181, 0.28);
    border-radius: 18px;

    box-shadow:
        0 30px 75px rgba(37, 55, 84, 0.12),
        0 8px 24px rgba(37, 55, 84, 0.05);
}

/* =========================
   LEFT SIDE
   ========================= */

.welcome-panel {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 54px 48px;
    background:
        radial-gradient(
            circle at 20% 14%,
            rgba(255, 255, 255, 0.98),
            transparent 34%
        ),
        linear-gradient(
            145deg,
            #ffffff 0%,
            #fbfcfe 65%,
            #f5f8fd 100%
        );
    border-right: 1px solid #e2e6ed;
}

.welcome-content {
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.brand-mark {
    width: 88px;
    height: 88px;
    margin: 0 auto 21px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1.8px solid #20252d;
    border-radius: 50%;
    background: #ffffff;

    box-shadow: 0 8px 24px rgba(28, 46, 76, 0.05);
}

.brand-mark span {
    color: #101a2b;
    font-size: 42px;
    line-height: 1;
    font-weight: 600;
}

.brand-name {
    color: #0b2455;
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.115em;
}

.brand-caption {
    margin-top: 12px;
    color: #203a68;
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: 0.205em;
}

.brand-line {
    width: 82px;
    height: 2px;
    margin: 20px auto 39px;
    background: linear-gradient(
        90deg,
        transparent,
        #a5bde2,
        transparent
    );
}

.login-heading {
    display: none;
}

.welcome-content h1 {
    margin: 0;
    color: #0a2455;
    font-size: 39px;
    line-height: 1.08;
    font-weight: 750;
    letter-spacing: -0.035em;
}

.welcome-text {
    max-width: 340px;
    margin: 25px auto 0;

    color: #65748e;
    font-size: 15px;
    line-height: 1.72;
}

.secure-card {
    width: 100%;
    margin-top: 46px;
    padding: 20px 21px;

    display: flex;
    align-items: center;
    gap: 16px;

    text-align: left;

    background: linear-gradient(
        135deg,
        #f5f8ff,
        #eef4fd
    );

    border: 1px solid rgba(129, 153, 194, 0.11);
    border-radius: 11px;
}

.secure-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #155bc9;
    background: #e3edff;
    border-radius: 50%;
}

.secure-icon svg {
    width: 28px;
    height: 28px;

    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.secure-card strong {
    display: block;
    margin-bottom: 6px;

    color: #172f5c;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 750;
}

.secure-card span {
    display: block;

    color: #71809a;
    font-size: 12px;
    line-height: 1.48;
}

/* =========================
   RIGHT SIDE
   ========================= */

.form-panel {
    min-width: 0;
    display: flex;
    align-items: center;

    padding: 54px 58px;

    background: #ffffff;
}

.form-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.form-container > .server-error {
    margin-bottom: 20px;
}

#loginForm {
    width: 100%;
}

/* Fields */
.field {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 122px minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
}

.field label {
    display: block;
    margin: 0;
    align-self: center;

    color: #12264f;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
}

.input-wrap {
    position: relative;
}

.field-icon {
    position: absolute;
    z-index: 1;

    left: 18px;
    top: 50%;

    width: 22px;
    height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    color: #102a5c;
    pointer-events: none;
}

.field-icon svg {
    width: 21px;
    height: 21px;

    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

input {
    width: 100%;
    height: 58px;

    padding: 0 57px 0 57px;

    border: 1px solid var(--line);
    border-radius: 9px;

    outline: none;

    color: #172846;
    background: #ffffff;

    font-size: 15px;
    font-weight: 450;

    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

input::placeholder {
    color: var(--placeholder);
    opacity: 1;
}

input:hover {
    border-color: #c5cedd;
}

input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(74, 116, 184, 0.09);
}

input.invalid {
    border-color: #d85a61;
    background: #fffafb;
    box-shadow: 0 0 0 3px rgba(216, 90, 97, 0.07);
}

/* Password/API visibility */
.visibility-button {
    position: absolute;
    top: 50%;
    right: 9px;

    width: 40px;
    height: 40px;

    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 8px;

    color: #7888a2;
    background: transparent;

    cursor: pointer;
}

.visibility-button:hover {
    background: #f3f6fa;
    color: #253c66;
}

.eye-icon {
    width: 21px;
    height: 21px;

    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Errors */
.field-error {
    grid-column: 2;
    min-height: 0;
    margin: 0;

    color: var(--danger);

    font-size: 11px;
    line-height: 1.35;
    font-weight: 650;

    opacity: 0;
}

.field-error.visible {
    min-height: 15px;
    margin-top: 6px;
    opacity: 1;
}

.server-error {
    padding: 12px 14px;

    display: flex;
    align-items: flex-start;
    gap: 10px;

    border: 1px solid #efc8cb;
    border-radius: 9px;

    background: #fff6f7;
    color: var(--danger);

    font-size: 12px;
    line-height: 1.45;
    font-weight: 600;
}

.error-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1.5px solid currentColor;
    border-radius: 50%;

    font-size: 11px;
    font-weight: 800;
}

/* Button */
.login-button {
    width: 100%;
    height: 58px;

    margin-top: 1px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    border: 0;
    border-radius: 9px;

    background: linear-gradient(
        135deg,
        #061b49,
        #0a2d72
    );

    color: #ffffff;

    cursor: pointer;

    font-size: 16px;
    font-weight: 700;

    box-shadow: 0 10px 22px rgba(8, 38, 91, 0.15);

    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        filter 160ms ease;
}

.login-button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 14px 27px rgba(8, 38, 91, 0.20);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    cursor: wait;
    opacity: 0.88;
    transform: none;
}

.button-lock {
    width: 21px;
    height: 21px;

    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button-spinner {
    width: 17px;
    height: 17px;

    display: none;

    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;

    animation: spin 700ms linear infinite;
}

.login-button.loading .button-spinner {
    display: block;
}

.login-button.loading .button-lock {
    display: none;
}

.login-button.loading .button-label {
    opacity: 0.88;
}

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

/* Responsive */
@media (max-width: 900px) {
    .login-page {
        padding: 24px;
    }

    .login-shell {
        width: min(760px, 100%);
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .welcome-panel {
        padding: 48px 36px 40px;
        border-right: 0;
        border-bottom: 1px solid #e2e6ed;
    }

    .form-panel {
        padding: 42px 40px 48px;
    }

    .form-container {
        max-width: 520px;
    }
}

@media (max-width: 520px) {
    .login-page {
        padding: 10px;
    }

    .login-shell {
        border-radius: 15px;
    }

    .welcome-panel {
        padding: 34px 20px 30px;
    }

    .form-panel {
        padding: 30px 20px 34px;
    }

    .brand-mark {
        width: 70px;
        height: 70px;
    }

    .brand-mark span {
        font-size: 34px;
    }

    .brand-name {
        font-size: 24px;
    }

    .brand-caption {
        font-size: 11px;
    }

    .brand-line {
        margin-bottom: 28px;
    }

    .welcome-content h1 {
        font-size: 31px;
    }

    .welcome-text {
        font-size: 13px;
    }

    .secure-card {
        margin-top: 30px;
        padding: 16px;
    }

    input,
    .login-button {
        height: 54px;
    }

    .field {
        margin-bottom: 19px;
        grid-template-columns: 1fr;
        row-gap: 8px;
    }

    .field label,
    .field-error {
        grid-column: 1;
    }
}



