/* css/estilos.css */
:root {
    --primary: #1e293b;
    --accent: #2563eb;
    --accent-ia: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #334155;
    --text-light: #64748b;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* HEADER Y NAVEGACIÓN */
.main-header, .dash-header {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.header-flex, .flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-area h1 { margin: 0; font-size: 1.8rem; letter-spacing: -0.5px; }
.tagline { margin: 0; font-size: 0.85rem; color: #94a3b8; }
.main-nav { display: flex; align-items: center; gap: 15px; }
.welcome-user { color: #cbd5e1; }

/* BOTONES */
.btn-primary, .btn-submit {
    background-color: var(--accent);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover, .btn-submit:hover { background-color: #1d4ed8; }
.btn-secondary { background: #475569; color: white; padding: 10px 20px; border-radius: 8px; text-decoration: none; }
.btn-logout { background-color: transparent; color: #f1f5f9; border: 1px solid #475569; padding: 8px 16px; border-radius: 8px; text-decoration: none; }
.btn-logout:hover { background: var(--danger); border-color: var(--danger); }

/* SECCIÓN IA (DIFERENCIAL) */
.ia-search-section { margin-bottom: 30px; }
.ia-search-card {
    background: linear-gradient(135deg, #1e1b4b, #311042);
    color: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.25);
}
.ia-search-box {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.ia-search-box input {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #4338ca;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1rem;
}
.ia-search-box input::placeholder { color: #a5b4fc; }
.btn-ia-action {
    background: linear-gradient(135deg, var(--accent-ia), #a855f7);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

/* ESTADOS DE LA IA */
.ia-status-hidden { display: none; }
.ia-status { padding: 12px; margin-top: 15px; border-radius: 8px; font-size: 0.95rem; }
.ia-status.procesando { background: rgba(255,255,255,0.1); color: #c084fc; border: 1px dashed var(--accent-ia); }
.ia-status.exito { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid var(--success); }
.ia-status.error { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid var(--danger); }

/* FILTROS CLÁSICOS */
.filters-card { background: var(--card-bg); padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 30px; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-light); }
.filter-group input, .filter-group select { padding: 10px; border-radius: 6px; border: 1px solid #cbd5e1; font-size: 0.95rem; }
.btn-search-manual { background: var(--primary); color: white; padding: 11px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }

/* GRID DE RESULTADOS */
.grid-emprendedores {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}
.card-emprendedor {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}
.card-header { padding: 20px; display: flex; gap: 15px; align-items: center; border-bottom: 1px solid #f1f5f9; }
.logo-emprendimiento { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background: #f1f5f9; }
.card-header h3 { margin: 0; font-size: 1.2rem; }
.badge { background: #dbeafe; color: #1e40af; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: bold; }
.badge-zona { font-size: 0.8rem; color: var(--text-light); display: block; margin-top: 2px; }
.card-body { padding: 20px; flex: 1; }
.descripcion { color: var(--text-dark); font-size: 0.95rem; margin: 0; }
.card-footer { padding: 15px 20px; background: #f8fafc; border-top: 1px solid #f1f5f9; display: flex; gap: 10px; }
.btn-visitar { flex: 1; background: #e2e8f0; color: var(--primary); text-align: center; text-decoration: none; padding: 8px; border-radius: 6px; font-size: 0.9rem; font-weight: 600; }
.btn-whatsapp { background: #25d366; color: white; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: 0.9rem; font-weight: 600; }

/* PANEL DE CONTROL / DASHBOARD */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
@media(max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }
.card-box { background: white; padding: 25px; border-radius: 12px; border: 1px solid #e2e8f0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group { margin-bottom: 15px; display: flex; flex-direction: column; gap: 5px; }
.form-group input, .form-group select, .form-group textarea { padding: 10px; border-radius: 6px; border: 1px solid #cbd5e1; }
.visitas-numero { font-size: 2.5rem; font-weight: bold; color: var(--accent); margin: 0; }
.visitas-numero span { font-size: 1rem; color: var(--text-light); }
.btn-qr { display: block; background: var(--accent-ia); color: white; text-align: center; padding: 12px; border-radius: 8px; text-decoration: none; font-weight: bold; }

/* ADMÍN TABLA */
.table-responsive { overflow-x: auto; margin-top: 20px; }
.table-admin { width: 100%; border-collapse: collapse; text-align: left; }
.table-admin th, .table-admin td { padding: 12px; border-bottom: 1px solid #e2e8f0; }
.table-admin th { background: #f1f5f9; }
.btn-table-delete { background: var(--danger); color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; }


/* ==========================================
   ESTILOS ESPECÍFICOS PARA LOGIN / REGISTRO
   ========================================== */

/* Fondo general de la página de login */
.auth-body {
    background-color: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Tarjeta contenedora compacta */
.auth-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 450px; /* Limita el ancho para que no se vea gigante */
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 30px;
    box-sizing: border-box;
}

/* Sistema de Pestañas (Tabs) */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 25px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; /* Sincroniza con el borde inferior */
}

.tab-btn:hover {
    color: var(--accent);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

/* Lógica de visibilidad de formularios */
.auth-form {
    display: none; /* Por defecto todos ocultos */
}

.auth-form.active {
    display: block; /* Solo el activo se muestra */
}

/* Inputs dentro del módulo Auth */
.auth-card .form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-card .form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.auth-card .form-group input {
    width: 100%;
    padding: 12px;
    box-sizing: border-box; /* Clave para que el padding no agrande el input */
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.auth-card .form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Botón de envío interno */
.auth-card .btn-submit {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}

/* Utilidades de texto */
.center {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.center a {
    color: var(--accent);
    text-decoration: none;
}

.center a:hover {
    text-decoration: underline;
}


/* ==========================================
   TARJETA DIGITAL / STAND DE EMPRENDEDOR
   ========================================== */
.stand-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.stand-card {
    background: var(--card-bg, #ffffff);
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Encabezado */
.stand-header {
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 15px;
}

.stand-badge {
    display: inline-block;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent, #2563eb);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stand-title {
    font-size: 1.6rem;
    color: var(--text, #1e293b);
    margin: 0 0 8px 0;
    font-weight: 800;
}

.stand-zone {
    font-size: 0.95rem;
    color: var(--text-light, #64748b);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Descripción */
.stand-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #475569;
    margin: 0;
}

/* Sección Interactiva (QR y Acciones) */
.stand-interactive {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

@media (max-width: 480px) {
    .stand-interactive {
        flex-direction: column;
        text-align: center;
    }
}

/* Código QR */
.qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

#qrcode {
    width: 120px;
    height: 120px;
    background: #eceff1; /* Placeholder visual inicial */
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-text {
    font-size: 0.7rem;
    color: #94a3b8;
    margin: 0;
    font-weight: 600;
}

/* Acciones y Métricas */
.stand-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: transform 0.2s;
}

.btn-action:active {
    transform: scale(0.98);
}

.btn-whatsapp {
    background: #25d366;
    color: #ffffff;
}

.stand-metrics {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    margin-top: 5px;
}