/* ═══════════════════════════════════════════════════════════
   MicroUp — Unified Stylesheet
   Used by: index.php, setup.php (and any future pages)
═══════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --bg:          #0a0a0a;
  --surface:     #111111;
  --surface2:    #1a1a1a;
  --border:      #2a2a2a;
  --text:        #f0f0f0;
  --muted:       #888888;
  --accent:      #4f9cf9;
  --accent-dark: #2563eb;
  --green:       #22c55e;
  --red:         #ef4444;
  --yellow:      #f59e0b;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --max-w:       1100px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.page-wrap  { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
  font-size: 1.2rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.navbar-brand .logo-dot { color: var(--accent); }
.navbar-actions { display: flex; align-items: center; gap: 12px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .18s ease;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost     { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-google {
  background: #fff; color: #3c3c3c;
  padding: 12px 24px; font-size: 1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.btn-google:hover { background: #f5f5f5; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.btn-google svg { width: 20px; height: 20px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { padding: 7px 14px; font-size: .82rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.card-sm { padding: 20px; }

/* ── Badges / Pills ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
}
.badge-blue   { background: rgba(79,156,249,.15); color: var(--accent); }
.badge-green  { background: rgba(34,197,94,.15);  color: var(--green); }
.badge-red    { background: rgba(239,68,68,.15);  color: var(--red); }
.badge-muted  { background: var(--surface2); color: var(--muted); }

/* ── Status dots ────────────────────────────────────────────── */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; background: var(--border);
  transition: background .3s;
}
.status-dot.on  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.off { background: var(--border); }

/* ── Account badge ──────────────────────────────────────────── */
.account-badge {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
  font-size: .85rem;
}
.account-badge img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}
.account-badge .ab-name { font-weight: 600; color: var(--text); }
.account-badge .ab-email { color: var(--muted); font-size: .78rem; }

/* ─────────────────────────────────────────────────────────────
   INDEX PAGE
───────────────────────────────────────────────────────────── */

/* Hero */
.hero {
  text-align: center;
  padding: 100px 24px 80px;
}
.hero-eyebrow {
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800; line-height: 1.15;
  color: var(--text); margin-bottom: 20px;
}
.hero h1 span { color: var(--accent); }
.hero-sub {
  font-size: 1.15rem; color: var(--muted);
  max-width: 600px; margin: 0 auto 40px;
}
.hero-cta { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.hero-product {
  margin: 60px auto 0;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-product-placeholder {
  height: 260px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .9rem;
  background: repeating-linear-gradient(45deg, var(--surface2), var(--surface2) 10px, var(--surface) 10px, var(--surface) 20px);
}

/* Features grid */
.features { padding: 80px 24px; }
.features-title {
  text-align: center; font-size: 1.8rem; font-weight: 700;
  margin-bottom: 48px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.feature-icon { font-size: 1.6rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.feature-card p  { font-size: .88rem; color: var(--muted); line-height: 1.5; }

/* How it works */
.how-it-works { padding: 80px 24px; background: var(--surface); }
.hiw-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.hiw-inner h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 48px; }
.hiw-steps { display: flex; flex-direction: column; gap: 0; text-align: left; }
.hiw-step {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 20px 0; border-bottom: 1px solid var(--border);
}
.hiw-step:last-child { border-bottom: none; }
.hiw-num {
  flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}
.hiw-step h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.hiw-step p  { font-size: .88rem; color: var(--muted); }

/* Login CTA section */
.login-section {
  padding: 80px 24px;
  text-align: center;
}
.login-card {
  max-width: 480px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
}
.login-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.login-card p  { color: var(--muted); font-size: .92rem; margin-bottom: 32px; }
.login-divider { color: var(--muted); font-size: .8rem; margin: 16px 0; }

/* Pricing banner */
.pricing-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  border: 1px solid rgba(79,156,249,.25);
  border-radius: var(--radius);
  padding: 40px; text-align: center;
  max-width: 680px; margin: 0 auto 80px;
}
.pricing-price {
  font-size: 2.8rem; font-weight: 800;
  color: var(--text); margin: 12px 0;
}
.pricing-price span { font-size: 1.2rem; font-weight: 400; color: var(--muted); }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

/* ─────────────────────────────────────────────────────────────
   SETUP PAGE
───────────────────────────────────────────────────────────── */

.setup-header {
  text-align: center;
  padding: 48px 24px 32px;
}
.setup-header h1 { font-size: 1.7rem; font-weight: 700; margin-bottom: 8px; }
.setup-header p  { color: var(--muted); font-size: .95rem; }

/* Steps bar */
.steps-bar {
  display: flex; gap: 0;
  max-width: 560px; margin: 0 auto 40px;
  counter-reset: step;
}
.step-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 8px; position: relative;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute; top: 18px; left: 50%; width: 100%;
  height: 2px; background: var(--border);
  z-index: 0;
}
.step-item.done::after  { background: var(--green); }
.step-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; z-index: 1;
  border: 2px solid var(--border); background: var(--bg);
  color: var(--muted); transition: all .3s;
}
.step-icon.active { border-color: var(--accent); color: var(--accent); background: rgba(79,156,249,.1); }
.step-icon.done   { border-color: var(--green);  color: var(--green);  background: rgba(34,197,94,.1); }
.step-label { font-size: .75rem; color: var(--muted); text-align: center; }
.step-item.active .step-label { color: var(--text); }

/* Setup cards */
.setup-body { max-width: 640px; margin: 0 auto; padding: 0 24px 60px; }
.setup-card { margin-bottom: 20px; }
.setup-card-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.setup-card-header h2 { font-size: 1.05rem; font-weight: 700; }
.setup-card-header p  { font-size: .85rem; color: var(--muted); }

/* Connection pill */
.conn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 18px;
  cursor: pointer; font-size: .88rem; font-weight: 600;
  transition: all .2s; width: 100%; justify-content: center;
  margin-top: 12px;
}
.conn-pill:hover { border-color: var(--accent); color: var(--accent); }
.conn-pill.connected { border-color: var(--green); color: var(--green); background: rgba(34,197,94,.08); }

/* Controls card */
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ctrl-input-row { display: flex; gap: 8px; }
.ctrl-input-row input {
  flex: 1; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 9px 14px; font-size: .88rem;
  outline: none; font-family: var(--font);
}
.ctrl-input-row input:focus { border-color: var(--accent); }
.ctrl-input-row input::placeholder { color: var(--muted); }

/* Status row */
.status-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: 16px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.status-item {
  display: flex; align-items: center; gap: 6px;
  font-size: .82rem; color: var(--muted);
}

/* Log */
.log-box {
  background: #050505; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .78rem; max-height: 220px; overflow-y: auto;
  color: #aaa;
}
.log-entry { padding: 3px 0; border-bottom: 1px solid #111; display: flex; gap: 10px; }
.log-entry:last-child { border-bottom: none; }
.log-time { color: #444; flex-shrink: 0; }
.log-ok   { color: var(--green); }
.log-warn { color: var(--yellow); }
.log-err  { color: var(--red); }

/* Sync / upload panel */
.upload-panel {
  display: none; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-top: 20px;
}
.upload-panel.show { display: block; }
.sync-title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sync-title { font-weight: 700; font-size: 1rem; }
.sync-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
.sync-spinner.idle { animation: none; border-top-color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar-wrap {
  background: var(--surface2); border-radius: 999px;
  height: 10px; overflow: hidden; margin-bottom: 12px; position: relative;
}
.progress-bar-fill {
  height: 100%; background: var(--accent);
  border-radius: 999px; transition: width .4s ease;
}
.sync-stats { display: flex; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.stat-item { font-size: .82rem; color: var(--muted); }
.stat-item strong { color: var(--text); }
.upload-file-list { max-height: 160px; overflow-y: auto; }
.sync-file { display: flex; justify-content: space-between; padding: 4px 0; font-size: .82rem; border-bottom: 1px solid var(--border); }
.sync-file:last-child { border-bottom: none; }
.sf-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 85%; }
.sf-ok   { color: var(--green); }
.sf-err  { color: var(--red); }
.upload-pct-badge { font-size: .78rem; color: var(--muted); text-align: right; margin-bottom: 4px; }

/* Browser warning */
.browser-warn {
  display: none; background: rgba(245,158,11,.1);
  border: 1px solid var(--yellow); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: .88rem; color: var(--yellow);
  margin-bottom: 16px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding: 60px 16px 50px; }
  .hero h1 { font-size: 2rem; }
  .controls-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 20px; }
  .pricing-banner { padding: 28px 20px; }
  .steps-bar { gap: 0; }
  .step-label { font-size: .68rem; }
}
