:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-elevated: #1a1a26;
  --border: #2a2a3a;
  --text: #f0f0f5;
  --text-muted: #8888a0;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.3);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-size: 1.25rem; font-weight: 600;
}
.logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.user-menu { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; text-decoration: none;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--gradient); color: white;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--primary-glow); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-elevated); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; color: var(--primary-hover); cursor: pointer; font: inherit; text-decoration: underline; }

.credit-badge {
  background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 20px;
  font-size: 0.85rem; font-weight: 600; color: var(--primary-hover);
}

/* Hero */
.hero {
  padding: 80px 0 100px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.15) 0%, transparent 60%);
}
.hero-badge {
  display: inline-block; padding: 6px 16px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 20px; font-size: 0.85rem; color: var(--primary-hover);
  margin-bottom: 24px;
}
.hero h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.15; margin-bottom: 20px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: 1.15rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 48px; justify-content: center; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.8rem; font-weight: 800; }
.stat span { font-size: 0.85rem; color: var(--text-muted); }

/* Features */
.features, .pricing { padding: 80px 0; }
.features h2, .pricing h2 { text-align: center; font-size: 2rem; margin-bottom: 48px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: var(--primary); transform: translateY(-4px); }
.feature-icon { font-size: 2rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 700px; margin: 0 auto; }
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px; text-align: center;
  position: relative;
}
.pricing-card.featured { border-color: var(--primary); box-shadow: 0 0 40px var(--primary-glow); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--gradient); padding: 4px 16px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 700;
}
.pricing-card h3 { margin-bottom: 16px; }
.price { font-size: 2.5rem; font-weight: 800; margin-bottom: 24px; }
.price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-card ul { list-style: none; text-align: left; margin-bottom: 28px; }
.pricing-card li { padding: 8px 0; color: var(--text-muted); font-size: 0.9rem; }

.footer { padding: 32px 0; text-align: center; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--border); }
.footer-inner { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--primary); }
.footer-contact a { color: var(--primary); }

.legal-page { padding: 48px 24px 64px; max-width: 800px; }
.legal-page h1 { font-size: 2rem; margin-bottom: 8px; }
.legal-updated { color: var(--text-muted); margin-bottom: 32px; }
.legal-section { margin-bottom: 28px; }
.legal-section h2 { font-size: 1.1rem; margin-bottom: 12px; }
.legal-section ul { padding-left: 20px; color: var(--text-muted); }
.legal-section li { margin-bottom: 8px; }
.legal-back { margin-top: 32px; }
.legal-back a { color: var(--primary); }

.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 32px; }
.contact-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.contact-card h3 { margin-bottom: 8px; }
.contact-hint { font-size: 0.85rem; color: var(--text-muted); }

.checkbox-group { margin: 8px 0 16px; }
.checkbox-label { display: flex; gap: 8px; align-items: flex-start; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.checkbox-label input { margin-top: 3px; }
.checkbox-label a { color: var(--primary); }

.security-alerts { margin-bottom: 20px; }
.security-alert {
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 8px;
}
.row-error { background: rgba(239, 68, 68, 0.06); }

.panel-hint { color: var(--text-muted); font-size: 0.9rem; margin: -8px 0 16px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.backup-notes { color: var(--text-muted); font-size: 0.85rem; padding-left: 20px; }
.backup-notes li { margin-bottom: 6px; }
.backup-notes a { color: var(--primary); }

/* Dashboard */
.dashboard-body { background: var(--bg); }
.dashboard { padding: 32px 24px 64px; }
.dashboard-header { margin-bottom: 32px; }
.dashboard-header h1 { font-size: 1.8rem; }
.dashboard-header p { color: var(--text-muted); }

.status-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.status-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.status-card.used { opacity: 0.6; }
.status-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }
.status-value { font-size: 1.4rem; font-weight: 700; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; margin-bottom: 24px;
}
.panel h2 { font-size: 1.1rem; margin-bottom: 20px; }
.panel-main { min-height: 400px; }

.tool-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: -8px 0 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 5;
}
.tool-tab {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 999px;
  padding: 8px 14px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
  pointer-events: auto; position: relative; z-index: 6;
}
.tool-tab:hover { color: var(--text); border-color: var(--primary); }
.tool-tab.active {
  color: #fff; border-color: transparent;
  background: var(--gradient);
}
.tool-desc { color: var(--text-muted); font-size: 0.9rem; margin: -12px 0 20px; }

/* Upload */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px; text-align: center; margin-bottom: 24px;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.upload-zone.dragover { border-color: var(--primary); background: rgba(99,102,241,0.05); }
.upload-zone.has-file { padding: 16px; cursor: default; }
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-hint { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }
.file-preview { width: 100%; }
.preview-layout { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.video-preview {
  width: 100%; max-height: 280px; border-radius: var(--radius);
  background: #000; object-fit: contain;
}
.preview-meta {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  text-align: left;
}
.preview-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.file-name { font-weight: 600; word-break: break-all; }
.file-size { color: var(--text-muted); font-size: 0.85rem; }
.file-duration { color: var(--primary-hover); font-size: 0.85rem; font-weight: 600; }

/* Form */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.input {
  width: 100%; padding: 12px 16px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: inherit; font-size: 0.95rem;
}
.input:focus { outline: none; border-color: var(--primary); }
.password-field { position: relative; }
.password-field .input { width: 100%; padding-right: 42px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  opacity: 0.6; padding: 8px; line-height: 0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s, color 0.15s;
}
.password-toggle:hover { color: var(--text); opacity: 1; background: transparent; }
.password-toggle:focus-visible { outline: none; opacity: 1; color: var(--primary); }
.password-toggle .hidden { display: none; }
.input-row { display: flex; align-items: center; gap: 8px; }
.input-row .input { max-width: 120px; }
.input-suffix { color: var(--text-muted); }
.folder-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.folder-name { font-size: 0.85rem; color: var(--text-muted); }

.quality-options { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.quality-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; background: var(--bg-elevated);
}
.quality-option:has(input:checked) { border-color: var(--primary); background: rgba(99, 102, 241, 0.08); }
.quality-option input { margin-top: 3px; accent-color: var(--primary); }
.quality-option span { font-size: 0.9rem; line-height: 1.4; }

/* Progress */
.progress-area { margin-top: 24px; }
.progress-bar {
  height: 8px; background: var(--bg-elevated); border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%; background: var(--gradient);
  transition: width 0.3s; border-radius: 4px;
}
.progress-text { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; text-align: center; }

/* Result */
.result-area {
  margin-top: 24px; padding: 24px;
  background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius);
}
.result-area h3 { color: var(--success); margin-bottom: 8px; }
.result-actions { display: flex; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.pc-download-panel {
  margin: 16px 0; padding: 16px; border: 1px solid var(--primary);
  border-radius: var(--radius); background: rgba(99, 102, 241, 0.06);
}
.pc-download-title { font-weight: 700; margin-bottom: 10px; }
.pc-download-steps { margin: 0 0 12px 18px; font-size: 0.9rem; color: var(--text-muted); }
.pc-download-steps li { margin-bottom: 6px; }
.pc-cmd {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; font-size: 0.78rem;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
  margin-bottom: 12px; color: var(--text);
}
.helper-ok { color: var(--success); font-weight: 600; }
.software-intro {
  font-size: 0.95rem; line-height: 1.55; margin-bottom: 14px;
  color: var(--text); padding: 12px 14px;
  background: var(--bg-elevated); border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}
.software-price { font-size: 1.1rem; margin-bottom: 10px; }
.software-link {
  display: block; word-break: break-all; color: var(--primary-hover);
  font-size: 0.88rem; margin-top: 6px;
}
.software-owned { margin-top: 8px; }

/* Overlay editor (Logo / Blur / Text) */
.overlay-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.overlay-text-opts {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px;
}
.overlay-text-opts .input { flex: 1; min-width: 140px; max-width: 280px; }
.overlay-text-opts input[type=color] {
  width: 44px; height: 40px; border: 1px solid var(--border); border-radius: 8px;
  background: transparent; padding: 2px; cursor: pointer;
}
.overlay-text-opts input[type=number] { max-width: 90px; }
.overlay-opacity-opts {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.overlay-opacity-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-muted); white-space: nowrap;
}
.overlay-opacity-label input[type=range] {
  width: 100px; accent-color: var(--primary); cursor: pointer;
}
.overlay-opacity-label span { min-width: 40px; font-weight: 600; color: var(--text); }
.overlay-stage-wrap { margin-top: 8px; }
.overlay-stage {
  position: relative; width: 100%; max-width: 360px; margin: 0 auto;
  background: #0a0a0a; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); aspect-ratio: 9 / 16;
}
.overlay-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #000; display: block;
}
.overlay-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
}
.overlay-item {
  position: absolute; pointer-events: auto; cursor: move;
  border: none;
  outline: 1.5px dashed rgba(255,255,255,0.75);
  outline-offset: -1px;
  box-sizing: border-box;
  user-select: none; touch-action: none;
}
.overlay-item.selected {
  outline-color: #60a5fa; outline-style: solid;
  box-shadow: none;
}
.overlay-item[data-type=blur] {
  background: rgba(120,120,120,0.35); backdrop-filter: blur(6px);
}
.overlay-item[data-type=logo] img {
  /* fill khớp canvas xuất (không contain — tránh lệch tỷ lệ) */
  width: 100%; height: 100%; object-fit: fill; display: block; pointer-events: none;
}
.overlay-item[data-type=text] {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85); padding: 4px;
  word-break: break-word; line-height: 1.2;
}
.overlay-handle {
  position: absolute; width: 12px; height: 12px; right: -6px; bottom: -6px;
  background: #60a5fa; border: 2px solid #fff; border-radius: 2px;
  cursor: nwse-resize; z-index: 3;
}
.overlay-stage-actions {
  display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap;
}
.overlay-item-list {
  list-style: none; margin: 12px 0 0; padding: 0; font-size: 0.85rem;
}
.overlay-item-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 6px; background: var(--bg-elevated);
}
.overlay-item-list button {
  background: none; border: none; color: var(--danger, #ef4444); cursor: pointer; font-size: 0.85rem;
}

/* Podcast */
.podcast-uploads { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.podcast-volume-opts {
  margin: 4px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.podcast-volume-opts .form-hint { margin: 6px 0 0; font-size: 0.78rem; }
.ai-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
  font-family: inherit;
}
.ai-result-box { margin: 12px 0; }
.ai-result-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
@media (max-width: 900px) {
  .podcast-wave-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.podcast-wave-opt {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  padding: 6px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-elevated); cursor: pointer; color: var(--text-muted); font-size: 0.72rem;
}
.podcast-wave-opt.active { border-color: var(--primary); color: var(--text); box-shadow: 0 0 0 1px var(--primary); }
.podcast-wave-opt img {
  width: 100%; height: 48px; object-fit: contain; border-radius: 6px;
  background:
    linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
    linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
    linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-color: #1a1a1a;
}
.podcast-stage-wrap { margin-top: 8px; }
.podcast-stage {
  position: relative; width: 360px; max-width: 100%; margin: 0 auto;
  background: #0a0a0a; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.podcast-bg {
  display: block; width: 100%; height: 100%; object-fit: cover; background: #111;
}
.podcast-layer { position: absolute; inset: 0; z-index: 2; }
.podcast-item {
  position: absolute; pointer-events: auto; cursor: move;
  outline: 1.5px dashed rgba(255,255,255,0.75); outline-offset: -1px;
  box-sizing: border-box; user-select: none; touch-action: none;
}
.podcast-item.selected { outline-color: #60a5fa; outline-style: solid; }
.podcast-item img { width: 100%; height: 100%; display: block; pointer-events: none; object-fit: fill; }
.podcast-text {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,0.85);
  padding: 4px; word-break: break-word; line-height: 1.2;
}
@media (max-width: 640px) {
  .podcast-wave-picker { grid-template-columns: repeat(2, 1fr); }
}
.segment-list { list-style: none; max-height: 200px; overflow-y: auto; }
.segment-list li {
  padding: 8px 12px; background: var(--bg-elevated);
  border-radius: 8px; margin-bottom: 6px; font-size: 0.85rem;
  display: flex; justify-content: space-between;
}

/* Bank info */
.bank-info { background: var(--bg-elevated); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.bank-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.85rem; }
.bank-row span { color: var(--text-muted); }
.copyable { cursor: pointer; }
.copyable:hover { color: var(--primary-hover); }
.highlight { color: var(--warning); }
.bank-note, .bank-rate { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.topup-form { margin-top: 16px; }

/* Transactions */
.tx-list { max-height: 300px; overflow-y: auto; }
.tx-item {
  padding: 12px; background: var(--bg-elevated);
  border-radius: 8px; margin-bottom: 8px;
}
.tx-main { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.9rem; }
.tx-credits.positive { color: var(--success); }
.tx-credits.negative { color: var(--danger); }
.tx-meta { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.tx-status { text-transform: capitalize; }
.status-pending { color: var(--warning); }
.status-completed { color: var(--success); }
.status-rejected { color: var(--danger); }
.empty-text { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 20px; }

.hidden { display: none !important; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  padding: 14px 24px; border-radius: var(--radius);
  background: var(--bg-elevated); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 0.9rem;
  animation: slideIn 0.3s ease;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Login page */
.auth-form { margin-bottom: 16px; }
.auth-switch { text-align: center; font-size: 0.9rem; color: var(--text-muted); margin-top: 16px; }
.auth-switch a { color: var(--primary-hover); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }
.avatar-letter {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient); display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: white;
}

.login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 50%), var(--bg);
}
.login-page { width: 100%; max-width: 440px; padding: 24px; }
.login-body .footer { width: 100%; max-width: 440px; border-top: none; padding: 8px 24px 32px; }
.login-logo { justify-content: center; margin-bottom: 32px; }
.login-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
}
.login-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: 8px; }
.login-subtitle { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.google-signin-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.google-picker-btn { width: 100%; max-width: 320px; }
.login-or { color: var(--text-muted); font-size: 0.85rem; margin: 8px 0; }
.login-hint { font-size: 0.75rem; color: var(--text-muted); text-align: center; max-width: 300px; }
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px; margin-bottom: 4px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: #1f1f1f; font-weight: 600; font-size: 0.95rem;
  text-decoration: none; transition: background .15s, box-shadow .15s, border-color .15s;
}
.btn-google:hover {
  background: #f7f7f7; border-color: #dadce0; box-shadow: 0 1px 2px rgba(0,0,0,.06);
  color: #1f1f1f;
}
.btn-google .google-icon { flex-shrink: 0; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 16px; color: var(--text-muted); font-size: 0.82rem;
}
.auth-divider::before,
.auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.google-disabled-hint { margin: 0 0 14px; }
.trial-note {
  display: flex; gap: 12px; margin-top: 28px; padding: 16px;
  background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius); font-size: 0.85rem;
}
.trial-note strong { display: block; margin-bottom: 4px; }
.trial-note p { color: var(--text-muted); margin: 0; }
.back-link { display: block; text-align: center; margin-top: 24px; color: var(--text-muted); font-size: 0.9rem; text-decoration: none; }
.back-link:hover { color: var(--text); }

.alert { padding: 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9rem; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); }
.alert-info { background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2); }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.label-row label { margin-bottom: 0; }
.forgot-link { font-size: 0.8rem; color: var(--primary-hover); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.alert a { color: var(--primary-hover); }
.alert code { background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; }

.setup-page { max-width: 560px; }
.setup-card { text-align: left; }
.setup-steps { padding-left: 20px; margin-bottom: 24px; }
.setup-steps li { margin-bottom: 20px; }
.setup-steps p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.code-block {
  background: var(--bg-elevated); border-radius: var(--radius);
  padding: 12px 16px; margin-top: 8px; font-size: 0.85rem;
}
.code-block div { margin-bottom: 8px; }
.code-block span { color: var(--text-muted); display: block; font-size: 0.75rem; margin-bottom: 4px; }
.code-block code { color: var(--primary-hover); word-break: break-all; }

/* Amount presets */
.amount-presets { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.preset-btn {
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-muted);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.preset-btn:hover, .preset-btn.active { border-color: var(--primary); color: var(--primary-hover); }

/* QR Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.modal-content {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; max-width: 420px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg-elevated); border: none; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1rem;
}
.modal-close:hover { color: var(--text); }
.qr-modal h2 { font-size: 1.2rem; text-align: center; margin-bottom: 4px; }
.qr-subtitle { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 20px; }
.qr-image-wrap {
  background: white; border-radius: var(--radius); padding: 16px;
  display: flex; justify-content: center; margin-bottom: 20px;
}
.qr-image-wrap img { width: 260px; height: 260px; object-fit: contain; }
.qr-details { background: var(--bg-elevated); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.qr-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.85rem; gap: 12px; }
.qr-row span { color: var(--text-muted); flex-shrink: 0; }
.qr-row strong { text-align: right; word-break: break-all; }
.qr-row .positive { color: var(--success); }
.qr-note { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-bottom: 16px; }
.qr-polling { font-size: 0.85rem; color: var(--warning); text-align: center; margin-top: 12px; }

.qr-countdown {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px; margin-bottom: 12px;
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
}
.qr-countdown.expired { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.countdown-label { font-size: 0.75rem; color: var(--text-muted); }
.countdown-time { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--warning); }
.qr-countdown.expired .countdown-time { color: var(--danger); }

/* Admin panel */
.admin-wrap h1 { margin-bottom: 4px; }
.admin-header-row { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.admin-updated { font-size: 0.8rem; color: var(--text-muted); }
.panel-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.panel-head-row h2 { margin-bottom: 0; }
.live-badge { font-size: 0.75rem; color: var(--success); font-weight: 600; }
.live-badge.syncing { color: var(--warning); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
.admin-settings-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: end; }
@media (max-width: 768px) { .admin-settings-form { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; margin-top: 12px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table th { color: var(--text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }
.admin-table tr:hover { background: var(--bg-elevated); }
.admin-table .row-locked { opacity: 0.6; }
.badge-admin { font-size: 0.65rem; background: var(--primary); color: white; padding: 2px 6px; border-radius: 4px; margin-left: 4px; }
.test-email-result { margin-top: 12px; font-size: 0.85rem; }
.test-email-result.positive { color: var(--success); }
.test-email-result.negative { color: var(--danger); }

.maintenance-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 60%), var(--bg);
}
.maintenance-wrap {
  text-align: center; max-width: 480px; padding: 48px 32px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.maintenance-icon { font-size: 3rem; margin-bottom: 16px; }
.maintenance-wrap h1 { font-size: 1.5rem; margin-bottom: 12px; }
.maintenance-wrap p { color: var(--text-muted); margin-bottom: 8px; }
.maintenance-note { color: var(--success); font-size: 0.9rem; font-weight: 500; }
.maintenance-hint { font-size: 0.8rem; margin-top: 16px; }
.maintenance-spinner {
  width: 36px; height: 36px; margin: 24px auto 0;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-stats { flex-direction: column; gap: 16px; }
}
