/* ========================================================================
   VARIABLES DE COLOR + MODO OSCURO/CLARO
   ======================================================================== */

:root {
  /* Por defecto usamos tema oscuro */
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-card: #020617;
  --border-subtle: #1f2937;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.25);
  --accent-strong: #4f46e5;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #f97373;
  --success: #22c55e;
  --shadow-soft: 0 20px 40px rgba(15, 23, 42, 0.9);
}

/* Tema claro: se aplica cuando body[data-theme="light"] */
body[data-theme="light"] {
  --bg: #f3f4f6;
  --bg-elevated: #e5e7eb;
  --bg-card: #ffffff;
  --border-subtle: #d1d5db;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.18);
  --accent-strong: #4338ca;
  --text-main: #111827;
  --text-muted: #6b7280;
  --shadow-soft: 0 18px 35px rgba(148, 163, 184, 0.45);
}

/* Reset básico ----------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1e293b 0, #020617 45%, #000 100%);
  color: var(--text-main);
  min-height: 100vh;
}

/* En tema claro cambiamos el fondo global */
body[data-theme="light"] {
  background: radial-gradient(circle at top left, #e5e7eb 0, #f3f4f6 40%, #e5e7eb 100%);
}

/* Layout general --------------------------------------------------------- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER ----------------------------------------------------------------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.6rem;
  backdrop-filter: blur(12px);
  background: linear-gradient(
    to right,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.6)
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

body[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: rgba(148, 163, 184, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: radial-gradient(circle at 20% 20%, #5b21ff, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.5);
}

.brand-logo span {
  font-weight: 800;
  color: white;
  letter-spacing: 0.02em;
  font-size: 0.9rem;
}

.brand-text h1 {
  font-size: 1.2rem;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Botones de idioma ------------------------------------------------------ */
.lang-switch {
  display: flex;
  gap: 0.25rem;
}

.lang-btn {
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: transparent;
  color: var(--text-muted);
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.lang-btn.active {
  background: var(--accent-strong);
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-1px);
}

/* Toggle tema ------------------------------------------------------------ */
.theme-toggle {
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.25rem 0.6rem;
  background: rgba(15, 23, 42, 0.85);
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
}

body[data-theme="light"] .theme-toggle {
  background: rgba(243, 244, 246, 0.9);
  color: #0f172a;
}

.theme-icon {
  display: none;
}

body[data-theme="dark"] .theme-icon-moon {
  display: inline;
}

body[data-theme="light"] .theme-icon-sun {
  display: inline;
}

/* MAIN ------------------------------------------------------------------- */
.main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.4rem;
  max-width: 1120px;
  margin: 0 auto;
}

/* Panels ----------------------------------------------------------------- */
.panel {
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.9)
  );
  border-radius: 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow-soft);
  padding: 1.3rem 1.5rem;
}

body[data-theme="light"] .panel {
  background: var(--bg-card);
  border-color: rgba(148, 163, 184, 0.45);
}

.panel-form {
  flex: 1 1 340px;
  max-width: 520px;
}

.panel-preview {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

/* Títulos ---------------------------------------------------------------- */
.panel h2 {
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

/* Formulario ------------------------------------------------------------- */
.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  font-weight: 500;
}

input[type="text"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: radial-gradient(circle at top left, #020617, #020617 65%);
  color: var(--text-main);
  outline: none;
  font-size: 0.88rem;
  transition:
    border 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    transform 0.06s ease;
}

body[data-theme="light"]
  input[type="text"],
body[data-theme="light"]
  input[type="url"],
body[data-theme="light"]
  input[type="tel"],
body[data-theme="light"] select,
body[data-theme="light"] textarea {
  background: #f9fafb;
  border-color: #d1d5db;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Opciones fila ---------------------------------------------------------- */
.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.options-row .form-group {
  flex: 1 1 120px;
}

input[type="color"] {
  padding: 0;
  height: 36px;
}

/* Inline group ----------------------------------------------------------- */
.form-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-inline input[type="checkbox"] {
  width: auto;
  transform: translateY(1px);
}

/* Logo preview ----------------------------------------------------------- */
.logo-upload-group.hidden {
  display: none !important;
}

#logoCheckbox:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.logo-preview {
  margin-top: 0.35rem;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Botones --------------------------------------------------------------- */
.buttons-row {
  display: flex;
  align-items: center;
  margin-top: 0.6rem;
  gap: 0.5rem;
}

.spacer {
  flex: 1;
}

.btn {
  cursor: pointer;
  border-radius: 999px;
  border: none;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition:
    transform 0.08s ease,
    box-shadow 0.1s ease,
    background 0.15s ease,
    opacity 0.15s ease;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(to right, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.55);
}

.btn.secondary {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

body[data-theme="light"] .btn.secondary {
  background: #f3f4f6;
  color: var(--text-main);
}

.btn.ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed rgba(148, 163, 184, 0.5);
}

.btn.download {
  width: 100%;
  background: radial-gradient(circle at 0 0, #4ade80, var(--success));
  color: #052e16;
  box-shadow: 0 14px 35px rgba(22, 163, 74, 0.6);
  margin-top: 0.7rem;
}

.btn.tiny {
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Mensajes de error ----------------------------------------------------- */
.error-msg {
  color: var(--danger);
  min-height: 1.1rem;
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

/* PREVIEW QR ------------------------------------------------------------ */
.preview-main {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.preview-main h2 {
  font-size: 1rem;
}

.preview-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.qr-wrapper {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  position: relative;
}

.qrcode {
  padding: 0.8rem;
  border-radius: 1.1rem;
  background: radial-gradient(circle at top left, #ffffff, #e5e7eb);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.75);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out;
}

body[data-theme="light"] .qrcode {
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(148, 163, 184, 0.5);
}

.qrcode.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Mensaje inicial cuando no hay QR */
.qr-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Contenido del QR + copiar */
.qr-content-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.qr-content-text {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* HISTORIAL ------------------------------------------------------------- */
.preview-history {
  padding-top: 0.2rem;
}

.preview-history h3 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.history-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.history-list {
  list-style: none;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

/* scroll fino */
.history-list::-webkit-scrollbar {
  width: 6px;
}
.history-list::-webkit-scrollbar-track {
  background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(31, 41, 55, 0.9);
  margin-bottom: 0.4rem;
}

body[data-theme="light"] .history-item {
  background: #f9fafb;
  border-color: #d1d5db;
}

.history-meta {
  flex: 1;
  overflow: hidden;
}

.history-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.1rem;
}

.history-text {
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-date {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.history-use-btn {
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.08s ease;
  white-space: nowrap;
}

body[data-theme="light"] .history-use-btn {
  background: #ffffff;
}

.history-use-btn:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
}

/* FOOTER ----------------------------------------------------------------- */
.footer {
  text-align: center;
  padding: 0.9rem 1rem 1.1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-social {
  margin-top: 0.55rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
}

/* Botón contenedor para iconos sociales */
.social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);

  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.social-svg {
  width: 80%;
  height: 80%;
}

.social-icon:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
}

/* UTILS ------------------------------------------------------------------ */
.hidden {
  display: none;
}

/* RESPONSIVE ------------------------------------------------------------ */
@media (max-width: 840px) {
  .main {
    padding: 1rem;
  }

  .panel {
    border-radius: 1rem;
  }

  .panel-preview {
    order: -1;
  }

  .qr-wrapper {
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
  }

  .main {
    padding: 0.9rem;
  }

  .panel {
    padding: 1rem 1.1rem;
  }

  .buttons-row {
    flex-wrap: wrap;
  }

  .btn {
    flex: 1 1 auto;
  }

  .footer {
    padding: 0.8rem 0.9rem 1rem;
  }
}
/* ===== FEATURE BANNER PREMIUM MINIMAL ===== */
.feature-banner-pro {
  margin-top: 1rem;
  margin-bottom: 0.8rem;

  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;

  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(8px);

  font-size: 0.88rem;
  color: var(--text-main);
  opacity: 0.95;

  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

body[data-theme="light"] .feature-banner-pro {
  background: rgba(243, 244, 246, 0.6);
  border-color: rgba(0, 0, 0, 0.08);
}

.feature-banner-pro:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

/* Circulito animado estilo Linear */
.feature-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.6);
  animation: pulseGlow 1.7s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.45);
  }
  50% {
    transform: scale(1.25);
    box-shadow: 0 0 18px rgba(236, 72, 153, 0.9);
  }
}

.feature-text {
  font-weight: 600;
  opacity: 0.88;
}
