/* ============================================================
   GENERADOR DE QR — estilos propios
   Reutiliza variables de index.css y patrones de forms.css
   ============================================================ */

.qr-wrapper { max-width: 800px; }

/* --- Tabs de tipo de contenido --- */
.qr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.qr-tab {
    padding: 0.55rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}

.qr-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.qr-tab.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* --- Body: dos columnas --- */
.qr-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 620px) {
    .qr-body { grid-template-columns: 1fr; }
}

/* --- Panels de formulario --- */
.qr-panel { display: none; }
.qr-panel.is-active { display: block; }

.qr-optional {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Normalizar todos los inputs y textarea del generador al mismo estilo
   que input[type="url"] de forms.css (que no cubre text/password/email/tel) */
.qr-controls input[type="text"],
.qr-controls input[type="password"],
.qr-controls input[type="email"],
.qr-controls input[type="tel"],
.qr-controls textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background-color: var(--bg-color);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    transition: border-color 0.2s;
    outline: none;
    resize: vertical;
}

.qr-controls input[type="text"]:focus,
.qr-controls input[type="password"]:focus,
.qr-controls input[type="email"]:focus,
.qr-controls input[type="tel"]:focus,
.qr-controls textarea:focus {
    border-color: var(--primary);
}

/* --- Opciones de personalización --- */
.qr-options {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.qr-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.qr-option-row label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
    flex-shrink: 0;
}

.qr-option-row input[type="color"] {
    width: 44px;
    height: 36px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 2px 4px;
    cursor: pointer;
    background: transparent;
    flex-shrink: 0;
}

.qr-size-row { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.qr-size-row input[type="range"] { width: 100%; }

/* --- Preview / Vista previa --- */
.qr-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}

.qr-canvas-wrap {
    width: 100%;
    aspect-ratio: 1;
    max-width: 300px;
    border: 2px dashed var(--gray-200);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
    transition: border-color 0.2s;
}

.qr-canvas-wrap:has(canvas[style*="display: block"]) {
    border-style: solid;
    border-color: var(--primary);
    background: #fff;
}

#qr-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 8px;
}

.qr-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

.qr-empty-icon { font-size: 2rem; opacity: 0.5; }

/* --- Botones de descarga --- */
.qr-download-actions {
    display: flex;
    gap: 0.6rem;
    width: 100%;
    max-width: 300px;
}

.qr-download-actions .btn-download,
.qr-download-actions .btn-restart {
    flex: 1;
    padding: 0.7rem 0.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
