:root {
    --primary: #054b14;
    --primary-dark: #012b01;
    --secondary: #087f6b;
    --accent: #f2b544;
    --text: #172b3a;
    --muted: #6d7c88;
    --border: #dfe7ec;
    --background: #f5f8fa;
    --white: #ffffff;
    --danger: #c62828;
    --success: #147d58;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: "Inter", Arial, sans-serif;
    color: var(--text);
    background: var(--background);
}

a {
    color: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(390px, 0.65fr);
}

/* ==========================================================
    PANEL VISUAL
   ========================================================== */
.visual-panel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: flex-end;      /* texto abajo */
    justify-content: center;
    padding: 50px 50px 50px;    /* abajo deja espacio al copyright */
    color: var(--white);
    background:
        linear-gradient(0deg,
            rgba(6, 71, 15, 0.90) 20%,
            rgba(6, 71, 15, 0.90) 20%,
            rgba(6, 71, 15, 0.4) 60%,
            rgba(6, 71, 15, 0.20) 75%,
            rgba(6, 71, 15, 0.05) 100%),
        url('../images/portada_cbc.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.visual-panel::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    right: -160px;
    top: -180px;
}

.visual-panel::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 50%;
    left: -180px;
    bottom: -220px;
}

.visual-content {
    position: relative;
    z-index: 2;
    width: min(760px, 100%);
}

.brand-badge {
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0,0,0,.15);
    font-weight: 800;
    letter-spacing: -1px;
    font-size: 18px;
}

.visual-content h1 {
    max-width: 700px;
    margin: 28px 0 18px;
    font-size: clamp(38px, 4vw, 66px);
    line-height: 1.05;
    letter-spacing: -3px;
    font-weight: 800;
}

.visual-content h1 span {
    color: #ffd477;
}

.visual-content > p {
    max-width: 620px;
    margin: 0;
    font-size: 17px;
    line-height: 1.8;
    color: rgba(255,255,255,.82);
}

.institution-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 10px 15px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.16);
    font-size: 13px;
    font-weight: 600;
}

.institution-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7ee3bc;
    box-shadow: 0 0 0 5px rgba(126,227,188,.12);
}

.visual-shapes {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    bottom: 0;
    height: 34%;
    opacity: .72;
}

.mountain {
    position: absolute;
    bottom: -1px;
    width: 0;
    height: 0;
    border-left: 190px solid transparent;
    border-right: 190px solid transparent;
    border-bottom: 230px solid rgba(3,35,59,.48);
}

.mountain.one { left: 4%; }
.mountain.two { left: 30%; transform: scale(1.35); opacity: .75; }
.mountain.three { right: 2%; transform: scale(.95); opacity: .55; }
.visual-shapes { display: none; }

.footer-visual {
    position: absolute;
    z-index: 3;
    bottom: 28px;
    left: 70px;
    font-size: 12px;
    color: rgba(255,255,255,.60);
}

/* ==========================================================
    PANEL LOGIN
   ========================================================== */
.login-panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 45px 42px;
    background: var(--white);
}

.login-card {
    width: min(430px, 100%);
}

.mobile-brand { display: none; }

.system-label {
    margin: 0 0 9px;
    color: var(--secondary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.login-card h2 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -1px;
}

.login-description {
    margin: 12px 0 30px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: #294050;
    font-size: 13px;
    font-weight: 700;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #81919c;
    font-size: 17px;
    pointer-events: none;
}

.field input {
    width: 100%;
    height: 52px;
    padding: 0 46px 0 45px;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    background: #fbfcfd;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.field input::placeholder { color: #9aa8b1; }

.field input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(11,71,117,.09);
}

.toggle-password {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #82929d;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 2px 0 22px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #687985;
    font-size: 12px;
    cursor: pointer;
}

.remember input {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.forgot-link {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.forgot-link:hover { text-decoration: underline; }

.terms {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 18px 0 20px;
    color: #73818a;
    font-size: 11.5px;
    line-height: 1.55;
}

.terms input {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: var(--secondary);
}

.terms a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.terms a:hover { text-decoration: underline; }

.login-button {
    width: 100%;
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(1, 53, 5, 0.18);
    transition: transform .2s, box-shadow .2s, opacity .2s;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 28px rgba(0, 46, 4, 0.23);
}

.login-button:disabled {
    cursor: not-allowed;
    opacity: .65;
    transform: none;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 18px;
    color: #7d8a92;
    font-size: 11px;
}

.security-note strong { color: var(--success); }

.captcha-box {
    display: none;
    margin: 0 0 20px;
    padding: 14px;
    border: 1px solid #e4e9ed;
    border-radius: 10px;
    background: #fafcfd;
}

.captcha-box.visible { display: block; }

.captcha-title {
    margin: 0 0 5px;
    color: #314653;
    font-size: 12px;
    font-weight: 800;
}

.captcha-description {
    margin: 0 0 10px;
    color: #7a8992;
    font-size: 11px;
    line-height: 1.45;
}

.captcha-demo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px dashed #cdd8de;
    border-radius: 8px;
    background: #fff;
    color: #536772;
    font-size: 11px;
}

.captcha-demo input {
    width: 16px;
    height: 16px;
    accent-color: var(--secondary);
}

.captcha-demo small {
    margin-left: auto;
    color: #8b979e;
}

.attempt-message {
    display: none;
    margin: -4px 0 18px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff5f5;
    color: var(--danger);
    font-size: 11.5px;
    line-height: 1.45;
}

.attempt-message.visible { display: block; }

.login-footer {
    margin-top: 32px;
    padding-top: 19px;
    border-top: 1px solid #edf0f2;
    text-align: center;
}

.login-footer p {
    margin: 0;
    color: #8a969d;
    font-size: 10.5px;
    line-height: 1.6;
}

.login-footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

/* ==========================================================
    RESPONSIVE
   ========================================================== */
@media (max-width: 1000px) {
    .login-page { grid-template-columns: 1fr; }
    .visual-panel { min-height: 300px; padding: 45px 40px; }
    .visual-content h1 { font-size: 42px; }
    .footer-visual { left: 40px; }
    .login-panel { min-height: auto; padding: 55px 30px; }
}

@media (max-width: 620px) {
    .visual-panel { display: none; }
    .login-panel { min-height: 100vh; padding: 30px 22px; }
    .mobile-brand { display: block; margin-bottom: 34px; }
    .mobile-brand strong { display: block; color: var(--primary-dark); font-size: 20px; letter-spacing: -.5px; }
    .mobile-brand span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
    .login-card h2 { font-size: 29px; }
    .login-options { align-items: flex-start; }
}

/* =========================================================
   TIPOGRAFÍA INSTITUCIONAL
   ========================================================= */
:root {
    --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Manrope', 'Inter', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

/* Aplicación global */
body,
.pc-container,
.pc-content {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
}

/* Títulos */
h1, h2, h3, h4, h5, h6,
.dashboard-heading h4,
.dashboard-filter-title h5,
.dashboard-section-title h5,
.dashboard-kpi h3 {
    font-family: var(--font-heading);
    letter-spacing: -0.015em;
}

/* Labels en mayúsculas */
.dashboard-kpi-label,
.filter-label,
.dashboard-filter-label {
    font-family: var(--font-body);
    letter-spacing: 0.04em;
}

/* Tablas */
.dashboard-table,
table.dataTable {
    font-family: var(--font-body);
    font-size: 12.5px;
}
.dashboard-table thead th {
    font-family: var(--font-heading);
    letter-spacing: 0.03em;
}