/* ═══════════════════════════════════════════════════════
   SwiftDrop — Main Stylesheet
   Design: Premium SaaS, glassmorphism, smooth animations
════════════════════════════════════════════════════════ */

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

:root {
  --indigo: #4F46E5;
  --violet: #7C3AED;
  --cyan: #06B6D4;
  --pink: #EC4899;
  --emerald: #10B981;
  --danger: #EF4444;
  --amber: #F59E0B;
  /* Clean light theme */
  --bg: #F8FAFC;
  --text: #0F172A;
  --card: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --grad: linear-gradient(135deg, var(--indigo), var(--violet));
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 4px 16px rgba(79,70,229,0.08), 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 32px rgba(79,70,229,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 60px rgba(79,70,229,0.15), 0 8px 24px rgba(0,0,0,0.08);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font-head: 'Syne', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── App Shell ───────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Navbar ──────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 40px;
  height: 56px;
  background: rgba(248,250,252,0.85);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(79,70,229,0.07);
}

.mii-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: linear-gradient(90deg, rgba(255,153,51,0.1), rgba(255,255,255,0.04), rgba(19,136,8,0.1));
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
  flex-shrink: 0;
}
.mii-flag { font-size: 14px; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-text {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-center { flex: 1; display: flex; justify-content: center; }

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--gray-100);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  border: 1px solid var(--gray-200);
  transition: all 0.4s ease;
}
.connection-pill.connected {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.25);
  color: #059669;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
  transition: all 0.4s ease;
  flex-shrink: 0;
}
.status-dot.waiting { background: var(--amber); animation: pulse-amber 2s infinite; }
.status-dot.connected { background: var(--emerald); animation: pulse-green 2s infinite; }

@keyframes pulse-amber {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(245,158,11,0); }
}
@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}

.btn-ghost {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-ghost:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  background: rgba(79,70,229,0.05);
}

/* ─── Hero ────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 20px 40px 16px;
  max-width: 700px;
  margin: 0 auto;
}
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Main Grid ───────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  padding: 0 40px 20px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Cards ───────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(79,70,229,0.07);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,70,229,0.2), transparent);
}

.card-header {
  margin-bottom: 14px;
}
.card-header h2 {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.card-header p {
  font-size: 13px;
  color: var(--gray-500);
}

/* ─── QR Card ─────────────────────────────────────────── */
.qr-card { text-align: center; }

.qr-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff; /* must stay white/light for QR scanners to read it */
  margin-bottom: 12px;
  border: 1.5px solid var(--gray-300);
}

.qr-corners span {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--indigo);
  border-style: solid;
  border-width: 0;
}
.qr-corners span:nth-child(1) { top: -1px; left: -1px; border-top-width: 3px; border-left-width: 3px; border-radius: 4px 0 0 0; }
.qr-corners span:nth-child(2) { top: -1px; right: -1px; border-top-width: 3px; border-right-width: 3px; border-radius: 0 4px 0 0; }
.qr-corners span:nth-child(3) { bottom: -1px; left: -1px; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 4px; }
.qr-corners span:nth-child(4) { bottom: -1px; right: -1px; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 4px 0; }

.qr-scanner-line {
  position: absolute;
  left: 20px; right: 20px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--indigo), var(--violet), transparent);
  border-radius: 100px;
  top: 20px;
  animation: qr-scan 2s ease-in-out infinite;
  opacity: 0.7;
}
@keyframes qr-scan {
  0%, 100% { top: 20px; opacity: 0.7; }
  50% { top: calc(100% - 22px); opacity: 0.9; }
}

#qr-canvas-wrap canvas {
  display: block;
  border-radius: 8px;
}

.session-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border: 1px solid var(--gray-200);
}
.session-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-400);
}
.session-code {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--text);
}
.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 2px;
  border-radius: 4px;
  transition: color var(--transition);
  display: flex; align-items: center;
}
.copy-btn:hover { color: var(--indigo); }

.timer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-400);
}
.timer-row strong { color: var(--indigo); font-weight: 600; }

/* ─── Files Card ──────────────────────────────────────── */
.files-card {
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.badge {
  background: rgba(79,70,229,0.1);
  color: var(--indigo);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
}
.badge.has-files {
  background: rgba(16,185,129,0.1);
  color: var(--emerald);
}

.files-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px;
}
.empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(79,70,229,0.07);
  display: flex; align-items: center; justify-content: center;
}
.files-empty p { font-size: 15px; color: var(--gray-400); }

.waiting-dots { display: flex; gap: 5px; }
.waiting-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--indigo);
  opacity: 0.3;
  animation: wdot 1.4s ease-in-out infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: .2s; }
.waiting-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes wdot {
  0%,80%,100% { transform:scale(.8); opacity:.25; }
  40% { transform:scale(1.2); opacity:1; }
}

/* File list */
.files-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 440px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-200) transparent;
}
.files-list::-webkit-scrollbar { width: 4px; }
.files-list::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 10px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100);
  animation: fileIn 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
  transition: all var(--transition);
}
.file-item:hover { border-color: rgba(79,70,229,0.2); background: rgba(79,70,229,0.03); }
@keyframes fileIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.file-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--gray-100);
}

.file-info { flex: 1; min-width: 0; }
.file-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.file-meta {
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.file-meta .type-tag {
  color: var(--indigo);
  font-weight: 600;
}
.file-meta .new-tag {
  background: rgba(16,185,129,0.1);
  color: var(--emerald);
  padding: 1px 7px;
  border-radius: 100px;
  font-weight: 600;
}

.progress-mini {
  height: 3px;
  background: var(--gray-200);
  border-radius: 100px;
  margin-top: 6px;
  overflow: hidden;
}
.progress-mini-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 100px;
  transition: width 0.25s ease;
}

.btn-dl {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--grad);
  color: white;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-dl:hover { opacity: .85; transform: translateY(-1px); }
.btn-dl.saved {
  background: rgba(16,185,129,0.12);
  color: var(--emerald);
  border: 1px solid rgba(16,185,129,0.25);
}
.uploading-label {
  font-size: 12px;
  color: var(--indigo);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── How It Works ────────────────────────────────────── */
.how-it-works {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 40px 24px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.step-card {
  flex: 1;
  padding: 14px 18px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}
.step-num {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--grad);
  color: white;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.step-card h3 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.step-card p { font-size: 13px; color: var(--gray-500); line-height: 1.55; }
.step-divider {
  font-size: 20px;
  color: var(--gray-300);
  padding: 0 20px;
  flex-shrink: 0;
}

/* ─── Footer ──────────────────────────────────────────── */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--gray-200);
  padding: 14px 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--card);
}
.footer-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.footer-links { display: flex; gap: 20px; flex: 1; }
.footer-links a {
  font-size: 13px; color: var(--gray-400);
  text-decoration: none; transition: color var(--transition);
}
.footer-links a:hover { color: var(--indigo); }
.footer-copy { font-size: 12px; color: var(--gray-400); margin-left: auto; }

/* ─── Mobile Shell ────────────────────────────────────── */
.mobile-shell {
  background: var(--bg);
  max-width: 600px;
  margin: 0 auto;
}
.mobile-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--card);
}
.mobile-content {
  flex: 1;
  padding: 28px 20px 48px;
  display: flex;
  flex-direction: column;
}

/* ─── Mobile States ───────────────────────────────────── */
.mobile-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; flex: 1; }
.mobile-state:not(:first-child) { display: none; }

.connecting-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  margin-bottom: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.state-icon {
  width: 76px; height: 76px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
  animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes popIn { from{transform:scale(0);opacity:0} to{transform:scale(1);opacity:1} }

.success-icon { background: linear-gradient(135deg, var(--emerald), #059669); box-shadow: 0 8px 32px rgba(16,185,129,0.35); }
.error-icon   { background: linear-gradient(135deg, var(--danger), #B91C1C); box-shadow: 0 8px 32px rgba(239,68,68,0.35); }

.mobile-state h2 { font-family: var(--font-head); font-size: 26px; font-weight: 800; }
.mobile-state > p { font-size: 15px; color: var(--gray-500); max-width: 320px; }

.mobile-session-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  color: #059669;
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 13px; font-weight: 500;
  margin-bottom: 8px;
}
.mobile-session-pill strong { color: var(--text); font-weight: 700; }

.mobile-title {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  align-self: flex-start;
}
.mobile-sub { font-size: 15px; color: var(--gray-500); align-self: flex-start; margin-bottom: 8px; }

.back-btn {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--gray-500);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 4px;
}
.back-btn:hover { color: var(--indigo); }

/* Choice grid (mobile) */
.choice-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.choice-card {
  background: var(--card);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition);
}
.choice-card:hover {
  border-color: var(--indigo);
  background: rgba(79,70,229,0.04);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.choice-icon { font-size: 32px; }
.choice-card h3 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.choice-card p { font-size: 12px; color: var(--gray-500); line-height: 1.4; }

.print-tag {
  background: rgba(245,158,11,0.12);
  color: #B45309;
  padding: 1px 7px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 11px;
}
.btn-print { background: linear-gradient(135deg, var(--amber), #D97706); }

/* Drop zone */
.drop-zone {
  width: 100%;
  border: 2px dashed rgba(79,70,229,0.25);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .25s ease;
  background: rgba(79,70,229,0.02);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--indigo);
  background: rgba(79,70,229,0.06);
}
.drop-icon-wrap {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: rgba(79,70,229,0.08);
  display: flex; align-items: center; justify-content: center;
}
.drop-title { font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.drop-sub { font-size: 13px; color: var(--gray-400); }

.quick-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}
.quick-btn {
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--card);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--transition);
}
.quick-btn:hover { border-color: var(--indigo); color: var(--indigo); background: rgba(79,70,229,0.04); }

/* Preview list (mobile) */
.preview-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  animation: fileIn 0.3s ease;
}
.preview-thumb {
  width: 42px; height: 42px;
  border-radius: 9px;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.preview-info { flex: 1; min-width: 0; }
.preview-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-size { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.preview-prog { height: 3px; background: var(--gray-200); border-radius: 100px; margin-top: 5px; overflow: hidden; }
.preview-prog-fill { height: 100%; background: var(--grad); border-radius: 100px; transition: width 0.2s ease; }
.remove-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.remove-btn:hover { background: rgba(239,68,68,0.1); color: var(--danger); }

/* Send button */
.btn-send {
  width: 100%;
  padding: 16px;
  margin-top: 16px;
  border-radius: var(--radius);
  border: none;
  background: var(--grad);
  color: white;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 6px 24px rgba(79,70,229,0.35);
}
.btn-send:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(79,70,229,0.45);
}
.btn-send:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  padding: 12px 28px;
  border-radius: var(--radius);
  border: 1.5px solid rgba(79,70,229,0.25);
  background: transparent;
  color: var(--indigo);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
}
.btn-secondary:hover { background: rgba(79,70,229,0.06); border-color: var(--indigo); }

/* Sent summary */
.sent-summary {
  width: 100%;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--gray-600);
  text-align: left;
}
.sent-summary .sent-file {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0;
}

/* ─── Toasts ──────────────────────────────────────────── */
#toast-wrap {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
  max-width: 340px;
}
.toast.success { background: var(--emerald); color: white; }
.toast.error   { background: var(--danger);  color: white; }
.toast.info    { background: var(--indigo);  color: white; }

@keyframes toastIn  { from{opacity:0;transform:translateX(60px)} to{opacity:1;transform:translateX(0)} }
@keyframes toastOut { from{opacity:1;transform:translateX(0)} to{opacity:0;transform:translateX(60px)} }

/* ─── Skeleton loading ────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 880px) {
  .navbar { padding: 0 20px; }
  .hero { padding: 16px 20px 12px; }
  .main-grid { grid-template-columns: 1fr; padding: 0 20px 20px; }
  .how-it-works { flex-direction: column; padding: 0 20px 24px; gap: 12px; }
  .step-divider { transform: rotate(90deg); font-size: 16px; }
  .footer { flex-wrap: wrap; padding: 16px 20px; gap: 12px; }
  .footer-copy { order: 3; width: 100%; margin-left: 0; }
}

@media (max-width: 640px) {
  .mii-badge span:last-child { display: none; }
  .mii-badge { padding: 5px 8px; }
}

@media (max-width: 480px) {
  .qr-frame { padding: 14px; }
  .navbar .btn-ghost span { display: none; }
  .nav-center { display: none; }
  .quick-btns { grid-template-columns: 1fr 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
}


/* ─── Print Modal ─────────────────────────────────────── */
.print-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.print-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.print-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.print-modal-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}
.print-modal-fname {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.print-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.print-modal-close:hover { background: var(--gray-100); color: var(--text); }
.print-modal-body {
  flex: 1;
  min-height: 0;
  background: #f5f5f5;
}
.print-modal-body iframe {
  width: 100%;
  height: 100%;
  min-height: 460px;
  border: none;
  display: block;
}
.print-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.btn-print-now {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-print-now:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-print-now:active { transform: translateY(0); }

/* ─── Google Translate ────────────────────────────────── */
#google-translate-el {
  display: inline-flex;
  align-items: center;
}
#google-translate-el .goog-te-gadget-simple {
  background: transparent !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 5px 10px !important;
  font-size: 13px !important;
  font-family: inherit !important;
  cursor: pointer;
  color: var(--text) !important;
}
#google-translate-el .goog-te-gadget-simple span,
#google-translate-el .goog-te-gadget-simple .goog-te-menu-value span {
  color: var(--text) !important;
  font-family: inherit !important;
}
#google-translate-el img { display: none !important; }
.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }

/* ─── Auth Overlay ────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
  gap: 48px;
}

/* Left branding panel */
.auth-left {
  flex: 1;
  max-width: 460px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-brand-name {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.auth-tagline {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 12px;
}
.auth-tagdesc {
  font-size: 15px;
  color: #94A3B8;
  margin-bottom: 36px;
  line-height: 1.6;
}
.auth-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}
.auth-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.auth-step-num {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-step strong {
  display: block;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
}
.auth-step p {
  color: #94A3B8;
  font-size: 13px;
  line-height: 1.5;
}
.auth-mii {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #94A3B8;
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 6px 14px;
  width: fit-content;
}

/* Right form box — hardcoded white so no CSS-var conflicts */
.auth-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: #F1F5F9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: #64748B;
  transition: all 0.15s;
  font-family: inherit;
}
.auth-tab.active {
  background: #fff;
  color: #0F172A;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.auth-sub {
  font-size: 13px;
  color: #64748B;
  margin-bottom: 20px;
}
.auth-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #0F172A;
  margin-bottom: 14px;
}
.auth-hint { font-weight: 400; color: #94A3B8; }
.auth-input {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #0F172A;
  background: #F8FAFC;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.auth-input:focus { border-color: #4F46E5; background: #fff; }
.auth-error {
  font-size: 13px;
  color: #EF4444;
  min-height: 18px;
  margin-bottom: 8px;
}
.auth-submit {
  width: 100%;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 4px;
}
.auth-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: #64748B;
  margin-top: 16px;
}
.auth-link {
  background: none;
  border: none;
  color: #4F46E5;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  font-family: inherit;
}
.auth-link:hover { text-decoration: underline; }

/* Hide left panel on small screens */
@media (max-width: 820px) {
  .auth-overlay { flex-direction: column; padding: 16px; gap: 0; justify-content: flex-start; overflow-y: auto; }
  .auth-left { max-width: 100%; padding: 24px 0 20px; }
  .auth-tagline { font-size: 20px; }
  .auth-steps { display: none; }
  .auth-mii { display: none; }
  .auth-box { max-width: 100%; padding: 28px 24px; }
}

/* ─── Nav user pill ───────────────────────────────────── */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-credits { font-size: 13px; font-weight: 700; color: #7C3AED; background: #EDE9FE; border: 1px solid #DDD6FE; border-radius: 20px; padding: 3px 10px; white-space: nowrap; }

.auth-box { position: relative; }
.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.auth-close:hover { background: #F1F5F9; color: #0F172A; }

/* ─── Ad Banner (waiting screen) ──────────────────────── */
.ad-banner {
  background: rgba(34,211,238,0.04);
  border: 1px dashed rgba(168,85,247,0.3);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ad-banner-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
}

/* ═══════════════════════════════════════════════════════
   FUTURISTIC THEME — animated background, glow, tilt
════════════════════════════════════════════════════════ */

/* Base canvas — soft light gradient behind everything */
body {
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #EEF2FF 0%, #F8FAFC 55%),
              #F8FAFC;
  background-attachment: fixed;
}

/* Animated grid background behind the whole app — subtle on light bg */
.app-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(79,70,229,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(124,58,237,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 0%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 0%, #000 55%, transparent 100%);
  animation: gridDrift 24s linear infinite;
}
@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 80px 80px; }
}

/* Floating glow orbs — soft pastel, subtle on light background */
.app-shell::after {
  content: '';
  position: fixed;
  top: -15%;
  right: -10%;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(124,58,237,0.08), transparent 70%);
  border-radius: 50%;
  z-index: -1;
  animation: orbFloat 14s ease-in-out infinite;
  pointer-events: none;
  filter: blur(10px);
}
.hero::before {
  content: '';
  position: fixed;
  top: 20%;
  left: -10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(6,182,212,0.07), transparent 70%);
  border-radius: 50%;
  z-index: -1;
  animation: orbFloat2 18s ease-in-out infinite;
  pointer-events: none;
  filter: blur(10px);
}
.hero::after {
  content: '';
  position: fixed;
  bottom: -10%;
  right: 20%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(236,72,153,0.05), transparent 70%);
  border-radius: 50%;
  z-index: -1;
  animation: orbFloat 16s ease-in-out infinite reverse;
  pointer-events: none;
  filter: blur(10px);
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-40px, 50px) scale(1.15); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(50px, -30px) scale(1.1); }
}

/* Hero entrance animation */
.hero-title {
  animation: heroRise 0.7s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes heroRise {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Card entrance + glow on QR frame */
.qr-card, .files-card {
  animation: cardRise 0.6s cubic-bezier(0.16,1,0.3,1) both;
}
.files-card { animation-delay: 0.08s; }
@keyframes cardRise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.qr-frame {
  position: relative;
  animation: qrGlow 3s ease-in-out infinite;
}
@keyframes qrGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0.15), 0 0 0 0 rgba(124,58,237,0.12); }
  50%      { box-shadow: 0 0 20px 4px rgba(6,182,212,0.2), 0 0 30px 8px rgba(124,58,237,0.12); }
}
.qr-corners span {
  border-color: var(--cyan);
  animation: cornerPulse 2.4s ease-in-out infinite;
}
@keyframes cornerPulse {
  0%, 100% { opacity: 0.6; filter: drop-shadow(0 0 0 var(--cyan)); }
  50%      { opacity: 1;   filter: drop-shadow(0 0 4px var(--cyan)); }
}

/* File cards — 3D tilt + neon glow on hover */
.file-item {
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), box-shadow 0.25s, border-color 0.25s, background 0.25s;
}
.file-item:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 24px rgba(79,70,229,0.15);
  border-color: rgba(124,58,237,0.3);
}

/* Logo pulse */
.logo svg {
  animation: logoPulse 4s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(34,211,238,0)); }
  50%      { filter: drop-shadow(0 0 8px rgba(34,211,238,0.6)); }
}

/* Connection pill — animated gradient sweep when connected */
.connection-pill.connected {
  background: linear-gradient(90deg, rgba(16,185,129,0.08), rgba(6,182,212,0.12), rgba(16,185,129,0.08));
  background-size: 200% 100%;
  animation: pillSweep 3s linear infinite;
}
@keyframes pillSweep {
  from { background-position: 0% 0; }
  to   { background-position: 200% 0; }
}

/* Buttons — subtle shine sweep on hover */
.btn-send, .auth-submit {
  position: relative;
  overflow: hidden;
}
.btn-send::after, .auth-submit::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.btn-send:hover::after, .auth-submit:hover::after { left: 125%; }

@media (prefers-reduced-motion: reduce) {
  .app-shell::before, .app-shell::after, .qr-frame, .qr-corners span,
  .logo svg, .connection-pill.connected, .hero-title, .qr-card, .files-card {
    animation: none !important;
  }
}
