:root {
  --bg: #0b0d12;
  --card: #12151d;
  --card-2: #171b26;
  --border: #232838;
  --text: #e8ebf4;
  --muted: #8b93a7;
  --accent-a: #7b5cff;
  --accent-b: #2fd4ff;
  --accent-grad: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  --green: #3ddc84;
  --red: #ff5c5c;
  --amber: #ffc24d;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(123, 92, 255, 0.15), transparent),
    radial-gradient(ellipse 40% 30% at 85% 0%, rgba(47, 212, 255, 0.08), transparent);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.center { text-align: center; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  max-width: 980px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.mascot-mark {
  width: 34px; height: 34px; display: block;
}
.wordmark { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.5px; }
.wordmark span {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: 0.82rem; color: var(--muted);
  background: var(--card);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill-online .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pill-online { color: var(--text); }
.pill-offline .dot { background: var(--red); }

.banner {
  max-width: 920px; margin: 0 auto 18px;
  background: rgba(255, 194, 77, 0.1); border: 1px solid rgba(255, 194, 77, 0.4);
  color: var(--amber); border-radius: 12px; padding: 12px 18px; font-size: 0.9rem;
  white-space: pre-line;
}

/* ---------- layout ---------- */
main { max-width: 920px; margin: 0 auto; padding: 0 24px 80px; }

.hero { text-align: center; margin: 28px 0 32px; }
.mascot-hero {
  width: 132px; height: 148px; display: block; margin: 0 auto 6px;
  filter: drop-shadow(0 10px 30px rgba(123, 92, 255, 0.4));
}
.hero h1 { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.8px; }
.hero h1 em {
  font-style: normal;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin-top: 10px; font-size: 1.02rem; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}

h2 { font-size: 1.05rem; font-weight: 700; margin: 28px 0 14px; }
h3 { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- drop zone ---------- */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 36px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}
.drop-zone:hover, .drop-zone:focus-visible { border-color: var(--accent-a); }
.drop-zone.dragover {
  border-color: var(--accent-b);
  background: rgba(47, 212, 255, 0.06);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 212, 255, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(47, 212, 255, 0.05); }
}
.mascot-idle {
  width: 68px; height: 76px; margin: 0 auto 10px; display: block;
  filter: drop-shadow(0 6px 18px rgba(123, 92, 255, 0.35));
}
#dropIdle strong { display: block; margin-bottom: 6px; font-size: 1.05rem; }
#dropIdle .muted { font-size: 0.82rem; }

#dropPreview { display: flex; align-items: center; gap: 18px; justify-content: center; }
#logoThumb {
  width: 84px; height: 84px; object-fit: contain;
  background:
    conic-gradient(#1c2130 25%, #141824 25% 50%, #1c2130 50% 75%, #141824 75%) 0 0/16px 16px;
  border-radius: 10px; border: 1px solid var(--border); padding: 6px;
}
.file-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

/* ---------- presets ---------- */
.preset-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 640px) { .preset-grid { grid-template-columns: repeat(2, 1fr); } }

.preset-card {
  border: 2px solid var(--border); border-radius: 12px; overflow: hidden;
  cursor: pointer; background: var(--card-2);
  transition: border-color 0.15s, transform 0.15s;
}
.preset-card:hover { transform: translateY(-2px); }
.preset-card.selected { border-color: var(--accent-b); box-shadow: 0 0 0 3px rgba(47, 212, 255, 0.15); }
.preset-thumb { height: 74px; }
.preset-label { padding: 10px 12px; }
.preset-label strong { display: block; font-size: 0.9rem; }
.preset-label span { font-size: 0.74rem; color: var(--muted); }

/* ---------- options ---------- */
.options-row { display: flex; gap: 28px; margin-top: 24px; flex-wrap: wrap; }

.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.segmented button {
  background: transparent; border: none; color: var(--muted);
  padding: 9px 16px; font-size: 0.88rem; cursor: pointer; font-family: inherit;
  border-right: 1px solid var(--border);
}
.segmented button:last-child { border-right: none; }
.segmented button.selected { background: var(--card-2); color: var(--text); font-weight: 600; }
.segmented button .tag { font-size: 0.7rem; color: var(--muted); margin-left: 5px; }
.segmented button:disabled { opacity: 0.35; cursor: not-allowed; }

.notes { margin-top: 24px; border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.notes summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.notes textarea {
  width: 100%; margin-top: 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  font-family: inherit; font-size: 0.9rem; resize: vertical;
}
.notes textarea:focus { outline: none; border-color: var(--accent-a); }
.radio-row { display: flex; gap: 22px; margin-top: 10px; font-size: 0.84rem; color: var(--muted); }
.radio-row input { accent-color: var(--accent-a); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 1px solid transparent;
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  padding: 11px 22px; cursor: pointer; text-decoration: none; color: var(--text);
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent-grad); color: #fff; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
.btn-big { width: 100%; padding: 16px; font-size: 1.08rem; margin-top: 26px; }

#generateHint { margin-top: 10px; font-size: 0.84rem; }

/* ---------- progress ---------- */
.progress-stage { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.mascot-progress {
  width: 110px; height: 124px; display: block; flex-shrink: 0; margin: 0 auto;
  filter: drop-shadow(0 8px 22px rgba(123, 92, 255, 0.4));
}
.progress-frame {
  max-width: 320px; width: 100%; border-radius: 12px; border: 1px solid var(--border);
}
.progress-info { flex: 1; min-width: 260px; }
.stage-label { font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; }

.bar {
  height: 10px; background: var(--card-2); border-radius: 999px; overflow: hidden;
  border: 1px solid var(--border);
}
.bar-fill {
  height: 100%; border-radius: 999px;
  background: var(--accent-grad);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  transition: width 0.5s ease;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bar-fill { animation: none; }
  .drop-zone.dragover { animation: none; }
}
.bar-meta { display: flex; justify-content: space-between; margin: 8px 2px 14px; font-size: 0.84rem; }
#pctLabel { font-weight: 700; }
#cancelBtn { margin-top: 14px; }

/* ---------- result ---------- */
#resultVideo {
  width: 100%; max-height: 480px; border-radius: 12px; background: #000;
  border: 1px solid var(--border);
}
/* Transparent-style renders: checkerboard behind the alpha so it reads. */
#resultVideo.alpha-checker {
  background: repeating-conic-gradient(#2b313d 0% 25%, #171b23 0% 50%) 50% / 24px 24px;
}
.result-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; gap: 16px; flex-wrap: wrap;
}
.result-actions { display: flex; gap: 10px; }

/* ---------- error ---------- */
.error-box {
  border: 1px solid rgba(255, 92, 92, 0.4); background: rgba(255, 92, 92, 0.07);
  border-radius: 12px; padding: 22px; text-align: center;
}
.error-box strong { display: block; margin-bottom: 8px; }
.error-box p { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; white-space: pre-line; }

/* ---------- history ---------- */
#historySection h2 { margin-top: 44px; }
.history-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px;
}
.history-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; cursor: pointer; position: relative;
  transition: transform 0.15s;
}
.history-card:hover { transform: translateY(-2px); }
.history-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.history-card .hc-meta { padding: 10px 12px; font-size: 0.8rem; }
.history-card .hc-meta strong { display: block; font-size: 0.85rem; }
.history-card .hc-meta span { color: var(--muted); }
.hc-delete {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0, 0, 0, 0.55); border: none; color: #fff;
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  font-size: 0.9rem; line-height: 1; display: none;
}
.history-card:hover .hc-delete { display: block; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 20px; font-size: 0.9rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); z-index: 50;
  max-width: 90vw;
}
.toast.error { border-color: rgba(255, 92, 92, 0.5); }

/* ===== accounts & auth (production) ===== */
.account { display: flex; align-items: center; gap: 10px; }
.plan-badge {
  background: var(--accent-grad); color: #0b0d12; font-weight: 800;
  font-size: 0.68rem; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 999px;
}
/* split layout: form panel left, demo reel right */
.auth-body { margin: 0; }
.auth-split { display: flex; min-height: 100vh; }
.auth-side {
  width: 430px; min-width: 360px; box-sizing: border-box;
  display: flex; flex-direction: column; padding: 26px 34px;
  background: rgba(255,255,255,0.025);
  border-right: 1px solid rgba(255,255,255,0.07);
}
.auth-brand { margin-bottom: 8px; }
.auth-side-inner { margin: auto 0; padding: 24px 0 60px; }
.auth-sub { margin: 6px 0 24px; font-size: 0.92rem; }
.auth-demos {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 34px; box-sizing: border-box;
  background:
    radial-gradient(circle at 20% 15%, rgba(123,92,255,0.14), transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(47,212,255,0.10), transparent 50%);
}
.carousel {
  position: relative; width: 100%; max-width: 880px; margin: 0 auto;
  aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.09); box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  background: #0a0c12;
}
.carousel-stage, .carousel-stage video { position: absolute; inset: 0; width: 100%; height: 100%; }
.carousel-stage video {
  object-fit: cover; opacity: 0; transition: opacity 0.6s ease; pointer-events: none;
}
.carousel-stage video.active { opacity: 1; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18);
  background: rgba(10,12,18,0.55); color: #fff; font-size: 1.4rem; line-height: 1;
  cursor: pointer; backdrop-filter: blur(4px); opacity: 0.75; transition: opacity 0.15s;
}
.carousel-arrow:hover { opacity: 1; }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.carousel-caption {
  position: absolute; left: 14px; bottom: 12px; z-index: 3; font-size: 0.75rem;
  letter-spacing: 0.04em; color: rgba(255,255,255,0.9);
  background: rgba(10,12,18,0.55); padding: 5px 11px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.carousel-caption:empty { display: none; }
.carousel-dots {
  position: absolute; right: 14px; bottom: 14px; z-index: 3; display: flex; gap: 7px;
}
.carousel-dots button {
  width: 9px; height: 9px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.35); padding: 0; transition: background 0.15s, transform 0.15s;
}
.carousel-dots button.active { background: #fff; transform: scale(1.25); }
.demo-note { text-align: center; margin: 18px 0 0; }
@media (max-width: 900px) {
  .auth-demos { display: none; }
  .auth-side { width: 100%; min-width: 0; border-right: none; }
}
.auth-title { font-size: 1.45rem; margin: 0 0 6px; line-height: 1.3; }
.auth-title em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 20px; background: rgba(255,255,255,0.04); border-radius: 12px; padding: 4px; }
.auth-tab {
  flex: 1; padding: 9px 0; border: none; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--muted, #9aa3b5); font-weight: 600; font-size: 0.9rem;
}
.auth-tab.selected { background: rgba(255,255,255,0.09); color: #fff; }
.field { display: block; text-align: left; margin-bottom: 14px; }
.field span { display: block; font-size: 0.8rem; color: var(--muted, #9aa3b5); margin-bottom: 6px; }
.field input {
  width: 100%; box-sizing: border-box; padding: 11px 13px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); color: #fff;
  font-size: 0.95rem;
}
.field input:focus { outline: none; border-color: var(--accent-a); }
.auth-error { color: #ff7b7b; font-size: 0.85rem; margin: 4px 0 12px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; box-sizing: border-box; padding: 11px 0; margin-bottom: 16px;
  background: #fff; color: #1f1f1f; font-weight: 600; font-size: 0.92rem;
  border-radius: 10px; border: 1px solid rgba(255,255,255,0.15); text-decoration: none;
}
.google-btn:hover { background: #f1f3f6; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 2px 0 16px;
  color: var(--muted, #9aa3b5); font-size: 0.75rem; letter-spacing: 0.05em;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.1);
}
.auth-side .btn-big { width: 100%; margin-top: 6px; }

/* ===== modal (change password) ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 6, 10, 0.7); backdrop-filter: blur(3px);
}
.modal-card {
  width: min(400px, 92vw); background: var(--card, #12141c); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 24px 26px; box-shadow: 0 24px 70px rgba(0,0,0,0.55);
}
.modal-card h3 { margin: 0 0 18px; font-size: 1.05rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.auth-link { color: var(--accent-b); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.auth-info { color: var(--green); font-size: 0.85rem; margin: 4px 0 12px; }
