/* =====================================================================
   CLCRV2 — login page.
   Self-contained: the login screen has no sidebar/header shell.

   NOTE: the legacy design used assets/images/bg.png as a full-bleed
   background. That file is 19 MB, which is a painful first paint on a
   municipal connection, so the backdrop here is a pure CSS gradient.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

:root {
    --navy:      #17318f;
    --navy-dark: #101f63;
    --accent:    #2f5fd0;
    --ink:       #1f2937;
    --muted:     #6b7280;
    --line:      #d5ddf3;
    --danger:    #d92d20;
}

* { box-sizing: border-box; }

body.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    overflow-x: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 18% 22%, rgba(74, 128, 234, .55), transparent 46%),
        radial-gradient(circle at 82% 78%, rgba(28, 54, 150, .6), transparent 48%),
        linear-gradient(140deg, #12256e 0%, #1d3fa5 48%, #2f5fd0 100%);
    z-index: -2;
}

.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 70, .25);
    z-index: -1;
}

.login-shell {
    width: 100%;
    max-width: 940px;
}

.login-card {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(8, 18, 60, .38);
}

/* ---------- Identity panel ---------- */
.login-left {
    background: linear-gradient(160deg, var(--navy), var(--navy-dark));
    color: #fff;
    padding: 44px 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-left .gov-seal {
    width: 74px;
    height: 74px;
    object-fit: contain;
    margin-bottom: 18px;
}

.gov-header { display: flex; flex-direction: column; gap: 3px; line-height: 1.35; }
.gov-republic     { font-size: .78rem; letter-spacing: 1.6px; opacity: .85; }
.gov-municipality { font-size: 1.12rem; font-weight: 800; letter-spacing: .6px; }
.gov-province     { font-size: .82rem; opacity: .85; }

.welcome-text {
    font-size: 2.6rem;
    font-weight: 900;
    margin: 26px 0 10px;
    line-height: 1;
}

.left-footer { font-size: .8rem; opacity: .8; margin: 0; max-width: 34ch; }

/* ---------- Form panel ---------- */
.login-right {
    padding: 44px 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.db-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: .4px;
    margin: 0 0 24px;
    line-height: 1.3;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: #fdecea;
    color: #96231a;
    border-left: 4px solid var(--danger);
    border-radius: 9px;
    padding: 11px 14px;
    font-size: .85rem;
    margin-bottom: 18px;
}

.login-field { margin-bottom: 16px; }

.login-field label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
    letter-spacing: .3px;
}

.input-wrap { position: relative; }

.input-wrap input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 44px 12px 14px;
    font-size: .92rem;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 95, 208, .16);
}

.input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    display: flex;
    align-items: center;
    font-size: 1.05rem;
}

.input-icon.as-button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.input-icon.as-button:hover { color: var(--accent); }

.forgot-row { text-align: right; margin-bottom: 22px; }
.forgot-link { font-size: .8rem; color: var(--accent); font-weight: 500; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

.btn-login {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: .98rem;
    letter-spacing: .4px;
    padding: 13px;
    cursor: pointer;
    transition: background .18s ease;
}

.btn-login:hover { background: var(--navy); }

.copyright {
    text-align: center;
    color: rgba(255, 255, 255, .88);
    font-size: .8rem;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
    .login-card { grid-template-columns: 1fr; }

    .login-left { padding: 30px 26px; text-align: center; align-items: center; }
    .login-left .gov-seal { width: 58px; height: 58px; margin-bottom: 12px; }
    .gov-header { align-items: center; }
    .welcome-text { font-size: 2rem; margin: 16px 0 6px; }
    .left-footer { display: none; }

    .login-right { padding: 30px 26px; }
    .db-title { font-size: .95rem; text-align: center; }
}

@media (max-width: 380px) {
    .login-left, .login-right { padding: 24px 18px; }
    .welcome-text { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .btn-login { transition: none; }
}
