:root {
    --gov-green: #3D9970;
    --gov-green-dark: #287653;
    --gov-green-light: #eaf4ee;
    --gov-bg: #f3f5f4;
    --gov-text: #26352d;
    --gov-muted: #68756e;
    --gov-border: #dce5df;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Source Sans Pro', sans-serif;
    color: var(--gov-text);
    background: var(--gov-bg);
}

/* Centered page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

/* Main sign-in card */
.login-card {
    width: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--gov-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(30, 65, 45, 0.08);
}

.login-card-body {
    padding: 30px;
}

/* Agency branding inside the card */
.agency-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    text-align: left;
}

.agency-logo {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--gov-border);
    border-radius: 50%;
    background: #fff;
}

.agency-logo img {
    width: 100%;
    height: 100%;
    padding: 4px;
    object-fit: contain;
}

.agency-logo i {
    display: none;
    color: var(--gov-green);
    font-size: 26px;
}

.agency-brand h1 {
    margin: 0 0 4px;
    color: #244d39;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.agency-brand p {
    margin: 0;
    color: var(--gov-green-dark);
    font-size: 13px;
}

/* Divider */
.branding-divider {
    width: 48px;
    height: 3px;
    margin: 0 auto 22px;
    border-radius: 3px;
    background: var(--gov-green);
}

/* Welcome heading */
.login-heading {
    margin-bottom: 25px;
    text-align: center;
}

.login-heading .welcome-label {
    margin-bottom: 7px;
    color: var(--gov-green-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.login-heading h2 {
    margin: 0 0 8px;
    color: #244d39;
    font-size: 29px;
    font-weight: 700;
    line-height: 1.2;
}

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

/* Form fields */
.form-group {
    margin-bottom: 21px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #34473b;
    font-size: 14px;
    font-weight: 600;
}

.input-group {
    align-items: stretch;
}

.form-control {
    height: 46px;
    border: 1px solid var(--gov-border);
    border-right: 0;
    border-radius: 5px 0 0 5px;
    box-shadow: none;
    color: var(--gov-text);
    font-size: 14px;
}

.form-control::placeholder {
    color: #9aa59e;
}

.form-control:focus {
    z-index: 2;
    border-color: var(--gov-green) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(61, 153, 112, 0.12) !important;
}

.input-group-append .input-group-text,
.password-toggle {
    min-width: 46px;
    justify-content: center;
    border: 1px solid var(--gov-border);
    border-left: 0;
    border-radius: 0 5px 5px 0;
    background: #f8faf8;
    color: var(--gov-green);
}

.password-toggle {
    cursor: pointer;
}

.password-toggle:hover {
    background: var(--gov-green-light);
    color: var(--gov-green-dark);
}

.password-toggle:focus {
    outline: 2px solid var(--gov-green);
    outline-offset: -2px;
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .password-toggle {
    border-color: var(--gov-green);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12) !important;
}

/* Forgot password */
.login-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 23px;
}

.forgot-link {
    color: var(--gov-green-dark);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--gov-green);
    text-decoration: underline;
}

/* Sign-in button */
.btn-government {
    height: 47px;
    border: 1px solid var(--gov-green);
    border-radius: 5px;
    background: var(--gov-green);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-government:hover,
.btn-government:focus {
    border-color: var(--gov-green-dark);
    background: var(--gov-green-dark);
    color: #fff;
}

.btn-government:active {
    transform: translateY(1px);
}

/* Security notice */
.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 22px;
    padding: 13px;
    border: 1px solid #dcebe0;
    border-radius: 6px;
    background: var(--gov-green-light);
    color: #42634f;
    font-size: 12px;
    line-height: 1.6;
}

.security-notice>i {
    margin-top: 3px;
    color: var(--gov-green-dark);
    font-size: 15px;
}

.security-notice strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}

/* Validation alerts */
.alert {
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: 13px;
}

/* Footer */
.login-footer {
    margin-top: 22px;
    color: #78837c;
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
}

.login-footer strong {
    color: #4b5e51;
}

/* Mobile responsiveness */
@media (max-width: 420px) {
    .login-page {
        padding: 20px 14px;
    }

    .login-card-body {
        padding: 24px 20px;
    }

    .agency-brand {
        gap: 10px;
        margin-bottom: 18px;
    }

    .agency-logo {
        width: 50px;
        height: 50px;
    }

    .agency-brand h1 {
        font-size: 12px;
    }

    .agency-brand p {
        font-size: 12px;
    }

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

/* NIA green textbox focus styling */
.form-control:focus {
    border-color: var(--gov-green) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(61, 153, 112, 0.15) !important;
}

/* Change the adjacent icon container when focused */
.input-group:focus-within .input-group-text,
.input-group:focus-within .password-toggle {
    border-color: var(--gov-green) !important;
    color: var(--gov-green-dark) !important;
}

/* Keep invalid fields red */
.form-control.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

/* Forgot password page-specific styles */

.forgot-description {
    margin: 0;
    color: var(--gov-muted, #68756e);
    font-size: 14px;
    line-height: 1.7;
}

.forgot-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--gov-green-light, #eaf4ee);
    color: var(--gov-green-dark, #287653);
    font-size: 23px;
}

.forgot-form {
    margin-top: 25px;
}

.back-to-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--gov-green-dark, #287653);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.back-to-login:hover {
    color: var(--gov-green, #3D9970);
    text-decoration: underline;
}

.reset-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 22px;
    padding: 13px;
    border: 1px solid var(--gov-border, #dce5df);
    border-radius: 6px;
    background: #f8faf8;
    color: var(--gov-muted, #68756e);
    font-size: 12px;
    line-height: 1.6;
}

.reset-notice i {
    margin-top: 3px;
    color: var(--gov-green-dark, #287653);
    font-size: 15px;
}

.reset-notice strong {
    display: block;
    margin-bottom: 2px;
    color: #34473b;
    font-size: 13px;
}
