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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    font-size: 16px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    padding: 12px 24px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 15px;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.help-text {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #999;
}

/* ============================================
   LOGOS
   ============================================ */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo-main {
    max-width: 180px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    animation: fadeInDown 0.8s ease-out;
}

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

/* ============================================
   HEADER DE LA APP
   ============================================ */
.app-header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
}

.app-header h1 {
    color: #667eea;
    font-size: 24px;
    margin-bottom: 5px;
}

.app-header .subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.btn-logout {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c0392b;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================
   TARJETAS (CARDS)
   ============================================ */
.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.card h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 20px;
}

/* ============================================
   SELECTOR DE ELECTRODOMÉSTICOS
   ============================================ */
.appliance-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.btn-appliance {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-appliance:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-appliance.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.5);
}

.appliance-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.appliance-name {
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.btn-appliance small {
    font-size: 12px;
    opacity: 0.9;
    display: block;
}

.selection-indicator {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    margin-top: 10px;
}

/* ============================================
   FORMULARIO DE DIAGNÓSTICO
   ============================================ */
#diagnosticForm .btn-primary {
    margin-top: 10px;
}

/* ============================================
   SECCIÓN DE RESULTADOS
   ============================================ */
#resultSection {
    animation: fadeInDown 0.5s ease-out;
}

.result-content {
    line-height: 1.8;
    color: #333;
    font-size: 16px;
    margin: 20px 0;
}

.result-content h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
}

.result-content p {
    margin-bottom: 15px;
}

.result-content ul,
.result-content ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.result-content li {
    margin-bottom: 8px;
}

/* ============================================
   BOTÓN DE VOZ
   ============================================ */
.btn-voice-simple {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 15px;
}

.btn-voice-simple:hover {
    background: #5568d3;
}

.btn-voice-simple.playing {
    background: #f5576c;
}

.voice-icon-simple {
    font-size: 18px;
}

/* ============================================
   LOADING
   ============================================ */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-top: 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .app-header h1 {
        font-size: 20px;
    }
    
    .appliance-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 15px;
    }
    
    .app-header {
        padding: 15px;
    }
    
    .btn-logout {
        position: static;
        margin-bottom: 10px;
    }
    
    .logo-main {
        max-width: 140px;
    }
    
    .appliance-selector {
        grid-template-columns: 1fr;
    }
    
    .appliance-icon {
        font-size: 28px;
    }
}
