/* ──────────────────────────────────────────
   Design tokens
────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand palette */
  --brand-50:  #f0fdf9;
  --brand-100: #ccfbee;
  --brand-200: #99f6dc;
  --brand-400: #2dd4a7;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-900: #064e3b;

  /* Neutrals */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #020617;

  /* Semantic */
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --text:      #0f172a;
  --text-mute: #64748b;
  --accent:    var(--brand-500);
  --accent-dk: var(--brand-700);

  /* Sidebar */
  --sidebar-bg: #0f172a;
  --sidebar-w:  260px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.07);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
}

/* ──────────────────────────────────────────
   Reset & Base
────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ──────────────────────────────────────────
   Shared Buttons
────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.18s ease;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--brand-600);
  border-color: var(--brand-400);
}
.btn-outline:hover {
  background: var(--brand-50);
  border-color: var(--brand-600);
}

.btn-ghost {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--gray-200);
}

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.btn-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

/* ──────────────────────────────────────────
   ===  LANDING PAGE STYLES  ===
────────────────────────────────────────── */

/* Animated background orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(16,185,129,.25), transparent 70%);
  top: -120px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,.18), transparent 70%);
  bottom: -60px; right: -80px;
  animation-delay: -4s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139,92,246,.15), transparent 70%);
  top: 50%; left: 55%;
  animation-delay: -8s;
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

/* Landing shell */
.landing-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Brand icon (shared) */
.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}

/* Hero */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 32px 48px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
  margin-bottom: 28px;
  letter-spacing: 0.01em;
}
.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--brand-500);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--gray-900);
  margin-bottom: 20px;
}

.text-gradient {
  background: linear-gradient(135deg, var(--brand-500), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-mute);
  max-width: 520px;
  line-height: 1.7;
}

/* Destination cards */
.destinations {
  padding: 0 32px 80px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 16px;
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dest-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.dest-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(16,185,129,.04));
  opacity: 0;
  transition: opacity 0.22s;
}
.dest-card:hover {
  border-color: var(--brand-400);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(16,185,129,.08);
  transform: translateY(-3px);
}
.dest-card:hover::before {
  opacity: 1;
}
.dest-card:active {
  transform: translateY(-1px);
}

.dest-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.primary-icon   { background: #ecfdf5; color: var(--brand-600); }
.secondary-icon { background: #eff6ff; color: #3b82f6; }
.accent-icon    { background: #f5f3ff; color: #7c3aed; }

.dest-card-body {
  flex: 1;
  min-width: 0;
}
.dest-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 3px;
}
.dest-card-desc {
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.5;
  margin-bottom: 8px;
}
.dest-card-url {
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-600);
  font-family: 'SFMono-Regular', Consolas, monospace;
}

.dest-card-arrow {
  color: var(--gray-400);
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.dest-card:hover .dest-card-arrow {
  color: var(--brand-500);
  transform: translate(2px, -2px);
}

/* Site footer */
.site-footer {
  text-align: center;
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-mute);
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
}

/* ──────────────────────────────────────────
   ===  DASHBOARD PAGE STYLES  ===
────────────────────────────────────────── */

.dashboard-body {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.06);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar .brand-name {
  color: #f8fafc;
}

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  transition: all 0.16s ease;
}
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,0.85);
}
.nav-item.active {
  background: rgba(16,185,129,.15);
  color: var(--brand-400);
  font-weight: 600;
}
.nav-icon {
  flex-shrink: 0;
  opacity: 0.8;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  transition: all 0.16s ease;
}
.sidebar-back:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.7);
}

/* Dashboard main */
.dashboard-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100vh;
}

/* Dash header */
.dash-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.sidebar-toggle {
  display: none;
  color: var(--gray-600);
  padding: 6px;
  border-radius: 8px;
}
.sidebar-toggle:hover {
  background: var(--gray-100);
}

.dash-header-title h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.dash-header-sub {
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 1px;
}
.dash-header-actions {
  margin-left: auto;
}

/* Connection pill */
.connection-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

/* Status dot */
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gray-400);
  flex-shrink: 0;
  transition: background 0.3s ease;
}
.status-dot.connected {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.25);
  animation: pulse-green 2s ease-in-out infinite;
}
.status-dot.error {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.2);
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,.12); }
}

/* Dash content */
.dash-content {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Sections */
.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.2px;
}
.section-desc {
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 3px;
}
.section-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Stat cards */
.status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.green-icon { background: #dcfce7; color: #16a34a; }
.blue-icon  { background: #dbeafe; color: #2563eb; }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-mute);
  margin-bottom: 3px;
}
.stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* QR section */
.qr-section {
  padding: 28px;
  background: linear-gradient(135deg, var(--brand-50), #eff6ff);
  border: 1px solid var(--brand-200);
  border-radius: var(--r-md);
  transition: all 0.3s ease;
}
.qr-section.is-hidden {
  display: none;
}
.qr-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.qr-text h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}
.qr-text p {
  font-size: 14px;
  color: var(--text-mute);
  max-width: 320px;
  line-height: 1.6;
}
.qr-frame {
  flex-shrink: 0;
  padding: 12px;
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}
.qr-frame img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  display: block;
}

/* Forms */
.send-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.input-wrapper {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  line-height: 0;
}
.token-reveal {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  padding: 4px;
  border-radius: 6px;
  line-height: 0;
  transition: color 0.15s;
}
.token-reveal:hover {
  color: var(--gray-700);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: all 0.15s ease;
  outline: none;
}
.form-input.with-icon {
  padding-left: 40px;
}
.form-input:focus {
  border-color: var(--brand-400);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}
.form-input::placeholder {
  color: var(--gray-400);
}
.form-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

.form-hint {
  font-size: 12px;
  color: var(--text-mute);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Send result */
.send-result {
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-700);
  flex: 1;
}
.send-result.error {
  color: #dc2626;
}
.send-result:empty {
  display: none;
}

/* ──────────────────────────────────────────
   Responsive
────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Landing */
  .top-bar {
    padding: 14px 20px;
  }
  .hero {
    padding: 56px 20px 36px;
  }
  .hero-title {
    font-size: clamp(28px, 9vw, 44px);
    letter-spacing: -0.8px;
  }
  .hero-subtitle {
    font-size: 16px;
  }
  .destinations {
    padding: 0 20px 56px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }

  /* Dashboard */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.3);
  }
  .sidebar-toggle {
    display: flex;
  }
  .dashboard-main {
    height: 100vh;
  }
  .dash-header {
    padding: 14px 20px;
  }
  .dash-content {
    padding: 20px;
  }
  .dash-section {
    padding: 20px;
  }
  .section-header {
    flex-direction: column;
  }
  .qr-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .status-cards {
    grid-template-columns: 1fr;
  }
  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-primary {
    justify-content: center;
  }
}