/* =============================================
   Módulo QRKat — style.css
   Tema: Corporativo Claro / Brand Greenvic
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;1,9..40,400&display=swap');

:root {
  --brand-color:   #13786b;
  --brand-hover:   #0e5e53;
  --bg:            #ffffff;
  --bg-soft:       #f8fafc;
  --bg-card:       #ffffff;
  --border:        rgba(0,0,0,0.08);
  --text:          #1d1d1f;
  --text-muted:    #64748b;
  --font-display:  'Syne', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --radius:        14px;
  --shadow:        0 10px 25px rgba(0,0,0,0.05);
}

/* BASE */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); color: var(--text); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

/* ---- NAVBAR ---- */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.navbar-brand { font-family: var(--font-display); font-size: 1.4rem !important; letter-spacing: -0.5px; color: var(--text) !important; }
.nav-link { color: var(--text-muted) !important; font-size: 0.9rem; font-weight: 500; transition: color 0.2s, background 0.2s; border-radius: 8px; }
.nav-link:hover { color: var(--brand-color) !important; background-color: rgba(19,120,107,0.06); }
.nav-link.active, .nav-link.fw-bold { color: var(--brand-color) !important; }
.lang-switch.lang-active { background: var(--brand-color) !important; color: #fff !important; border-color: var(--brand-color) !important; }

/* Escritorio: espaciado interno de links más cómodo */
@media (min-width: 992px) {
  .navbar-nav .nav-link { padding: 0.45rem 0.75rem !important; }
  .navbar-nav .nav-item.dropdown .nav-link { padding-right: 0.5rem !important; }
}

/* ---- NAVBAR MÓVIL (menú desplegado < 992 px) ---- */
@media (max-width: 991.98px) {
  /* Panel contenedor del menú desplegado */
  .navbar-collapse {
    margin-top: 0.75rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.09);
    overflow: hidden;
  }

  /* Lista interna sin margen extra */
  .navbar-collapse .navbar-nav {
    padding: 0.5rem 0.75rem 0.75rem;
    gap: 0 !important;
  }

  /* Cada ítem ocupa ancho completo */
  .navbar-collapse .nav-item {
    width: 100%;
  }

  /* Links de navegación: área táctil generosa */
  .navbar-collapse .nav-link {
    display: block;
    padding: 0.75rem 0.85rem !important;
    border-radius: 10px;
    font-size: 0.95rem !important;
    color: var(--text) !important;
    transition: background 0.15s, color 0.15s;
  }
  .navbar-collapse .nav-link:hover,
  .navbar-collapse .nav-link.active {
    background-color: var(--bg-soft);
    color: var(--brand-color) !important;
  }

  /* Separador fino entre grupos de links */
  .navbar-collapse .nav-item + .nav-item {
    border-top: 1px solid var(--border);
  }

  /* Botón "Iniciar Sesión": ancho completo, sin estilo de pill apretado */
  .navbar-collapse .nav-item .btn-brand {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
    padding: 0.75rem 1rem !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  /* Fila de idiomas ES / EN: centrada con separación arriba */
  .navbar-collapse .nav-item.d-flex {
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0.6rem 0.85rem !important;
    margin-left: 0 !important;
  }
  .navbar-collapse .nav-item.d-flex .lang-switch {
    flex: 1;
    text-align: center;
    font-size: 0.85rem !important;
    padding: 0.45rem 0 !important;
  }

  /* Dropdown del avatar de usuario: sin sombra doble */
  .navbar-collapse .dropdown-menu {
    position: static !important;
    float: none !important;
    border: none !important;
    box-shadow: none !important;
    background: var(--bg-soft) !important;
    border-radius: 10px !important;
    margin: 0.25rem 0 0.5rem !important;
    padding: 0.25rem 0.5rem !important;
    width: 100% !important;
  }
}

/* ---- HERO ---- */
.hero-section {
  background: radial-gradient(ellipse 60% 50% at 50% -10%, rgba(19, 120, 107, 0.08) 0%, transparent 70%), var(--bg);
  border-bottom: 1px solid var(--border);
}
.badge-pill {
  display: inline-block; background: rgba(19, 120, 107, 0.1); color: var(--brand-color);
  border: 1px solid rgba(19, 120, 107, 0.2); border-radius: 99px; padding: 0.35em 1em; font-size: 0.8rem; font-weight: 600;
}
.text-brand { color: var(--brand-color) !important; }

/* ---- BOTONES ---- */
.btn-brand {
  background: var(--brand-color); color: #fff; border: none; border-radius: var(--radius); font-weight: 600;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s; box-shadow: 0 4px 15px rgba(19, 120, 107, 0.2);
}
.btn-brand:hover { background: var(--brand-hover); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(19, 120, 107, 0.3); }

/* ---- SECCIONES ---- */
.bg-light-soft { background-color: var(--bg-soft); }

/* ---- TARJETAS INFO ---- */
.info-card { transition: transform 0.3s ease, box-shadow 0.3s ease; border: 1px solid rgba(0,0,0,0.05); }
.info-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.08) !important; }
.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    border-radius: 16px;
}
.bg-primary-soft { background-color: rgba(13, 110, 253, 0.1); }
.bg-success-soft { background-color: rgba(25, 135, 84, 0.1); }

/* ---- CARD PRINCIPAL (FORM) ---- */
.card-main { background: var(--bg-card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.5); box-shadow: var(--shadow); }

/* ---- INPUTS Y CONTROLES ---- */
.form-control { background-color: var(--bg-soft) !important; color: var(--text) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; padding: 0.75rem 1rem; transition: all 0.2s; }
.form-control:focus { background-color: #fff !important; border-color: var(--brand-color) !important; box-shadow: 0 0 0 3px rgba(19, 120, 107, 0.15) !important; outline: none; }
.input-group-text { background-color: var(--bg-soft) !important; border: 1px solid var(--border) !important; border-right: none !important; border-radius: var(--radius) 0 0 var(--radius) !important; color: var(--text-muted); }
.input-group .form-control { border-left: none !important; border-radius: 0 var(--radius) var(--radius) 0 !important; }
.form-control-color { height: 42px; padding: 0.25rem; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); }

/* ---- SELECTS Y DROPDOWNS CUSTOM ---- */
.form-select {
  background-color: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem 1rem; color: var(--text); font-weight: 500; cursor: pointer; transition: all 0.2s ease;
}
.form-select:focus { background-color: #fff; border-color: var(--brand-color); box-shadow: 0 0 0 3px rgba(19, 120, 107, 0.15); outline: none; }

.custom-select-btn { background-color: #fff; border: 1px solid var(--border); padding: 0.75rem 1rem; border-radius: 10px; font-weight: 500;}
.dropdown-menu { border-radius: 12px; padding: 0.5rem; box-shadow: 0 10px 40px rgba(0,0,0,0.1); border: 1px solid var(--border); animation: fadeInDown 0.2s ease-out; }
.dropdown-item { border-radius: 8px; padding: 0.6rem 1rem; font-weight: 500; color: var(--text-muted); transition: all 0.2s; font-size: 0.9rem; }
.dropdown-item:hover, .dropdown-item.active { background-color: var(--brand-color); color: #fff !important; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ---- CUSTOM RADIO BUTTONS ELEGANTES ---- */
.custom-radio-label { cursor: pointer; transition: all 0.2s; border: 1px solid var(--border); font-weight: 500; color: var(--text-muted); flex: 1; text-align: center; background: #fff;}
.custom-radio-label:hover { border-color: var(--brand-color); background-color: var(--bg-soft); }
.btn-check:checked + .custom-radio-label {
    background-color: var(--brand-color) !important;
    color: #ffffff !important;
    border-color: var(--brand-color) !important;
    box-shadow: 0 4px 10px rgba(19, 120, 107, 0.2);
}

/* ---- ACORDEÓN DE DISEÑO ---- */
.accordion-button:not(.collapsed) { background-color: var(--bg-soft); color: var(--brand-color); box-shadow: none; }
.accordion-button:focus { box-shadow: none; border-color: rgba(0,0,0,.125); }

/* ---- SUBIDA DE LOGO (DRAG & DROP) ---- */
.upload-area { border: 2px dashed var(--border); transition: all 0.3s; cursor: pointer; }
.upload-area:hover { border-color: var(--brand-color); background-color: var(--bg-soft); }

/* ---- MOCKUP DEL TELÉFONO (VISTA PREVIA) ---- */
.phone-mockup {
    position: relative; width: 300px; height: 600px; background: #fff; border: 12px solid #1a1a1a;
    border-radius: 40px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); margin: 0 auto; display: flex;
    flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
}
.phone-notch {
    position: absolute; top: 0; width: 120px; height: 25px; background: #1a1a1a;
    border-bottom-left-radius: 15px; border-bottom-right-radius: 15px; z-index: 10;
}
#qr-canvas-container canvas, #qr-canvas-container svg { display: block; margin: auto; max-width: 100% !important; height: auto !important;}

/* ---- PRESET CARDS ---- */
.preset-card {
    border: 1.5px solid var(--border) !important;
    transition: all 0.2s ease;
    cursor: pointer;
}
.preset-card:hover {
    border-color: var(--brand-color) !important;
    background-color: var(--bg-soft) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(19,120,107,0.15) !important;
}
.preset-card.active {
    border-color: var(--brand-color) !important;
    box-shadow: 0 0 0 3px rgba(19,120,107,0.2) !important;
    background-color: rgba(19,120,107,0.04) !important;
}

/* ---- QR TYPE SELECTOR (radio cards) ---- */
.btn-check:checked + .custom-radio-label .bi-arrow-repeat,
.btn-check:checked + .custom-radio-label .bi-lock {
    color: #fff !important;
}

/* ---- QR TYPE SELECTOR CARDS (formulario de creación) ---- */
.qr-type-card {
    border: 2px solid var(--border);
    background: #fff;
    border-radius: 12px;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    outline: none;
}
.qr-type-card:hover  { border-color: var(--brand-color); background: var(--bg-soft); transform: translateY(-2px); }
.qr-type-card.active { border-color: var(--brand-color); background: rgba(19,120,107,0.06); box-shadow: 0 0 0 3px rgba(19,120,107,0.15); }
.qr-type-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.5rem;
}

/* ---- UTILITIES ---- */
.border-dashed { border-style: dashed !important; }
.result-box { background: rgba(19, 120, 107, 0.04); border: 1px solid rgba(19, 120, 107, 0.15); border-radius: var(--radius); }

/* RESPONSIVE BORDER UTILITY */
@media (min-width: 768px) {
  .border-start-md { border-left: 1px solid var(--border) !important; }
}

/* ---- RESPONSIVE: MOBILE IMPROVEMENTS ---- */
@media (max-width: 575.98px) {
  /* Prevent card overflow on very small screens */
  .card-main { border-radius: var(--radius) !important; }

  /* QR type selector cards: tighter padding on xs */
  .qr-type-card { padding: 0.75rem 0.25rem; }
  .qr-type-icon { width: 36px; height: 36px; }

  /* Accordion body: reduce padding so content fits */
  .accordion-body { padding: 0.75rem !important; }

  /* Input group: ensure it doesn't overflow */
  .input-group { flex-wrap: nowrap; overflow: hidden; }
}

@media (max-width: 767.98px) {
  /* gestionar.php table: token column wraps gracefully */
  .table td, .table th { white-space: normal; word-break: break-word; }
}

/* ════════════════════════════════════════════════════════
   LAYOUT: 3 COLUMNAS CON ESPACIOS PUBLICITARIOS LATERALES
   Visible solo en pantallas XL (≥1200px).
   En móvil/tablet .qrkat-ad-col es display:none.
   ════════════════════════════════════════════════════════ */
.qrkat-page-wrapper {
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}

/* Columna lateral (izquierda y derecha) */
.qrkat-ad-col {
  width: 160px;        /* Ancho estándar skyscraper 160×600 */
  flex-shrink: 0;
  padding: 2rem 0.75rem;
  position: sticky;
  top: 4.5rem;         /* Queda pegado justo debajo del navbar */
  max-height: calc(100vh - 4.5rem);
  overflow-y: auto;
}

/* Columna central: hereda todo el ancho restante */
.qrkat-content-col {
  flex: 1;
  min-width: 0;        /* Evita desbordamiento en flex */
}

/* Bloque marcador — reemplazar innerHTML con código AdSense */
.qrkat-ad-sidebar {
  background: #f1f5f9;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  min-height: 250px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 1.5rem 0.5rem;
}

/* Ocultar columnas laterales en cualquier resolución < XL */
@media (max-width: 1199.98px) {
  .qrkat-ad-col { display: none !important; }
}

/* ---- FOOTER EXTENDIDO ---- */
.footer-extended { background-color: var(--bg-soft); color: var(--text); }
.footer-extended h6 { color: var(--text); font-size: 1.05rem; letter-spacing: -0.3px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.2s ease, transform 0.2s ease; display: inline-block; font-weight: 400; }
.footer-links a:hover { color: var(--brand-color); transform: translateX(4px); }
.social-icons a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; transition: background-color 0.2s, color 0.2s; }
.social-icons a:hover { background-color: var(--brand-color); color: #ffffff !important; }