/* ===== VARIABLES CSS EXACTAS DEL INDEXADMIN ===== */
:root {
    /* Colores EXACTOS del indexAdmin.blade.php */
    --gov-primary: #1e3a8a;
    --gov-secondary: #2563eb;
    --gov-accent: #3b82f6;
    --gov-success: #059669;
    --gov-danger: #dc2626;
    --gov-navy: #1e293b;

    /* Grises exactos */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, #e0f7fa 25%, #f0f8ff 50%, var(--gray-100) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    overflow: hidden;
}

/* Fondo con colores gubernamentales */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(30, 58, 138, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(5, 150, 105, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.15);
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
    height: 85vh;
    max-height: 600px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    z-index: 10;
}

/* ===== PANEL IZQUIERDO (INFO PANEL) ===== */
.info-panel {
    background: linear-gradient(135deg, var(--gov-primary) 0%, var(--gov-navy) 50%, var(--gov-secondary) 100%);
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Patrón de fondo sutil */
.info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.4;
    z-index: 1;
}

.info-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ===== LOGO SECTION COMO EN EL EJEMPLO ===== */
.logo-section {
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* LOGO WRAPPER - IGUAL AL EJEMPLO CON FONDO BLANCO */
.logo-wrapper {
    width: 100%;
    height: 130px;
    background: linear-gradient(135deg, #b5cff0ff 0%, #cfd7dfff 50%, var(--gray-100) 100%);
    padding: 0.5rem;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efectos de fondo del logo igual al ejemplo */
.logo-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(239, 68, 68, 0.03) 0%, transparent 50%);
    z-index: 1;
}

.logo-wrapper:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 25px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* IMAGEN DEL LOGO - EXACTAMENTE COMO EN EL EJEMPLO */
.logo-wrapper img {
    width: 100%;
    max-width: 380px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
    /* Sin filtros que cambien colores - mantiene colores originales */
}

.logo-wrapper:hover img {
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
    transform: scale(1.02);
}

/* ===== CARACTERÍSTICAS EN EL MEDIO ===== */
.features {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 280px;
    padding: 20px 25px;
    margin: 0 auto;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateX(5px);
}

.feature-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.feature-text {
    font-size: 13px;
    font-weight: 600;
    color: white;
}

/* ===== INFORMACIÓN INSTITUCIONAL ===== */
.institution-info {
    text-align: center;
    position: relative;
    padding: 20px 25px;
    margin-top: auto;
}

.institution-info h1 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.institution-info p {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

    /* ===== PANEL DERECHO (FORMULARIO) ===== */
    .form-panel {
        padding: 30px 25px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        background: linear-gradient(135deg, #ffffff 0%, var(--gray-50) 100%);
    }

    /* ===== HEADER MÓVIL CON LOGO CORRECTO ===== */
    .mobile-header {
        display: none;
        text-align: center;
        margin: 0;
        padding: 0;
        background: linear-gradient(135deg, var(--gov-primary) 0%, var(--gov-secondary) 100%);
        color: white;
        box-shadow: 0 4px 15px rgba(30, 58, 138, 0.2);
        width: 100%;
        position: relative;
        overflow: hidden;
    }

    /* Patrón de fondo para móvil */
    .mobile-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
        opacity: 0.3;
        z-index: 1;
    }

    /* Logo móvil igual al ejemplo */
    .mobile-logo {
        width: 100%;
        max-width: none;
        height: 120px;
        margin: 0;
        padding: 20px;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, var(--gray-100) 100%);
        border: none;
        border-radius: 0;
        border-bottom: 2px solid rgba(255, 255, 255, 0.25);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
        position: relative;
        z-index: 2;
    }

    .mobile-logo::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background:
            radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(239, 68, 68, 0.03) 0%, transparent 50%);
        z-index: 1;
    }

    .mobile-logo img {
        width: auto;
        max-width: 280px;
        height: 60px;
        object-fit: contain;
        filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
        margin-bottom: 8px;
        position: relative;
        z-index: 2;
    }

    .mobile-title {
        font-size: 20px;
        font-weight: 800;
        margin-bottom: 4px;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        color: white;
    }

    .mobile-subtitle {
        font-size: 12px;
        opacity: 0.9;
        font-weight: 500;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        color: rgba(255, 255, 255, 0.9);
    }

    /* ===== HEADER DEL FORMULARIO ===== */
    .form-header {
        text-align: center;
        margin-bottom: 25px;
    }

    .welcome-title {
        font-size: 28px;
        font-weight: 800;
        color: var(--gray-900);
        margin-bottom: 8px;
        background: linear-gradient(135deg, var(--gov-primary), var(--gov-secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .welcome-subtitle {
        font-size: 14px;
        color: var(--gray-600);
        font-weight: 500;
    }

    /* ===== FORMULARIO ===== */
    .login-form {
        max-width: 320px;
        margin: 0 auto;
        width: 100%;
    }

    /* Alertas */
    .alert {
        padding: 12px 16px;
        border-radius: 10px;
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 600;
        font-size: 13px;
    }

    .alert-success {
        background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), rgba(16, 185, 129, 0.15));
        color: var(--gov-success);
        border: 1px solid rgba(5, 150, 105, 0.3);
    }

    .alert-danger {
        background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(239, 68, 68, 0.15));
        color: var(--gov-danger);
        border: 1px solid rgba(220, 38, 38, 0.3);
    }

    /* Campos de entrada */
    .form-group {
        margin-bottom: 18px;
    }

    .form-label {
        display: block;
        font-weight: 600;
        color: var(--gray-700);
        margin-bottom: 6px;
        font-size: 13px;
    }

    .input-wrapper {
        position: relative;
    }

    .form-input {
        width: 100%;
        padding: 14px 14px 14px 40px;
        border: 2px solid var(--gray-200);
        border-radius: 10px;
        font-size: 15px;
        font-weight: 500;
        background: white;
        color: var(--gray-900);
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .form-input:focus {
        outline: none;
        border-color: var(--gov-accent);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        transform: translateY(-1px);
    }

    .form-input:hover {
        border-color: var(--gray-300);
    }

    .input-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray-400);
        font-size: 16px;
        transition: all 0.3s ease;
    }

    .form-input:focus + .input-icon {
        color: var(--gov-accent);
    }

    .password-toggle {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: var(--gray-400);
        cursor: pointer;
        padding: 6px;
        border-radius: 6px;
        font-size: 16px;
        transition: all 0.3s ease;
    }

    .password-toggle:hover {
        color: var(--gov-accent);
        background: var(--gray-100);
    }

    .form-hint {
        font-size: 11px;
        color: var(--gray-500);
        margin-top: 4px;
        font-weight: 500;
    }

    /* ===== OPCIONES DEL FORMULARIO ===== */
    .form-options {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .checkbox-wrapper {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }

    .checkbox-input {
        width: 16px;
        height: 16px;
        border: 2px solid var(--gray-300);
        border-radius: 4px;
        position: relative;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .checkbox-input input {
        opacity: 0;
        position: absolute;
        width: 100%;
        height: 100%;
        cursor: pointer;
    }

    .checkbox-input input:checked + .checkbox-input {
        background: var(--gov-accent);
        border-color: var(--gov-accent);
    }

    .checkbox-input::after {
        content: '';
        position: absolute;
        left: 4px;
        top: 1px;
        width: 3px;
        height: 6px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .checkbox-input input:checked ~ .checkbox-input::after {
        opacity: 1;
    }

    .checkbox-label {
        font-size: 13px;
        color: var(--gray-700);
        font-weight: 500;
        cursor: pointer;
    }

    .forgot-link {
        color: var(--gov-accent);
        text-decoration: none;
        font-size: 13px;
        font-weight: 600;
        transition: all 0.3s ease;
    }

    .forgot-link:hover {
        color: var(--gov-primary);
        text-decoration: underline;
    }

    /* ===== BOTÓN PRINCIPAL ===== */
    .submit-btn {
        width: 100%;
        padding: 14px 20px;
        background: linear-gradient(135deg, var(--gov-primary) 0%, var(--gov-secondary) 100%);
        border: none;
        border-radius: 10px;
        color: white;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-bottom: 16px;
        box-shadow: 0 6px 20px rgba(30, 58, 138, 0.3);
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
        background: linear-gradient(135deg, var(--gov-navy) 0%, var(--gov-primary) 100%);
    }

    .submit-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
    }

    .btn-icon {
        transition: transform 0.3s ease;
        font-size: 14px;
    }

    .submit-btn:hover .btn-icon {
        transform: translateX(3px);
    }

    /* ===== SECCIÓN DE REGISTRO ===== */
    .register-section {
        text-align: center;
        padding-top: 16px;
        border-top: 1px solid var(--gray-200);
    }

    .register-text {
        color: var(--gray-600);
        margin-bottom: 6px;
        font-size: 13px;
        font-weight: 500;
    }

    .register-link {
        color: var(--gov-accent);
        text-decoration: none;
        font-weight: 600;
        font-size: 13px;
        transition: all 0.3s ease;
    }

    .register-link:hover {
        color: var(--gov-primary);
        text-decoration: underline;
    }

    /* ===== ESTADOS DE VALIDACIÓN ===== */
    .form-input.is-valid {
        border-color: var(--gov-success);
        box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
    }

    .form-input.is-invalid {
        border-color: var(--gov-danger);
        box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    }

    /* ===== SPINNER ===== */
    .spinner {
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        border-top-color: white;
        animation: spin 1s linear infinite;
    }

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

    /* ===== ANIMACIONES ===== */
    @keyframes logoFullEnter {
        0% {
            opacity: 0;
            transform: translateY(-20px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .logo-wrapper {
        animation: logoFullEnter 1s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* ===== RESPONSIVE DESIGN ===== */
    @media (max-width: 1024px) {
        .login-container {
            grid-template-columns: 1fr;
            max-width: 450px;
            height: 90vh;
            max-height: 700px;
        }

        .info-panel {
            display: none;
        }

        .mobile-header {
            display: block;
        }
    }

    @media (max-width: 768px) {
        body {
            padding: 10px;
            overflow-y: auto;
        }

        .login-container {
            border-radius: 0;
            height: 100vh;
            max-height: none;
            box-shadow: none;
        }

        .form-panel {
            padding: 25px 20px;
        }

        .mobile-header {
            margin: 0;
        }

        .welcome-title {
            font-size: 24px;
        }

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

        /* Ajustes móvil para el logo */
        .mobile-logo {
            height: 100px;
            padding: 15px;
        }

        .mobile-logo img {
            max-width: 240px;
            height: 50px;
        }

        .mobile-title {
            font-size: 18px;
        }

        .mobile-subtitle {
            font-size: 11px;
        }

        /* Ajustes desktop para móvil */
        .logo-wrapper {
            height: 120px;
        }

        .logo-wrapper img {
            max-width: 280px;
            height: auto;
        }

        .institution-info h1 {
            font-size: 20px;
        }

        .institution-info p {
            font-size: 13px;
        }

        .features {
            padding: 15px 20px;
        }
    }
