:root {
    --primary: #002b6c;
    --primary-dark: #001b46;
    --primary-soft: #eaf1fb;
    --accent: #00a9e0;
    --accent-hover: #008fc0;
    --background: #f5f8fc;
    --white: #ffffff;
    --text: #152033;
    --muted: #667085;
    --border: #dce5f0;
    --danger: #dc2626;
    --success: #16a34a;

    --radius-lg: 28px;
    --radius-md: 16px;
    --radius-sm: 10px;

    --shadow-card: 0 24px 70px rgba(15, 36, 64, 0.16);
    --shadow-button: 0 14px 28px rgba(0, 169, 224, 0.24);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font-family: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(380px, 42%) 1fr;
    overflow: hidden;
}

/* =========================
   Panel institucional
========================= */

.brand-panel {
    position: relative;
    overflow: hidden;
    padding: 64px;
    background: radial-gradient(circle at 20% 20%, rgba(0, 169, 224, 0.22), transparent 36%),
    linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: var(--white);
    display: flex;
    align-items: center;
}

.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
    pointer-events: none;
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    left: -180px;
    bottom: -180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.brand-watermark {
    position: absolute;
    right: -160px;
    bottom: -80px;
    width: 620px;
    max-width: none;
    opacity: 0.055;
    pointer-events: none;
    user-select: none;
}

.brand-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
}

.brand-logo {
    width: min(320px, 100%);
    height: auto;
    margin-bottom: 72px;
}

.brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.brand-text h1 {
    margin: 0;
    font-size: clamp(56px, 7vw, 96px);
    line-height: 0.92;
    letter-spacing: -0.055em;
}

.brand-text p {
    max-width: 430px;
    margin: 20px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
    line-height: 1.6;
}

.brand-message {
    margin-top: 64px;
    padding-left: 22px;
    border-left: 4px solid var(--accent);
}

.brand-message p {
    max-width: 420px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
    line-height: 1.7;
}

/* =========================
   Panel de login
========================= */

.login-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: radial-gradient(circle at 85% 15%, rgba(0, 169, 224, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--background) 100%);
}

.login-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 43, 108, 0.035) 25%, transparent 25%) -24px 0 / 48px 48px,
    linear-gradient(225deg, rgba(0, 43, 108, 0.035) 25%, transparent 25%) -24px 0 / 48px 48px;
    opacity: 0.55;
    pointer-events: none;
}

.page-watermark {
    position: absolute;
    right: -110px;
    bottom: -140px;
    width: min(620px, 70vw);
    opacity: 0.045;
    pointer-events: none;
    user-select: none;
}

.login-card {
    position: relative;
    z-index: 2;
    width: min(100%, 440px);
    padding: 42px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(220, 229, 240, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
}

.login-header {
    margin-bottom: 32px;
    text-align: center;
}

.login-logo {
    width: 190px;
    max-width: 80%;
    height: auto;
    margin-bottom: 26px;
}

.login-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.login-header p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}
/* =========================
   Formulario
========================= */

.login-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    height: 52px;
    padding: 0 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #98a2b3;
}

.input-wrapper input:focus {
    border-color: rgba(0, 169, 224, 0.72);
    box-shadow: 0 0 0 4px rgba(0, 169, 224, 0.14);
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: #8a98aa;
    pointer-events: none;
}

.input-icon svg,
.toggle-password svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
}

.toggle-password {
    position: absolute;
    right: 14px;
    width: 28px;
    height: 28px;
    padding: 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8a98aa;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.toggle-password:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.field-message {
    min-height: 16px;
    color: var(--danger);
    font-size: 12px;
}

.form-group.has-error input {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.10);
}

.form-group.has-success input {
    border-color: rgba(22, 163, 74, 0.45);
}

/* =========================
   Opciones
========================= */

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 2px;
    font-size: 13px;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.remember-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.forgot-link {
    color: var(--primary);
    font-weight: 700;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--accent-hover);
}

/* =========================
   Botón
========================= */

.login-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    margin-top: 8px;
    padding: 0 24px;
    border: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #007fc4);
    color: var(--white);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-button);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 18px 34px rgba(0, 169, 224, 0.30);
}

.login-button:active {
    transform: translateY(0);
}

.login-button.is-loading {
    pointer-events: none;
    opacity: 0.9;
}

.login-button.is-loading .button-text {
    opacity: 0;
}

.button-loader {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.40);
    border-top-color: #ffffff;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.7s linear infinite;
}

.login-button.is-loading .button-loader {
    opacity: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   Footer
========================= */

.login-footer {
    display: grid;
    gap: 10px;
    margin-top: 30px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.login-footer a {
    color: var(--primary);
    font-weight: 700;
}

.login-footer a:hover {
    color: var(--accent-hover);
}

/* =========================
   Responsive
========================= */

@media (max-width: 1100px) {
    .login-page {
        grid-template-columns: 38% 1fr;
    }

    .brand-panel {
        padding: 44px;
    }

    .brand-logo {
        margin-bottom: 52px;
    }
}

@media (max-width: 900px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 32px 20px;
    }

    .login-card {
        padding: 34px 26px;
    }

    .page-watermark {
        right: -180px;
        bottom: -90px;
        width: 520px;
        opacity: 0.04;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
        border-radius: 22px;
    }

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

    .form-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .input-wrapper input {
        height: 50px;
        font-size: 14px;
    }
}