:root {
    --navy: #172d53;
    --navy-light: #244878;
    --blue: #3976bd;
    --text: #1e293b;
    --muted: #718096;
    --border: #dce4ee;
    --surface: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    color: var(--text);
    background: #edf2f8;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

/* =========================================
   MAIN LAYOUT
========================================= */

.login-page {
    display: grid;
    grid-template-columns: 0.92fr 1.08fr;
    min-height: 100vh;
}

/* =========================================
   LEFT BRAND PANEL WITH TOMBSTONE IMAGE
========================================= */

.brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 60px 45px;
    overflow: hidden;
    isolation: isolate;
    color: #fff;

    background-color: #142644;
    background-image:
        linear-gradient(145deg,
            rgba(14, 30, 55, 0.94) 0%,
            rgba(23, 45, 83, 0.78) 45%,
            rgba(16, 33, 62, 0.42) 100%),
        url("../images/mankweng_tombstones_background.jpg");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Subtle blue lighting and decorative circles */

.brand-panel::before,
.brand-panel::after {
    position: absolute;
    z-index: -1;
    content: "";
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.brand-panel::before {
    width: 600px;
    height: 600px;
    right: -330px;
    bottom: -210px;
}

.brand-panel::after {
    width: 440px;
    height: 440px;
    right: -250px;
    bottom: -130px;
}

.brand-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    text-align: center;
}

/* Brand illustration */

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin: 0 auto 26px;
    color: #fff;
}

.brand-mark svg {
    width: 100%;
    height: 100%;
}

/* Brand text */

.brand-overline {
    margin: 0 0 16px;
    color: #c4dcf7;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 3px;
}

.brand-name {
    margin: 0;
    color: #fff;
    font-size: clamp(32px, 3.5vw, 48px);
    font-weight: 800;
    letter-spacing: 4px;
    line-height: 1.2;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
}

.brand-name span {
    display: block;
    margin-top: 9px;
    font-size: 19px;
    font-weight: 500;
    letter-spacing: 9px;
}

.brand-divider {
    width: 66px;
    height: 3px;
    margin: 29px auto;
    border-radius: 5px;
    background: #70b8ff;
    box-shadow: 0 0 16px rgba(112, 184, 255, 0.3);
}

.brand-tagline {
    margin: 0;
    color: #f0f5fc;
    font-size: 17px;
    line-height: 1.9;
    letter-spacing: 0.4px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.brand-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 100px;
}

.brand-bottom-line {
    width: 25px;
    height: 1px;
    background: #a7cefa;
}

.brand-bottom p {
    margin: 0;
    color: #e0eafa;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* =========================================
   RIGHT LOGIN PANEL
========================================= */

.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 55px 35px;
    background: linear-gradient(135deg,
            #edf3fb 0%,
            #f7f9fc 45%,
            #ffffff 100%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 42px 38px 30px;
    border: 1px solid rgba(220, 228, 238, 0.9);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 20px 60px rgba(25, 48, 82, 0.09);
}

.mobile-brand {
    display: none;
}

/* Welcome icon */

.welcome-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 53px;
    height: 53px;
    margin: 0 auto 22px;
    border: 1px solid #dce8fa;
    border-radius: 16px;
    background: #eff5ff;
    color: #315e9b;
}

.welcome-icon svg {
    width: 26px;
    height: 26px;
}

/* Heading */

.welcome-label {
    margin: 0 0 9px;
    color: #3976bd;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2.2px;
    text-align: center;
}

.login-card h2 {
    margin: 0;
    color: #172d53;
    font-size: 27px;
    font-weight: 750;
    letter-spacing: -0.8px;
    text-align: center;
}

.welcome-description {
    margin: 12px 0 30px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    text-align: center;
}

/* =========================================
   FLASH MESSAGES
========================================= */

.flash-container {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.flash-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid #dce4ee;
    border-radius: 9px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    line-height: 1.6;
}

.flash-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    font-weight: 800;
}

.flash-success {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.flash-success .flash-symbol {
    background: #dcfce7;
}

.flash-error,
.flash-danger {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.flash-error .flash-symbol,
.flash-danger .flash-symbol {
    background: #fee2e2;
}

.flash-warning {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}

.flash-warning .flash-symbol {
    background: #fef3c7;
}

.flash-info {
    color: #1e40af;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.flash-info .flash-symbol {
    background: #dbeafe;
}

/* =========================================
   LOGIN FORM
========================================= */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.form-field label {
    color: #273b5a;
    font-size: 12px;
    font-weight: 750;
}

/* Input boxes */

.input-wrapper {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid #d7e0ec;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: #5488c7;
    box-shadow: 0 0 0 4px rgba(57, 118, 189, 0.1);
}

.input-icon {
    width: 19px;
    height: 19px;
    margin-right: 12px;
    flex-shrink: 0;
    color: #7285a2;
}

.input-wrapper input {
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #1e293b;
    font-size: 13px;
}

.input-wrapper input::placeholder {
    color: #a0acbd;
}

/* Password show/hide button */

.password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 38px;
    margin-left: 5px;
    padding: 0;
    flex-shrink: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #718096;
    cursor: pointer;
}

.password-toggle:hover {
    background: #eff5ff;
    color: #244878;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Sign in button */

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 52px;
    margin-top: 5px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(110deg, #244878, #19345c);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(31, 62, 105, 0.15);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(110deg, #2d5a91, #1c3c6b);
    box-shadow: 0 9px 20px rgba(31, 62, 105, 0.2);
}

.login-button svg {
    width: 19px;
    height: 19px;
}

.login-button:focus-visible,
.password-toggle:focus-visible {
    outline: 3px solid #8bb9f0;
    outline-offset: 3px;
}

/* =========================================
   SECURITY FOOTER
========================================= */

.security-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 29px;
}

.security-divider span {
    height: 1px;
    flex: 1;
    background: #e4eaf2;
}

.security-divider svg {
    width: 22px;
    height: 22px;
    color: #7b91b0;
}

.security-text {
    margin: 12px 0 0;
    color: #8190a6;
    font-size: 11px;
    text-align: center;
}

.login-footer {
    margin: 30px 0 0;
    color: #a0aabc;
    font-size: 10px;
    line-height: 1.6;
    text-align: center;
}

/* =========================================
   TABLET
========================================= */

@media (max-width: 900px) {
    .login-page {
        grid-template-columns: 0.75fr 1.25fr;
    }

    .brand-panel {
        padding: 40px 25px;
        background-position: center;
    }

    .brand-name {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .brand-name span {
        font-size: 15px;
        letter-spacing: 6px;
    }

    .brand-bottom {
        margin-top: 65px;
    }

    .brand-bottom p {
        font-size: 9px;
    }

    .form-panel {
        padding: 35px 22px;
    }

    .login-card {
        padding: 35px 25px 27px;
    }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 650px) {
    .login-page {
        display: flex;
        min-height: 100vh;
        align-items: center;
        justify-content: center;
        padding: 22px 14px;
        background:
            radial-gradient(ellipse at 10% 0%,
                #dbe8fa 0%,
                transparent 45%),
            #f3f6fb;
    }

    /* The image panel is hidden on small screens to
       keep the login form readable and uncluttered. */

    .brand-panel {
        display: none;
    }

    .form-panel {
        width: 100%;
        min-height: auto;
        padding: 0;
        background: transparent;
    }

    .login-card {
        max-width: 440px;
        padding: 28px 22px 24px;
        border-radius: 18px;
        box-shadow: 0 12px 38px rgba(25, 48, 82, 0.08);
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-bottom: 30px;
        color: #172d53;
        font-size: 12px;
        letter-spacing: 0.6px;
    }

    .mobile-brand strong {
        font-weight: 800;
    }

    .mobile-brand-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 11px;
        background: #1c3964;
        color: #fff;
        font-size: 19px;
        font-weight: 800;
    }

    .welcome-icon {
        width: 47px;
        height: 47px;
        margin-bottom: 18px;
    }

    .login-card h2 {
        font-size: 24px;
    }

    .welcome-description {
        margin-bottom: 25px;
        font-size: 12px;
    }
}

/* =========================================
   ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }

    .login-button:hover {
        transform: none;
    }
}

/* Login error messages */
.flash-container {
    width: 100%;
    margin: 0 0 20px;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

.flash-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.flash-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
}