:root {
    --primary: #d72c36;
    --primary-dark: #b52023;
    --navy: #0b1a30;
    --card: #0f243f;
    --muted: #9fb3d9;
    --border: rgba(255, 255, 255, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(215, 44, 54, 0.14), transparent 35%),
                radial-gradient(circle at 80% 0%, rgba(44, 86, 154, 0.18), transparent 40%),
                radial-gradient(circle at 50% 80%, rgba(14, 180, 137, 0.14), transparent 35%),
                #0b1324;
    color: #e9f1ff;
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
    position: relative;
    overflow: hidden;
}

.background-texture {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 35%),
                linear-gradient(225deg, rgba(255, 255, 255, 0.03) 10%, rgba(255, 255, 255, 0) 45%);
    filter: blur(0.5px);
    pointer-events: none;
}

.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1150px;
}

.login-card {
    background: rgba(15, 24, 40, 0.8);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    overflow: hidden;
}

.brand-panel {
    background: radial-gradient(circle at 25% 20%, rgba(215, 44, 54, 0.28), transparent 40%),
                radial-gradient(circle at 90% 30%, rgba(62, 130, 255, 0.18), transparent 35%),
                linear-gradient(145deg, #0b253e, #0b1a30 50%, #0b253e);
    padding: 52px 46px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    position: relative;
    overflow: hidden;
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 55%);
    top: -60px;
    right: -60px;
    transform: rotate(15deg);
}

.brand-panel h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.25;
    letter-spacing: -0.5px;
}

.brand-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    max-width: 520px;
}

.brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #eaf2ff;
    font-weight: 600;
    font-size: 14px;
    width: fit-content;
}

.chip-dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #f87171, var(--primary));
    border-radius: 50%;
    box-shadow: 0 0 0 6px rgba(215, 44, 54, 0.18);
}

.brand-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.highlight {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #f1f5ff;
}

.highlight i {
    color: var(--primary);
    font-size: 18px;
    margin-top: 2px;
}

.highlight strong {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
}

.highlight span {
    color: var(--muted);
    font-size: 13px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #dce7ff;
    font-size: 14px;
}

.pulse {
    width: 10px;
    height: 10px;
    background: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.45); }
    70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.form-panel {
    background: #ffffff;
    color: #0d1b2f;
    padding: 46px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-left: 1px solid #e4ebf5;
}

.logo-header {
    text-align: center;
}

.logo-completo {
    width: 68%;
    max-width: 280px;
    height: auto;
}

.tagline {
    margin: 10px 0 0;
    color: #6c7b90;
    font-size: 14px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.input-group label {
    font-weight: 600;
    color: #0d1b2f;
    font-size: 15px;
}

.input-frame {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f6f8fb;
    border: 1px solid #e4ebf5;
    border-radius: 12px;
    padding: 12px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-frame:focus-within {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(15, 36, 63, 0.08), 0 0 0 3px rgba(215, 44, 54, 0.12);
}

.field-icon {
    color: #9aa8bc;
    font-size: 16px;
}

.input-frame input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 16px;
    color: #0d1b2f;
    outline: none;
    padding: 6px 0;
}

.input-frame input::placeholder {
    color: #b2bfd3;
}

.password-group {
    position: relative;
}

.toggle-password {
    color: #9aa8bc;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

.login-button {
    margin-top: 6px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 14px 30px rgba(215, 44, 54, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(181, 32, 35, 0.35);
    filter: brightness(1.02);
}

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

.extras {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    color: #6c7b90;
    font-size: 14px;
}

.forgot-password {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-dark);
}

.divider {
    color: #c9d2e0;
}

.help-text i {
    margin-right: 6px;
    color: var(--primary);
}

/* Loader estilo Costa Rica (Azul, Blanco, Rojo) */
.loader-cr {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #002B7F;
    border-right: 6px solid #CE1126;
    border-bottom: 6px solid #002B7F;
    border-left: 6px solid #CE1126;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin-cr 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin-cr {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

    .brand-panel,
    .form-panel {
        padding: 36px 28px;
    }

    .brand-panel h1 {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
    body {
        padding: 24px 14px;
    }

    .brand-highlights {
        grid-template-columns: 1fr;
    }

    .logo-completo {
        width: 78%;
    }
}
