:root {
    --bg: #121214; 
    --panel: #222228; 
    --accent: #00d2d3;
    --text: #e0e0e0; 
    --border: #333; 
    --noise-accent: #ff9f43;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg); 
    color: var(--text);
    display: flex; 
    flex-direction: column; 
    align-items: center;
    padding: 10px; 
    margin: 0; 
    min-height: 100vh;
}

h1 { 
    color: var(--accent); 
    margin: 10px 0; 
    font-size: 1.5rem;
}

#rta-canvas { 
    background: #050505; 
    border-radius: 4px; 
    display: block; 
}

.synth-rack {
    display: grid; 
    grid-template-columns: repeat(4, 1fr);
    gap: 15px; 
    max-width: 1200px; 
    margin-bottom: 20px;
}

.module {
    background: var(--panel); 
    border: 1px solid var(--border);
    border-radius: 8px; 
    padding: 15px; 
    display: flex; 
    flex-direction: column; 
    gap: 8px;
}

.module.noise { border-color: var(--noise-accent); }
.module h3 { margin: 0; font-size: 1.1rem; border-bottom: 1px solid var(--border); padding-bottom: 5px; color: var(--accent); }
.module.noise h3 { color: var(--noise-accent); }
.module h4 { margin: 5px 0 0 0; font-size: 0.9rem; color: #888; }

label { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; }
input[type="range"] { width: 55%; cursor: pointer; accent-color: var(--accent); }
.module.noise input[type="range"] { accent-color: var(--noise-accent); }
select { background: #111; color: white; border: 1px solid #444; padding: 2px; font-size: 0.75rem; width: 55%;}

.piano-wrapper { background: #111; padding: 10px; border-radius: 8px; overflow-x: auto; }
.piano { position: relative; display: flex; height: 140px; width: 675px; }

.key {
    border: 1px solid #333; border-radius: 0 0 4px 4px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    padding-bottom: 5px; user-select: none;
}

.white { width: 45px; height: 100%; background: #f0f0f0; color: #333; z-index: 1; }
.white.active { background: #d1d8e0; border-top: 4px solid var(--accent); }
.black { width: 30px; height: 60%; background: #111; color: #fff; position: absolute; z-index: 2; border: 1px solid #000; }
.black.active { background: var(--accent); color: #000; }

.label { font-weight: bold; font-size: 0.8rem; pointer-events: none;}
.bind { font-size: 0.6rem; color: #888; pointer-events: none; margin-top: 3px; }
.key.active .bind { color: #fff; }

/* --- UTILIDAD PARA OCULTAR ELEMENTOS --- */
.hidden {
    display: none !important;
}

/* --- ESTILOS DE LA PANTALLA DE AUTENTICACIÓN --- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.auth-card {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-card h2 {
    margin: 0 0 15px 0;
    color: var(--accent);
    text-align: center;
    border-bottom: none;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-card input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    background: #111;
    border: 1px solid #444;
    color: white;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 5px;
}

.auth-card button {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.auth-card button:hover {
    background: #00b8b9;
}
/* --- ESTILO RECUPERAR CONTRASEÑA --- */
.forgot-text {
    font-size: 0.8rem;
    color: var(--accent);
    text-align: right;
    cursor: pointer;
    margin-top: -10px;
    margin-bottom: 5px;
    transition: color 0.3s;
}

.forgot-text:hover {
    text-decoration: underline;
    color: #00b8b9;
}
.toggle-text {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-top: 10px;
}

.toggle-text span {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}

/* Ajuste para que la app del synth ocupe bien el espacio cuando se muestre */
#synth-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
/* --- ESTILOS SOCIAL LOGIN --- */
.divider {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin: 5px 0;
    position: relative;
}
.divider::before, .divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #444;
}
.divider::before { left: 0; }
.divider::after { right: 0; }

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff !important; /* Sobrescribe el fondo oscuro */
    color: #333 !important;
    border: 1px solid #ccc !important;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}
.social-btn:hover {
    background: #f1f1f1 !important;
}

/* --- ESTILOS DEL MASTER Y HEADER DEL MÓDULO --- */
.master-section {
    background: #1a1a20;
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 10px 20px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 300px;
}

.master-section label {
    font-size: 1rem;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 5px;
}

.master-section input[type="range"] {
    width: 100%;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

.module-header h3 {
    border: none !important;
    padding: 0 !important;
    margin: 0;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    background: #333;
    padding: 2px 8px;
    border-radius: 12px;
}

/* --- ESTILOS DE LOS VISUALIZADORES --- */
.visualizers-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
}

.canvas-container {
    background: #000;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 5px;
    position: relative;
}

.canvas-container canvas {
    background: #050505;
    border-radius: 4px;
    display: block;
    width: 100%;
}
.switch-label input {
    accent-color: var(--accent);
    cursor: pointer;
}

/* --- ESTILOS DE PESTAÑAS PARA LOS MÓDULOS --- */
.module-tabs {
    display: flex;
    gap: 4px;
    margin: 10px 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

.tab-btn {
    background: #151518;
    color: #777;
    border: 1px solid var(--border);
    border-radius: 4px 4px 0 0;
    padding: 6px 4px;
    font-size: 0.72rem;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.tab-btn:hover {
    color: #fff;
    background: #1c1c22;
}

.tab-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Modificación de color activo para la pestaña del generador de ruido */
.module.noise .tab-btn.active {
    background: var(--noise-accent);
    border-color: var(--noise-accent);
    color: #000;
}

.tab-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 145px; /* Mantiene la consistencia de altura del rack */
}

/* --- SUB-PESTAÑAS DE FX --- */
.fx-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
    background: #0a0a0c;
    border-radius: 4px;
    padding: 2px;
}

.fx-tab-btn {
    background: transparent;
    color: #666;
    border: none;
    border-radius: 2px;
    padding: 4px 2px;
    font-size: 0.65rem;
    cursor: pointer;
    flex: 1;
    font-weight: bold;
    transition: all 0.2s;
}

.fx-tab-btn:hover { color: #aaa; }
.fx-tab-btn.active {
    background: #333;
    color: var(--accent);
}

.fx-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 5px;
    background: #151518;
    border-radius: 4px;
    border: 1px solid #222;
}

/* --- ESTILOS DE ESTUDIO PROFESIONAL --- */
:root {
    --bg-dark: #0f0f12;
    --panel-dark: #1a1a1f;
    --border: #333;
    --cyan: #00d2d3;
    --orange: #ff9f43;
}

body {
    background: var(--bg-dark);
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
}

.module {
    background: var(--panel-dark);
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border-radius: 8px;
    padding: 10px;
}

/* Inputs de rango tipo "Hardware" */
input[type=range] {
    -webkit-appearance: none;
    background: #000;
    height: 6px;
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--cyan);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px var(--cyan);
}

/* Efecto Glassmorphism para Login */
.auth-card {
    background: rgba(25, 25, 30, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 15px;
}
