/* Optimizaciones para Core Web Vitals */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Preload critical fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    /* Optimización para CLS */
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Optimización para LCP */
    contain: layout style paint;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    /* Optimización para CLS */
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    /* Optimización para CLS */
    height: 60px;
}

.logo i {
    font-size: 2.5rem;
    color: #4fc3f7;
    /* Optimización para CLS */
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    /* Optimización para CLS */
    line-height: 1.2;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    /* Optimización para CLS */
    min-height: 1.5rem;
}

.qr-generator {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    /* Optimización para CLS */
    contain: layout style;
}

.qr-form {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    gap: 25px;
    /* Optimización para CLS */
    contain: layout style paint;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    /* Optimización para CLS */
    contain: layout style;
}

.form-group textarea:focus {
    outline: none;
    border-color: #4fc3f7;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}

.generate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    /* Optimización para CLS */
    contain: layout style;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 195, 247, 0.3);
}

.qr-result {
    width: 100%;
    max-width: 400px;
    transition: all 0.5s ease;
    /* Optimización para CLS */
    contain: layout style paint;
}

.qr-result.hidden {
    display: none;
}

.qr-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    /* Optimización para CLS */
    contain: layout style paint;
}

.qr-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    /* Optimización para CLS */
    height: 60px;
}

.qr-header i {
    font-size: 2rem;
    color: #4fc3f7;
    /* Optimización para CLS */
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-header h2 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
    /* Optimización para CLS */
    line-height: 1.2;
}

.qr-image {
    margin: 0 auto 24px auto;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 16px;
    border: 2px solid #e1e5e9;
    /* Optimización para CLS */
    contain: layout style paint;
}

.download-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Optimización para CLS */
    contain: layout style;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 195, 247, 0.3);
}

/* Optimizaciones para móviles */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        margin-bottom: 30px;
        min-height: 100px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .qr-form {
        padding: 30px 20px;
        margin: 0 10px;
    }
    
    .qr-card {
        padding: 30px 20px;
    }
    
    .qr-image {
        width: 200px;
        height: 200px;
    }
}

/* Optimizaciones para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .qr-form {
        max-width: 600px;
    }
    
    .qr-result {
        max-width: 500px;
    }
}

/* Optimizaciones para pantallas grandes */
@media (min-width: 1025px) {
    .container {
        padding: 30px;
    }
    
    .qr-form {
        max-width: 600px;
    }
    
    .qr-result {
        max-width: 500px;
    }
}

/* Optimizaciones para accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Optimizaciones para modo oscuro */
@media (prefers-color-scheme: dark) {
    .qr-form,
    .qr-card {
        /* background: #1a1a1a; */
        color: #fff;
    }
    
    .form-group textarea {
        background: #f8f9fa;
        color: #333;
        border-color: #e1e5e9;
    }
    
    .qr-image {
        background: #2a2a2a;
        border-color: #444;
    }
}

/* Optimizaciones para impresión */
@media print {
    .generate-btn,
    .download-btn {
        display: none;
    }
    
    .qr-form {
        box-shadow: none;
        border: 1px solid #ccc;
    }
} 