/* Importar fuente Designer */
@font-face {
    font-family: 'Designer';
    src: url('fonts/Designer.otf') format('opentype');
}

/* Variables de colores */
:root {
    --color-blue: #2196F3;
    --color-green: #4CAF50;
    --color-purple: #9C27B0;
    --color-orange: #FF9800;
    --color-red: #f44336;
    --color-background: #2a2a2a;
}

/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-background);
    min-height: 100vh;
    position: relative;
}

/* Fondo con líneas oblicuas y gradiente */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent 0,
            transparent 10px,
            rgba(255, 255, 255, 0.03) 10px,
            rgba(255, 255, 255, 0.03) 20px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent 0,
            transparent 10px,
            rgba(255, 255, 255, 0.03) 10px,
            rgba(255, 255, 255, 0.03) 20px
        ),
        linear-gradient(
            135deg,
            #1a1a1a 0%,
            #2a2a2a 50%,
            #3a3a3a 100%
        );
    z-index: -1;
}

/* Encabezado */
header {
    background: rgba(255, 255, 255, 0.85);
    padding: 0.7rem;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    z-index: 100;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
}

.escudo {
    width: clamp(45px, 12vw, 60px); /* Responsivo: mínimo 45px, máximo 60px */
    height: clamp(45px, 12vw, 60px);
    object-fit: contain;
    transition: all 0.3s ease;
    cursor: pointer;
    max-width: 100%;
}

.escudo:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.2));
}

.escudo-dud {
    animation: fadeInLeft 0.5s ease-out;
}

.escudo-daip {
    animation: fadeInRight 0.5s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

h1 {
    font-family: 'Designer', sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem); /* Responsivo: mínimo 1.5rem, máximo 3rem */
    color: #333;
    text-align: center;
    line-height: 1.2;
    word-wrap: break-word;
    hyphens: auto;
}

/* Dashboard principal */
.dashboard {
    display: none; /* Oculto por defecto */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Tarjetas */
.card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-blue);
    transition: transform 0.3s ease;
    transform: scaleX(0);
    transform-origin: left;
}

.card[data-color="blue"]::before { background: var(--color-blue); }
.card[data-color="green"]::before { background: var(--color-green); }
.card[data-color="purple"]::before { background: var(--color-purple); }
.card[data-color="orange"]::before { background: var(--color-orange); }
.card[data-color="red"]::before { background: var(--color-red); }

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.97);
}

.card:hover::before {
    transform: scaleX(1);
}

.card i {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card:hover i {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card[data-color="blue"] i { color: var(--color-blue); }
.card[data-color="green"] i { color: var(--color-green); }
.card[data-color="purple"] i { color: var(--color-purple); }
.card[data-color="orange"] i { color: var(--color-orange); }
.card[data-color="red"] i { color: var(--color-red); }

.card h2 {
    font-family: 'Designer', sans-serif;
    font-size: 1.1rem;
    color: #2a2a2a;
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
    min-height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-acceder {
    background: transparent;
    color: #2a2a2a;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    border: 2px solid;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.card[data-color="blue"] .btn-acceder { border-color: var(--color-blue); color: var(--color-blue); }
.card[data-color="green"] .btn-acceder { border-color: var(--color-green); color: var(--color-green); }
.card[data-color="purple"] .btn-acceder { border-color: var(--color-purple); color: var(--color-purple); }
.card[data-color="orange"] .btn-acceder { border-color: var(--color-orange); color: var(--color-orange); }
.card[data-color="red"] .btn-acceder { border-color: var(--color-red); color: var(--color-red); }

.btn-acceder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: currentColor;
    opacity: 0.1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.btn-acceder:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.btn-acceder:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Pie de página */
footer {
    text-align: center;
    padding: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    z-index: 99;
}

footer p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

footer .copyright {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}

footer .copyright::before {
    content: '©';
    margin-right: 0.3rem;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Ajuste para el contenido principal para que no se oculte detrás del footer */
main.dashboard {
    margin-bottom: 4rem;
}

/* Modal de Login */
.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    visibility: hidden;
}

.modal.show {
    visibility: visible;
    opacity: 1;
    animation: modalFadeIn 0.3s ease forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    width: 100%;
    max-width: 400px;
    margin: auto;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

.modal-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #3a3a3a 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.modal-logos {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.modal-escudo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.login-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
    outline: none;
}

.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.toggle-password:hover {
    color: #333;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--color-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.form-footer {
    margin-top: 2rem;
}

.form-links {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.form-links a {
    color: var(--color-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.form-links a:hover {
    color: #1976D2;
    text-decoration: underline;
}

.status-message {
    padding: 1rem;
    margin: 1rem;
    border-radius: 8px;
    display: none;
    text-align: center;
}

.status-message.error {
    background: #ffebee;
    color: #c62828;
    display: block;
}

.status-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    display: block;
}

/* Diseño responsivo */
@media (max-width: 1400px) {
    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.25rem;
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.8rem;
        gap: 0.6rem;
    }

    h1 {
        font-size: 1.2rem;
    }

    .escudo {
        width: 38px;
        height: 38px;
    }

    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .card i {
        font-size: 2rem;
        padding: 0.8rem;
    }

    .card h2 {
        font-size: 1rem;
        min-height: 2.4rem;
    }

    .btn-acceder {
        padding: 0.5rem 1.2rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.6rem;
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    h1 {
        font-size: 1.1rem;
        order: -1;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .escudo {
        width: 34px;
        height: 34px;
    }

    .dashboard {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
    }

    .card {
        padding: 1.2rem;
    }

    .card i {
        font-size: 1.8rem;
        padding: 0.7rem;
    }
}
/* ===== OPTIMIZACIONES ADICIONALES DE RESPONSIVIDAD ===== */

/* Mejoras para el título en diferentes tamaños */
@media (max-width: 768px) {
    h1 {
        font-size: clamp(1.2rem, 3.5vw, 1.8rem);
        padding: 0 0.5rem;
    }
    
    .escudo {
        width: clamp(38px, 10vw, 45px);
        height: clamp(38px, 10vw, 45px);
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: clamp(1.1rem, 3vw, 1.4rem);
        padding: 0 0.3rem;
        line-height: 1.3;
    }
    
    .escudo {
        width: clamp(34px, 8vw, 40px);
        height: clamp(34px, 8vw, 40px);
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 360px) {
    h1 {
        font-size: 1rem;
        padding: 0 0.2rem;
    }
    
    .escudo {
        width: 30px;
        height: 30px;
    }
}

/* Para pantallas grandes */
@media (min-width: 1200px) {
    h1 {
        font-size: clamp(2.5rem, 3.5vw, 3rem);
    }
    
    .escudo {
        width: clamp(50px, 15vw, 60px);
        height: clamp(50px, 15vw, 60px);
    }
}

/* Para pantallas extra grandes */
@media (min-width: 1600px) {
    h1 {
        font-size: 3rem;
    }
    
    .escudo {
        width: 60px;
        height: 60px;
    }
}
/* ===== OPTIMIZACIONES ESPECÍFICAS PARA PANTALLAS VERTICALES ===== */

/* Para móviles en portrait (altura > ancho) */
@media (max-width: 480px) and (orientation: portrait) {
    h1 {
        font-size: clamp(0.9rem, 2.5vw, 1.2rem) !important;
        line-height: 1.1 !important;
        padding: 0 0.2rem !important;
        word-break: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
    }
    
    .escudo {
        width: clamp(28px, 7vw, 35px) !important;
        height: clamp(28px, 7vw, 35px) !important;
        margin: 0.3rem auto !important;
    }
    
    header {
        padding: 0.4rem !important;
        gap: 0.3rem !important;
        flex-direction: column !important;
        text-align: center !important;
    }
}

/* Para móviles muy pequeños en portrait */
@media (max-width: 360px) and (orientation: portrait) {
    h1 {
        font-size: 0.8rem !important;
        line-height: 1.0 !important;
        padding: 0 0.1rem !important;
    }
    
    .escudo {
        width: 25px !important;
        height: 25px !important;
    }
    
    header {
        padding: 0.3rem !important;
        gap: 0.2rem !important;
    }
}

/* Para tablets en portrait */
@media (min-width: 481px) and (max-width: 768px) and (orientation: portrait) {
    h1 {
        font-size: clamp(1.0rem, 3vw, 1.5rem) !important;
        line-height: 1.2 !important;
        padding: 0 0.4rem !important;
    }
    
    .escudo {
        width: clamp(35px, 9vw, 42px) !important;
        height: clamp(35px, 9vw, 42px) !important;
    }
}

/* Para pantallas altas y estrechas (móviles grandes en portrait) */
@media (min-height: 700px) and (max-width: 480px) {
    h1 {
        font-size: clamp(1.0rem, 2.8vw, 1.3rem) !important;
        margin: 0.3rem 0 !important;
    }
    
    .escudo {
        width: clamp(30px, 8vw, 38px) !important;
        height: clamp(30px, 8vw, 38px) !important;
    }
/* ===== OPTIMIZACIONES ESPECÍFICAS PARA PANTALLAS VERTICALES ===== */

/* Para móviles en portrait (altura > ancho) */
@media (max-width: 480px) and (orientation: portrait) {
    h1 {
        font-size: clamp(0.9rem, 2.5vw, 1.2rem) !important;
        line-height: 1.1 !important;
        padding: 0 0.2rem !important;
        word-break: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
    }
    
    .escudo {
        width: clamp(28px, 7vw, 35px) !important;
        height: clamp(28px, 7vw, 35px) !important;
        margin: 0.3rem auto !important;
    }
    
    header {
        padding: 0.4rem !important;
        gap: 0.3rem !important;
        flex-direction: column !important;
        text-align: center !important;
    }
}

/* Para móviles muy pequeños en portrait */
@media (max-width: 360px) and (orientation: portrait) {
    h1 {
        font-size: 0.8rem !important;
        line-height: 1.0 !important;
        padding: 0 0.1rem !important;
    }
    
    .escudo {
        width: 25px !important;
        height: 25px !important;
    }
    
    header {
        padding: 0.3rem !important;
        gap: 0.2rem !important;
    }
}

/* Para tablets en portrait */
@media (min-width: 481px) and (max-width: 768px) and (orientation: portrait) {
    h1 {
        font-size: clamp(1.0rem, 3vw, 1.5rem) !important;
        line-height: 1.2 !important;
        padding: 0 0.4rem !important;
    }
    
    .escudo {
        width: clamp(35px, 9vw, 42px) !important;
        height: clamp(35px, 9vw, 42px) !important;
    }
}

/* Para pantallas altas y estrechas (móviles grandes en portrait) */
@media (min-height: 700px) and (max-width: 480px) {
    h1 {
        font-size: clamp(1.0rem, 2.8vw, 1.3rem) !important;
        margin: 0.3rem 0 !important;
    }
    
    .escudo {
        width: clamp(30px, 8vw, 38px) !important;
        height: clamp(30px, 8vw, 38px) !important;
    }
}

