/* =========================
   LOGIN Y REGISTRO
   ========================= */
#authSection,
#registerSection {
  display: none;              /* El JS decide cuál se muestra */
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #4F35F9;
  padding: 1rem;
  padding-top: 50px;
}

.card-box {
  background-color: rgba(255, 255, 255, 0.92);
  padding: 2rem;
  border-radius: 12px;
  max-width: 400px;
  margin: auto;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

/* Títulos login/registro */
#authSection h2,
#registerSection h2 {
  text-align: center;
  color: #4F35F9;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-family: sans-serif;
}

/* Inputs */
input.form-control {
  font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus,
.form-select:focus,
.form-control:focus {
  border-color: #4F35F9 !important;
  box-shadow: 0 0 0 0.2rem rgba(79, 53, 249, 0.25) !important;
}

/* Botones login/registro */
#authSection .btn,
#registerSection .btn {
  font-size: 1.1rem;
  padding: 0.6rem;
}

/* =========================
   BOTONES GENERALES
   ========================= */
.btn-primary {
  background-color: #4F35F8;
  border-color: #f0f8ff;
}
.btn-primary:hover {
  background-color: #f0f8ff;
  border-color: #4F35F8;
  color: #4F35F8;
}

.btn-success {
  background-color: #4F35F8;
  border-color: #4F35F8;
}
.btn-success:hover {
  background-color: #f0f8ff;
  color: #4F35F8;
  border-color: #4F35F8;
}

.btn-secondary {
  background-color: #ffc107;
  color: #000;
  border-color: #f0f8ff;
  margin-top: 15px;
}

.btn-outline-primary {
  border-color: #4F35F8;
  color: #4F35F8;
}
.btn-outline-primary:hover {
  background-color: #4F35F8;
  color: #f0f8ff;
}

.btn-outline-secondary {
  border-color: #4F35F8;
  color: #4F35F8;
}
.btn-outline-secondary:hover {
  background-color: #4F35F8;
  color: #f0f8ff;
}

/* =========================
   DASHBOARD (APP)
   ========================= */
#appSection {
  display: none;              /* El JS lo muestra al loguearse */
  background-color: #f0f8ff;  /* Azul pastel claro */
  padding-top: 1rem;
  padding-bottom: 1rem;
  min-height: 100vh;
}

#appSection .card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
  color: #4F35F8;
}

/* Botón cerrar sesión en rojo suave */
#appSection .btn-danger {
  background-color: #ff6b6b;
  border-color: #ff6b6b;
}
#appSection .btn-danger:hover {
  background-color: #f0f8ff;
  border-color: #ff4c4c;
  color: #ff4c4c;
}

/* Título principal */
#appSection h1 {
  font-weight: bold;
  color: #4F35F8;
}

/* Subtítulo comercio */
#comercioNombre {
  font-size: 0.95rem;
  color: #6c757d;
}

/* Tablas */
#appSection table {
  font-size: 0.95rem;
}
#appSection th {
  background-color: #4f35f9 !important;
  color: #f0f8ff;
}

/* Logo */
.logo-img {
  max-width: 150px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.container {
  max-width: 1400px;
}

/* =========================
   PASSWORD INPUT (OJO)
   ========================= */
.input-password-container {
  position: relative;
}
.input-password-container input {
  height: 48px;
  padding-right: 40px;
}
.input-password-container button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* =========================
   MODAL DE ERROR PRIORITARIO
   ========================= */
#errorModal {
  z-index: 2000 !important;
}
#errorModal .modal-dialog {
  z-index: 2001 !important;
  position: relative;
}
.modal-backdrop.show {
  z-index: 1050 !important;
}

/* Botón Venko genérico */
.btn-venko {
  background-color: #7f6afc;
  color: white;
  border: none;
  transition: background-color 0.3s, transform 0.2s;
}
.btn-venko:hover {
  background-color: #624ec9;
  transform: translateY(-2px);
  color: white;
}
.btn-venko:active {
  background-color: #5039b5;
  transform: translateY(0);
}

/* Botones info / warning (pequeños ajustes) */
.btn-info {
  color: #f0f8ff;
}
.btn-info:hover {
  background-color: #f0f8ff;
  transform: translateY(-2px);
  color: #0DCAF0;
}
.btn-warning {
  color: #f0f8ff;
}
.btn-warning:hover {
  background-color: #f0f8ff;
  transform: translateY(-2px);
  color: #ffc107;
}

/* BOTONES UNIFORMES PARA CARRITO */
.btn-carrito {
  width: 100%;
  max-width: 180px;
  padding: 10px 16px !important;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
@media (max-width: 576px) {
  .btn-carrito {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* RESPONSIVE login/register fondo móvil */
@media (max-width: 768px) {
  body {
    background-image: url('fondo-movil.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  #authSection,
  #registerSection {
    background-image: url('fondo-movil.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  .card-box {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  }
}

/* Evitar desbordes en formularios/tablas en móvil */
@media (max-width: 576px) {
  .row.g-2 > .col-md-4,
  .row.g-2 > .col-md-2,
  .row.g-2 > .form-group {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .input-group {
    flex-wrap: wrap;
  }

  .input-group .form-control {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .input-group .btn {
    width: 100%;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .table thead,
  .table tbody,
  .table th,
  .table td,
  .table tr {
    white-space: nowrap;
  }
}

/* ============================
   BOTÓN DE LOGOUT – FIX TOTAL
   ============================ */

/* Ocultar logout en login y registro */
#authSection #logoutBtn,
#registerSection #logoutBtn {
  display: none !important;
}

/* Mostrar solo dentro de la app */
#appSection .logout-container #logoutBtn {
  display: inline-block !important;
  position: absolute;
  top: 20px;
  right: 30px;
  z-index: 9999;
}

/* Asegura que el header sea punto de referencia */
#appHeader {
  position: relative;
}

body, #appSection {
  background: #EEF1FF !important;
  font-family: 'Poppins', sans-serif;
}


/* 🌟 Tarjetas estilo Neo */
.card {
  background: #F8F9FF !important;
  border-radius: 18px !important;
  box-shadow: 
      9px 9px 18px #c5cae9,
      -9px -9px 18px #ffffff;
  border: none !important;
}


/* 🌟 Inputs hundidos */
.form-control {
  background: #F8F9FF !important;
  border-radius: 12px !important;
  border: none !important;
  box-shadow: inset 4px 4px 8px #c5cae9,
              inset -4px -4px 8px #ffffff;
}

.form-control:focus {
  outline: none;
  box-shadow: inset 3px 3px 6px #c5cae9,
              inset -3px -3px 6px #ffffff;
}

/* 🌟 Botón primario Venko */
.btn-venko {
  background: #4F35F9 !important;
  color: white !important;
  border-radius: 12px !important;
  padding: 10px 20px;
  font-weight: 600;
  border: none;
  box-shadow: 6px 6px 12px rgba(80, 65, 200, 0.4),
              -6px -6px 12px rgba(255, 255, 255, 0.8);
}

/* 🌟 Botones Neo salidos */
.btn-neo {
  background: #fe5325 !important;
  color: #fff !important;
  border-radius: 12px !important;
  padding: 10px 18px;
  font-weight: 600;
  border: none;
  box-shadow: 
      6px 6px 12px #c5cae9,
      -6px -6px 12px #ffffff;
  transition: 0.2s;
}

.btn-neo:active {
  box-shadow: inset 4px 4px 8px #c5cae9,
              inset -4px -4px 8px #ffffff;
}

.btn-venko:active {
  box-shadow: inset 4px 4px 8px rgba(80, 65, 200, 0.3),
              inset -4px -4px 8px rgba(255, 255, 255, 0.8);
}

/* 🌟 Tabla estilo suave */
.table {
  background: #F8F9FF !important;
  border-radius: 14px;
  overflow: hidden;
}

.table thead th {
  background: #4F35F9 !important;
  color: white !important;
  border: none !important;
}

.table tbody tr {
  background: #F8F9FF !important;
}

.table tbody tr:hover {
  background: #E2E4FB !important;
}

/* 🌟 Botón logout arriba derecha */
#botondelogout {
  position: absolute;
  right: 20px;
  top: 20px;
  z-index: 9000;

  background: #FF6B6B !important;
  border: none;
  color: white;
  font-weight: 600;
  border-radius: 12px;
  padding: 8px 14px;

  box-shadow: 6px 6px 12px rgba(255, 100, 100, 0.4),
              -6px -6px 12px rgba(255, 255, 255, 0.8);
}

#botondelogout:active {
  box-shadow: inset 4px 4px 8px rgba(255, 100, 100, 0.4),
              inset -4px -4px 8px rgba(255, 255, 255, 0.8);
}

/* ============================
   💜 BANNER VENKO FINANZAS
   ============================ */
.neo-banner {
  background: #f0f4ff;
  padding: 12px 20px;
  margin-bottom: 20px;

  border-radius: 18px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  box-shadow:
    6px 6px 14px rgba(0,0,0,0.15),
    -6px -6px 16px rgba(255,255,255,1);

  font-size: 0.95rem;
  color: #4F35F9;
  font-weight: 600;
}

.neo-banner #bannerTexto {
  flex-grow: 1;
  animation: fadeText 0.6s ease-in-out;
}

#bannerBtn {
  background: #4F35F9;
  color: #fff;
  padding: 8px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;

  box-shadow:
    3px 3px 8px rgba(0,0,0,0.18),
    -3px -3px 8px rgba(255,255,255,0.9);

  transition: 0.2s ease;
}

#bannerBtn:hover {
  background: #6048ff;
  transform: translateY(-2px);
}

@keyframes fadeText {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
