﻿:root {
    --primary: #0066CC;
    --primary-dark: #0052A3;
    --primary-darker: #003D7A;
    --accent: #FF4500;
    --accent-dark: #CC3700;
    --error: #dc3545;
    --success: #28a745;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.6)), url('../img/ciudad.jpg') no-repeat center center/cover;
    background-attachment: fixed;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    overflow-x: hidden;
}

    body::before {
        content: '';
        position: fixed;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(0, 102, 204, 0.08) 0%, transparent 70%);
        animation: rotate 30s linear infinite;
        pointer-events: none;
        z-index: 0;
    }

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.centered-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    width: 100%;
    max-width: 360px; /* un poco más ancho que 320px */
    padding: 28px 24px; /* equilibrio entre compacto y espacioso */
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}



@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

    .login-header img {
        height: 80px;
        margin-bottom: 20px;
        user-select: none;
        animation: fadeIn 0.8s ease;
        object-fit: contain;
        filter: drop-shadow(0 4px 8px rgba(0, 102, 204, 0.2));
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.login-header h2 {
    color: #1a1a1a;
    font-size: 22px;
    margin: 0 0 8px 0;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

    .login-header h2::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: linear-gradient(90deg, var(--accent), var(--accent-dark));
        border-radius: 2px;
    }

.login-header p {
    color: #666;
    font-size: 15px;
    margin: 0;
    padding-top: 8px;
}

.form-group {
    position: relative;
    margin-bottom: 14px;
}

    .form-group label {
        display: block;
        font-size: 14px;
        font-weight: 600;
        color: #333;
        margin-bottom: 8px;
        transition: color 0.3s ease;
    }

    .form-group .form-control {
        border-radius: 12px;
        border: 2px solid #e5e5e5;
        padding: 10px 10px 10px 36px;
        width: 100%;
        font-size: 14px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: #fafafa;
    }

        .form-group .form-control:hover {
            border-color: #d0d0d0;
            background: #fff;
        }

        .form-group .form-control:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15);
            outline: none;
            background: #fff;
        }

        .form-group .form-control.error {
            border-color: var(--error);
            animation: shake 0.4s ease;
        }

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.form-group .input-icon {
    position: absolute;
    left: 16px;
    bottom: 16px;
    color: #999;
    font-size: 18px;
    transition: color 0.3s ease;
    pointer-events: none;
}

.form-group .form-control:focus ~ .input-icon {
    color: var(--primary);
}

.form-group .toggle-password {
    position: absolute;
    right: 16px;
    bottom: 16px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    transition: color 0.2s ease;
}

    .form-group .toggle-password:hover {
        color: var(--primary);
    }

.form-check-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .form-check input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: var(--primary);
    }

    .form-check label {
        cursor: pointer;
        color: #555;
        margin: 0;
        user-select: none;
    }

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .forgot-link:hover {
        color: var(--primary-dark);
        text-decoration: underline;
    }

.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    font-weight: 700;
    padding: 12px 16px;
    font-size: 15px;
    width: 100%;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

    .btn-login::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .btn-login:hover::before {
        width: 300px;
        height: 300px;
    }

    .btn-login:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 24px rgba(0, 102, 204, 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);
    }
}

.alert-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 14px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error);
    border: 1px solid rgba(220, 53, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
    border: 1px solid rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #999;
    font-size: 14px;
    margin: 16px 0;
}

    .divider::before,
    .divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid #e5e5e5;
    }

    .divider span {
        padding: 0 16px;
    }

.login-footer {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

    .login-footer a {
        color: var(--primary);
        text-decoration: none;
        font-weight: 600;
        transition: color 0.2s ease;
    }

        .login-footer a:hover {
            color: var(--primary-dark);
        }

/* Modal mejorado */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), rgba(0, 61, 122, 0.08));
}

.modal-title {
    font-weight: 700;
    color: #1a1a1a;
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 20px 28px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    border-radius: 10px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(0, 102, 204, 0.35) !important;
    }

.btn-secondary {
    border-radius: 10px;
    padding: 10px 24px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px;
    }

    .login-header h2 {
        font-size: 24px;
    }

    .form-check-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Accesibilidad */
.form-control:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* Modal mejorado - MÁS COMPACTO Y ELEGANTE */
.modal-dialog {
    max-width: 420px;
}

.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), rgba(0, 61, 122, 0.08));
}

.modal-title {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .modal-title i {
        font-size: 16px;
        color: var(--primary);
    }

.modal-body {
    padding: 24px;
}

    .modal-body p {
        font-size: 14px;
        color: #666;
        margin-bottom: 16px;
        line-height: 1.5;
    }

    .modal-body .form-group {
        margin-bottom: 0;
    }

        .modal-body .form-group label {
            font-size: 13px;
            margin-bottom: 6px;
        }

        .modal-body .form-group .form-control {
            padding: 12px 14px;
            font-size: 14px;
        }

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 16px 24px;
    gap: 10px;
}

    .modal-footer .btn {
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 8px;
        font-weight: 600;
        min-width: 100px;
    }

.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(-2px);
        box-shadow: 0 6px 12px rgba(0, 102, 204, 0.3) !important;
    }

.btn-secondary {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #666;
    transition: all 0.2s ease;
}

    .btn-secondary:hover {
        background: #e8e8e8;
        border-color: #d0d0d0;
        color: #333;
    }

.btn-close {
    padding: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

    .btn-close:hover {
        opacity: 1;
    }

/* Spinner en el botón del modal */
.spinner-border-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}
