:root {
    --primary-color: #007bff;
    --whatsapp-color: #25D366;
    --danger-color: #dc3545;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --border-color: #dee2e6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    min-height: 100vh; background-color: var(--light-gray); margin: 0; padding: 40px 20px;
}

/* --- ESTILOS DEL ENCABEZADO MEJORADOS --- */
.page-header { text-align: center; margin-bottom: 40px; max-width: 950px; width: 100%; position: relative; }

.page-header h1 { 
    font-size: 2.8rem; 
    color: var(--dark-gray); 
    margin-bottom: 5px; /* Reducido para juntar con el subtítulo */
}

.page-header p { font-size: 1.2rem; color: #6c757d; margin-top: 0; }

/* Contenedor de la instrucción "Primero selecciona..." */
.instruction-badge {
    margin-top: 25px;
    margin-bottom: 15px;
}

/* Estilo del texto "Primero selecciona..." */
.instruction-badge h2 {
    font-size: 1rem; /* Tamaño discreto y elegante */
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin: 0;
}

/* Botón de Tutorial Moderno */
.tutorial-btn {
    background-color: #6f42c1; 
    color: white; 
    border: none; 
    padding: 10px 24px; /* Más grande para fácil clic */
    border-radius: 50px; /* Forma de cápsula completa */
    cursor: pointer; 
    font-size: 0.95rem; 
    font-weight: 600;
    margin-top: 10px; 
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3); /* Sombra suave */
    transition: all 0.2s ease; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px;
}

.tutorial-btn:hover { 
    background-color: #5a32a3; 
    transform: translateY(-2px); /* Efecto de elevación */
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
}

/* --- CONTENEDOR PRINCIPAL --- */
.container {
    background: white; padding: 30px; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.1); width: 100%; max-width: 950px; display: flex; gap: 40px; flex-wrap: wrap;
}

.controls-panel, .preview-panel { flex: 1; min-width: 320px; }

.preview-panel {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; background-color: #fdfdff; padding: 20px; border-radius: 12px; border: 1px solid var(--border-color);
}

.controls-panel h2 {
    color: var(--dark-gray); text-align: left; font-size: 1.8em; margin-top: 0; margin-bottom: 25px; border-bottom: 2px solid var(--primary-color); padding-bottom: 10px;
}

.preview-panel h2 { font-size: 1.5em; margin-bottom: 20px; color: var(--dark-gray); }

/* --- INPUTS Y FORMULARIOS --- */
.input-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 500; color: #555; }

input[type="url"], input[type="text"], input[type="tel"], input[type="file"], select, textarea {
    width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; box-sizing: border-box; font-size: 16px; transition: border-color 0.2s; background-color: white;
}

input:focus, select:focus, textarea:focus { border-color: var(--primary-color); outline: none; }

/* --- SELECTOR DE ICONOS --- */
#icon-selector { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
#icon-selector input[type="radio"] { display: none; }
#icon-selector label { cursor: pointer; padding: 5px; border: 2px solid transparent; border-radius: 8px; transition: all 0.2s ease; }
#icon-selector img { width: 40px; height: 40px; vertical-align: middle; }
#icon-selector input[type="radio"]:checked + label { border-color: var(--primary-color); background-color: #eaf2ff; }
#icon-selector input[id="icon-whatsapp"]:checked + label { border-color: var(--whatsapp-color); background-color: #e0f8e7; }

/* --- OPCIONES WHATSAPP --- */
#whatsapp-options { background-color: #f0fff4; border: 1px solid #cce8d6; padding: 15px; border-radius: 8px; margin-top: 15px; }
.phone-input-container { display: flex; gap: 10px; }
.phone-input-container select { flex: 0 0 130px; }
.phone-input-container input { flex: 1; }

/* --- BOTONES DE ACCIÓN --- */
#clear-logo-btn { display: none; width: 100%; padding: 8px; margin-top: 10px; background: transparent; color: var(--danger-color); border: 1px solid var(--danger-color); border-radius: 8px; font-size: 14px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
#clear-logo-btn:hover { background: var(--danger-color); color: white; }

#qr-canvas { 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    background: white; 
    max-width: 100%; 
    height: auto; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

#download-btn { width: 100%; padding: 14px; background-color: #28a745; color: white; border: none; border-radius: 8px; font-size: 18px; font-weight: bold; cursor: pointer; transition: background-color 0.3s; margin-top: 20px; }
#download-btn:hover { background-color: #218838; }
#download-btn:disabled { background-color: #ccc; cursor: not-allowed; }

/* --- DRIVER.JS (TUTORIAL) --- */
.driver-popover.driverjs-theme {
    background-color: white; color: #333; border-radius: 10px; padding: 15px;
}
.driver-popover-title { font-weight: bold; font-size: 18px; color: var(--primary-color); }
.driver-popover-description { font-size: 14px; line-height: 1.5; margin-top: 5px; }

/* --- RESPONSIVE --- */
@media (max-width: 820px) {
    .container { flex-direction: column; } .controls-panel h2 { text-align: center; } .page-header h1 { font-size: 2.2rem; } .page-header p { font-size: 1.1rem; }
}