:root {
    --primary: #0057B8;
    --primary-dark: #003F8A;
    --primary-light: #E8F0FB;
    --accent: #00C2FF;
    --error: #dc3545;
    --success: #28a745;
    --text: #1a1a2e;
    --muted: #6c757d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    min-height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.25), rgba(0,20,60,0.55)),
                url('../img/ciudad.jpg') no-repeat center center / cover;
    background-attachment: fixed;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.centered-container {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Card principal - dos paneles */
.login-container {
    display: flex;
    width: 100%;
    max-width: 1000px;
    min-height: 580px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.08);
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Panel izquierdo - branding */
.login-brand {
    flex: 1.2;
    background: linear-gradient(160deg, var(--primary) 0%, #001f6b 100%);
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: rgba(0, 194, 255, 0.08);
}

.brand-name {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    text-transform: lowercase;
}

.brand-content {
    position: relative;
    z-index: 1;
}

.brand-content h1 {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.brand-content p {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    line-height: 1.6;
}

.brand-badges {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    backdrop-filter: blur(4px);
}

.brand-badge i {
    color: var(--accent);
    font-size: 15px;
    flex-shrink: 0;
}

/* Panel derecho - formulario */
.login-form-panel {
    flex: 1;
    background: #fff;
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    margin-bottom: 28px;
}

.login-header h2 {
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--muted);
    font-size: 14px;
}

/* Formulario */
.login-form { width: 100%; }

.form-group {
    position: relative;
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-group .form-control {
    width: 100%;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    padding: 11px 42px 11px 38px;
    font-size: 14px;
    color: var(--text);
    background: #F9FAFB;
    transition: all 0.25s ease;
    outline: none;
}

.form-group .form-control:hover {
    border-color: #D1D5DB;
    background: #fff;
}

.form-group .form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 87, 184, 0.12);
}

.form-group .form-control.error {
    border-color: var(--error);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

.form-group .input-icon {
    position: absolute;
    left: 13px;
    bottom: 13px;
    color: #9CA3AF;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.25s;
}

.form-group .form-control:focus ~ .input-icon {
    color: var(--primary);
}

.form-group .toggle-password {
    position: absolute;
    right: 12px;
    bottom: 11px;
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 15px;
    padding: 2px;
    transition: color 0.2s;
    line-height: 1;
}

.form-group .toggle-password:hover { color: var(--primary); }

.form-check-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 7px;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-check label {
    cursor: pointer;
    color: #6B7280;
    margin: 0;
    user-select: none;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    font-size: 13px;
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Botón login */
.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 87, 184, 0.4);
}

.btn-login:active { transform: translateY(0); }

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-login .btn-text { position: relative; z-index: 1; }

.btn-login .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.btn-login.loading .btn-text { display: none; }
.btn-login.loading .spinner  { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Alerta */
.alert-message {
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 14px;
    font-size: 13px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-message.error {
    background: rgba(220,53,69,0.08);
    color: var(--error);
    border: 1px solid rgba(220,53,69,0.25);
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-message.success {
    background: rgba(40,167,69,0.08);
    color: var(--success);
    border: 1px solid rgba(40,167,69,0.25);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal */
.modal-dialog  { max-width: 420px; }

.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #F3F4F6;
    background: linear-gradient(135deg, rgba(0,87,184,0.04), rgba(0,31,107,0.06));
}

.modal-title {
    font-weight: 700;
    color: var(--text);
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title i { color: var(--primary); font-size: 15px; }
.modal-body    { padding: 24px; }
.modal-body p  { font-size: 14px; color: var(--muted); line-height: 1.5; margin-bottom: 16px; }
.modal-footer  { padding: 16px 24px; border-top: 1px solid #F3F4F6; gap: 10px; }

.modal-footer .btn {
    padding: 9px 20px;
    font-size: 14px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,87,184,0.35) !important;
}

.btn-secondary {
    background: #F5F5F5;
    border: 1px solid #E0E0E0 !important;
    color: #555 !important;
}

.btn-secondary:hover { background: #E8E8E8; color: #333 !important; }
.btn-close { opacity: 0.4; transition: opacity 0.2s; }
.btn-close:hover { opacity: 1; }

/* Responsive */
@media (max-width: 760px) {
    .login-brand { display: none; }

    .login-container {
        max-width: 460px;
        min-height: auto;
        border-radius: 20px;
    }

    .login-form-panel { padding: 40px 32px; }
}

@media (max-width: 460px) {
    .login-form-panel { padding: 32px 24px; }

    .form-check-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
