: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: linear-gradient(180deg, #ffffff 0%, #f6f7fb 45%, #edf2ff 100%);
    color: #1f2433;
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
    position: relative;
    overflow-y: auto;
}

.background-texture {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 35%),
                linear-gradient(225deg, rgba(255, 255, 255, 0.06) 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: #ffffff;
    border: 1px solid rgba(15, 35, 70, 0.08);
    border-radius: 28px;
    box-shadow: 0 25px 55px rgba(32, 40, 73, 0.15);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    overflow: hidden;
}

.brand-panel {
    background: linear-gradient(160deg, #ffffff 0%, #f3f6ff 48%, #e5ecff 100%);
    padding: 52px 46px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    position: relative;
    overflow: hidden;
    color: #1b2333;
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), 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;
    color: #1b2333;
}

.brand-panel p {
    margin: 0;
    color: #6c758b;
    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.9);
    border: 1px solid rgba(20, 32, 64, 0.08);
    border-radius: 999px;
    color: #1b2333;
    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(15, 25, 60, 0.04);
    border: 1px solid rgba(15, 25, 60, 0.08);
    border-radius: 12px;
    color: #1b2333;
}

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

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

.highlight span {
    color: #4d5871;
    font-size: 13px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(15, 25, 60, 0.04);
    border: 1px solid rgba(15, 25, 60, 0.1);
    border-radius: 12px;
    color: #1b2333;
    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;
    position: relative;
}

.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);
}

.ticket-action-group {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.ticket-action-group .btn {
    border-radius: 999px;
    padding: 0.25rem 0.85rem;
    font-weight: 600;
}

.ticket-action-group .btn i {
    font-size: 0.75rem;
}

/* --- Modales custom --- */
.modal-shell {
    position: fixed;
    inset: 0;
    background: rgba(10, 23, 49, 0.55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.modal-shell.active {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(12, 39, 69, 0.25);
    padding: 22px 22px 18px;
    position: relative;
    overflow: hidden;
}

.modal-card h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: #0b1f3b;
}

.modal-card p {
    margin: 0 0 16px;
    color: #5d6b7f;
    font-size: 14px;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #0b1f3b;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.modal-close:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.btn-secondary-outline {
    width: 100%;
    padding: 12px;
    border: 1px solid #d0d8e8;
    border-radius: 12px;
    background: #fff;
    color: #0b1f3b;
    font-weight: 700;
    cursor: pointer;
    transition: border 0.15s ease, background 0.15s ease;
}

.btn-secondary-outline:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.btn-primary-fill {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(215, 44, 54, 0.3);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary-fill:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(215, 44, 54, 0.35);
}

.modal-form .input-group {
    margin-bottom: 14px;
}

.input-frame .action-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa7bc;
    cursor: pointer;
    transition: color 0.15s ease;
}

.input-frame .action-icon:hover {
    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%;
    }
}
