/* FMIS login — split-panel institutional layout */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --fmis-ink:       #0f2419;
    --fmis-green:     #1e5c3a;
    --fmis-green-mid: #2a6f47;
    --fmis-green-lit: #3d8f5c;
    --fmis-mint:      #e8f3ec;
    --fmis-gold:      #b8922e;
    --fmis-gold-soft: #f5ecd6;
    --fmis-surface:   #ffffff;
    --fmis-muted:     #5c6f64;
    --fmis-border:    #d4e4da;
    --fmis-error-bg:  #fef2f2;
    --fmis-error:     #b91c1c;
}

html, body {
    height: 100%;
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
    color: var(--fmis-ink);
    background: var(--fmis-surface);
}

body.fmis-login-page {
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* —— Landing notice (all visitors) —— */
.login-page-notice {
    flex-shrink: 0;
    background: linear-gradient(90deg, #fff8e6 0%, #fff3cd 50%, #fff8e6 100%);
    border-bottom: 2px solid #d4a82a;
    padding: 14px 20px;
    box-shadow: 0 2px 12px rgba(184, 146, 46, 0.15);
}

.login-page-notice-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.login-page-notice-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #b8922e;
    color: #fff;
    border-radius: 10px;
    margin-top: 2px;
}

.login-page-notice-icon svg {
    width: 20px;
    height: 20px;
}

.login-page-notice-text {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #4a3d1a;
}

.login-page-notice-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #2d2410;
    margin-bottom: 4px;
}

.login-page-notice-text strong {
    color: #1a3a2a;
    font-weight: 700;
}

.login-page-notice-action {
    margin-top: 4px;
    font-size: 0.92rem;
    color: #5c3d0a;
}

.login-shell {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 0.95fr);
    min-height: 0;
}

/* —— Brand panel (left) —— */
.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px 36px;
    color: #fff;
    background:
        linear-gradient(165deg, #0a1f14 0%, #143d28 42%, #1e5c3a 100%);
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(0, 0, 0, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.login-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.login-brand-top,
.login-brand-body,
.login-brand-foot {
    position: relative;
    z-index: 1;
}

.login-brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-brand-top .fmis-logos {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.login-brand-top .fmis-logo {
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 3px;
}

.login-brand-top .fmis-logo-govt,
.login-brand-top .fmis-logo-dept {
    height: 52px;
    width: auto;
    max-width: 56px;
}

.login-dept-line {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.4;
}

.login-brand-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 0 32px;
    max-width: 440px;
}

.login-acronym {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.login-acronym span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.login-brand-body h1 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.login-brand-body .tagline {
    font-size: 1rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 28px;
}

.login-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.45;
}

.login-features li svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: var(--fmis-gold-soft);
}

.login-brand-foot {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.03em;
}

/* —— Form panel (right) —— */
.login-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: linear-gradient(180deg, #f6faf7 0%, #ffffff 40%);
}

.login-main-inner {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--fmis-surface);
    border: 1px solid var(--fmis-border);
    border-radius: 16px;
    padding: 36px 32px 28px;
    box-shadow:
        0 1px 2px rgba(15, 36, 25, 0.04),
        0 12px 40px rgba(15, 36, 25, 0.07);
}

.login-card-head {
    margin-bottom: 28px;
}

.login-card-head .eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fmis-green);
    background: var(--fmis-mint);
    padding: 5px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.login-card-head h2 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--fmis-ink);
    line-height: 1.25;
    margin-bottom: 6px;
}

.login-card-head p {
    font-size: 0.88rem;
    color: var(--fmis-muted);
    line-height: 1.45;
}

.login-msg {
    display: block;
    margin-bottom: 16px;
    padding: 11px 14px;
    background: var(--fmis-error-bg);
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: var(--fmis-error);
    font-size: 0.86rem;
    line-height: 1.4;
}

.login-msg:empty { display: none; }

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fmis-ink);
    margin-bottom: 7px;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrap .field-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #7a9486;
    pointer-events: none;
}

.login-input-wrap input,
.login-input-wrap .asp-input {
    width: 100%;
    padding: 12px 44px 12px 42px;
    border: 1px solid var(--fmis-border);
    border-radius: 10px;
    background: #fafcfb;
    color: var(--fmis-ink);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-input-wrap input::placeholder {
    color: #9aada2;
}

.login-input-wrap input:focus {
    background: #fff;
    border-color: var(--fmis-green-mid);
    box-shadow: 0 0 0 3px rgba(42, 111, 71, 0.12);
}

.login-input-wrap .validator {
    position: absolute;
    right: 40px;
    color: var(--fmis-error);
    font-weight: 700;
}

.login-eye-btn {
    position: absolute;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #7a9486;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.login-eye-btn:hover {
    color: var(--fmis-green);
    background: var(--fmis-mint);
}

.login-eye-btn svg {
    width: 18px;
    height: 18px;
}

.login-forgot {
    text-align: right;
    margin: -6px 0 20px;
}

.login-forgot a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--fmis-green-mid);
    text-decoration: none;
}

.login-forgot a:hover {
    color: var(--fmis-green);
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--fmis-green-mid) 0%, var(--fmis-green) 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
    box-shadow: 0 4px 14px rgba(30, 92, 58, 0.28);
}

.login-btn:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 20px rgba(30, 92, 58, 0.35);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: #a8b8ae;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--fmis-border);
}

.login-help-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.login-help-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--fmis-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.login-help-links a:hover {
    color: var(--fmis-green);
}

.login-help-links a svg {
    width: 15px;
    height: 15px;
}

.login-main-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.72rem;
    color: #8a9a90;
    line-height: 1.5;
}

.login-mobile-brand {
    display: none;
    text-align: center;
    margin-bottom: 24px;
}

.login-mobile-brand .fmis-logos {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.login-mobile-brand .fmis-logo {
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    height: 48px;
    width: auto;
    max-width: 52px;
    box-shadow: 0 2px 8px rgba(15, 36, 25, 0.1);
}

.login-mobile-brand h2 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.2rem;
    color: var(--fmis-ink);
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand {
        display: none;
    }

    .login-mobile-brand {
        display: block;
    }

    .login-main {
        padding: 28px 20px 32px;
    }

    .login-page-notice {
        padding: 12px 16px;
    }

    .login-page-notice-title {
        font-size: 0.95rem;
    }

    .login-page-notice-text {
        font-size: 0.82rem;
    }
}

@media (max-width: 420px) {
    .login-card {
        padding: 28px 20px 22px;
    }
}
