@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');

:root {
  /* Light — pure white, neutral greys, no amber */
  --accent: #111827;
  --accent-dark: #000000;
  --accent-ink: #ffffff;
  --accent-soft: #f3f4f6;
  --bolt: #6b7280;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --ok: #059669;
  --danger: #dc2626;
  --warn: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.06);
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
}

/* Dark theme — enabled by <html data-theme="dark"> */
html[data-theme="dark"] {
  --accent: #f5b52a;
  --accent-dark: #ffd873;
  --accent-ink: #3a2b06;
  --accent-soft: #2a2213;
  --bolt: #8b9dff;
  --ink: #f2ead6;
  --muted: #a99d84;
  --line: #383023;
  --bg: #141007;
  --panel: #1c1610;
  --panel-2: #221b12;
  --ok: #4cd787;
  --danger: #ff6b6b;
  --warn: #ffc266;
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 4px 14px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; line-height: 1.25; color: var(--ink); }
h1 { font-size: 28px; margin: 0 0 6px; }
h2 { font-size: 22px; margin: 26px 0 8px; }
h3 { font-size: 17px; margin: 14px 0 4px; }

p { margin: 0.5em 0; }
small { color: var(--muted); }
code, pre, .file-content, .terminal-screen, .file-path, .mono { font-family: var(--mono); font-size: 0.88em; }

a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }

/* ---- Top bar ---- */
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { font-weight: 700; font-size: 19px; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--bolt)); display: inline-block; box-shadow: 0 2px 8px rgba(245,181,42,0.5); }
.brand-logo { width: 30px; height: 30px; display: inline-block; object-fit: contain; vertical-align: middle; flex: none; }
.topnav { display: flex; gap: 18px; font-size: 15px; font-weight: 500; align-items: center; }
.topnav a { color: var(--ink); padding: 4px 2px; }
.topnav a:hover { color: var(--accent); text-decoration: none; }

/* ---- Layout ---- */
.page { max-width: 1180px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: start; }
.sidebar { position: sticky; top: 76px; font-size: 15px; }
.sidebar h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 18px 0 6px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 2px 0; }
.sidebar a { display: block; padding: 9px 12px; border-radius: var(--radius); color: var(--ink); }
.sidebar a:hover { background: var(--panel-2); color: var(--accent); text-decoration: none; }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.main { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow); }
.subtitle { color: var(--muted); font-size: 15px; margin: 0 0 20px; }

.hero { border: 1px solid var(--line); background: var(--accent-soft); border-radius: var(--radius); padding: 24px 28px; margin: 0 0 20px; }
.hero h1 { margin: 0 0 4px; }
.hero p { color: var(--muted); margin: 0; }

.cardgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 16px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.card dd { margin: 6px 0 0; font-size: 22px; font-weight: 700; }

.info-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.info-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.info-table td:first-child { color: var(--muted); font-weight: 500; width: 180px; }

.progress { background: #f3f4f6; border-radius: 999px; height: 10px; overflow: hidden; }
html[data-theme="dark"] .progress { background: #2c2518; }
.progress > div { height: 100%; border-radius: 999px; background: var(--accent); }
.progress > div.warn { background: var(--warn); }
.progress > div.danger { background: var(--danger); }

table.data-table, table.file-list { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 15px; }
table.data-table th, table.file-list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 9px 12px; border-bottom: 2px solid var(--line); }
table.file-list td, table.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--panel-2); }

/* ---- Buttons ---- */
.btn {
  display: inline-block; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  padding: 10px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.btn:hover { background: var(--panel-2); border-color: #d1d5db; text-decoration: none; color: var(--ink); }
.btn-primary { background: #111827; border-color: #111827; color: #ffffff; }
.btn-primary:hover { background: #1f2937; border-color: #1f2937; color: #ffffff; }
html[data-theme="dark"] .btn:hover { border-color: #4b4134; }
html[data-theme="dark"] .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
html[data-theme="dark"] .btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-link { background: transparent; border: none; color: var(--accent); text-decoration: underline; padding: 4px 0; box-shadow: none; }
.inline-form { margin-top: 6px; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); color: var(--danger); }
html[data-theme="dark"] .btn-danger { border-color: #5a2b2b; }
html[data-theme="dark"] .btn-danger:hover { background: #2a1414; }
.btn-sm { font-size: 13px; padding: 5px 12px; }
.btn-lg { padding: 13px 26px; font-size: 17px; }

/* ---- Notes ---- */
.note { border: 1px solid var(--line); background: var(--panel-2); padding: 13px 16px; border-radius: var(--radius); font-size: 15px; margin: 14px 0; }
.warn-note { border-color: #fde68a; background: #fffbeb; }
.error-note { border-color: #fecaca; background: #fef2f2; }
.ok-note { border-color: #a7f3d0; background: #ecfdf5; }
html[data-theme="dark"] .warn-note { border-color: var(--warn); background: #2a1f10; }
html[data-theme="dark"] .error-note { border-color: #7a3333; background: #2a1414; }
html[data-theme="dark"] .ok-note { border-color: #2f6b4a; background: #12241b; }

/* ---- Forms ---- */
.form-row { margin: 14px 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-row label { width: 190px; font-weight: 600; color: #374151; }
input[type="text"], input[type="password"], input[type="email"], input[type="tel"],
input[type="number"], input[type="file"], select, textarea {
  font-family: inherit; font-size: 15px; padding: 10px 13px;
  border: 1px solid #d1d5db; border-radius: var(--radius); background: #ffffff; color: #374151; min-width: 260px;
}
input::placeholder, textarea::placeholder { color: #9ca3af; }
input:focus, select:focus, textarea:focus { border-color: #9ca3af; outline: none; box-shadow: 0 0 0 3px rgba(17,24,39,0.08); }
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="file"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border-color: #4b4134; background: #120e08; color: #f2ead6;
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,181,42,0.2); }
html[data-theme="dark"] .form-row label { color: #f2ead6; }

.breadcrumb { font-size: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 13px; margin-bottom: 16px; }
.toolbar { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.toolbar form { display: flex; gap: 8px; align-items: end; }

.icon-dir { color: var(--accent); }
.icon-lock { color: var(--danger); }

.file-view-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.file-path { font-size: 14px; color: var(--muted); }
.file-content { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; white-space: pre-wrap; word-break: break-word; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.file-viewer img { max-width: 100%; height: auto; border-radius: var(--radius); }
.file-viewer video, .file-viewer audio { max-width: 100%; }
.file-viewer iframe { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---- Terminal ---- */
.terminal-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-top: 14px; border: 1px solid var(--line); }
.terminal-bar { background: #0e0b06; color: var(--ink); padding: 10px 16px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.terminal-bar a { color: var(--accent); }
.terminal-screen { background: #0a0805; color: #e6e0d2; padding: 16px; height: 440px; overflow-y: auto; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.terminal-screen .prompt { color: var(--accent); }
.terminal-input { display: flex; align-items: center; gap: 8px; border-top: 1px solid #262033; background: #0a0805; padding: 12px 16px; }
.terminal-input .prompt { color: var(--accent); font-family: var(--mono); }
.terminal-input input { flex: 1; background: transparent; color: #f0eadb; border: none; outline: none; font-family: var(--mono); font-size: 14px; min-width: 0; padding: 0; box-shadow: none; }
.terminal-input input:focus { box-shadow: none; border: none; }

.tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.tab { padding: 9px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 15px; }
.tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tab:hover { text-decoration: none; border-color: var(--accent); }

.metric { font-weight: 700; }
.center { text-align: center; }
.hint { font-size: 14px; color: var(--muted); }

.badge { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #f3f4f6; color: var(--muted); margin-left: 6px; font-weight: 600; }
.badge-ok { background: #ecfdf5; color: var(--ok); }
.badge-lock { background: #fef2f2; color: var(--danger); }
.badge-warn { background: #fffbeb; color: var(--warn); }
html[data-theme="dark"] .badge { background: #2c2518; }
html[data-theme="dark"] .badge-ok { background: #16301f; }
html[data-theme="dark"] .badge-lock { background: #3a1515; }
html[data-theme="dark"] .badge-warn { background: #3a2a12; }
.expiry-soon { color: var(--danger); font-weight: 600; }
.expiry-ok { color: var(--ok); }

/* PayPal buttons */
.btn-paypal { background: #ffc439; border-color: #ffc439; color: #003087; font-weight: 600; }
.btn-paypal:hover { background: #f2b92c; border-color: #f2b92c; color: #003087; }

/* ---- Pricing ---- */
.pricing { display: flex; flex-wrap: wrap; gap: 16px; margin: 20px 0; }
.plan { flex: 1 1 220px; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; position: relative; min-width: 220px; box-shadow: var(--shadow); }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow-lg); }
.plan.featured::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(90deg, var(--accent), var(--bolt)); }
.plan .name { font-weight: 700; font-size: 17px; }
.plan .price { font-size: 30px; font-weight: 700; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.plan .desc { font-size: 14px; color: var(--muted); }
.plan ul { margin: 4px 0; padding-left: 20px; font-size: 15px; color: var(--ink); }
.plan ul li { margin: 4px 0; }
.plan .btn { margin-top: auto; }
.plan-action { margin-top: 4px; }
.inline-select { min-width: 0; padding: 8px 10px; font-size: 15px; }
.plan-desc { margin: 6px 0 10px; color: var(--muted); font-size: 14px; }
.plan .tag { position: absolute; top: -11px; right: 12px; background: var(--accent); color: var(--accent-ink); font-size: 12px; padding: 4px 12px; border-radius: 999px; font-weight: 600; }

/* ---- Homepage landing ---- */
.home { max-width: 1180px; margin: 0 auto; padding: 24px; }
.hero-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  padding: 60px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.hero-inner { max-width: 640px; margin: 0 auto; }
.eyebrow {
  display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.hero-logo { width: 72px; height: 72px; margin-bottom: 16px; border-radius: 16px; }
.hero-section h1 { font-size: 46px; margin: 0 0 12px; line-height: 1.05; }
.hero-subtitle { font-size: 19px; color: var(--muted); margin: 0 0 30px; max-width: 560px; margin-inline: auto; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 34px; }
.feature-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 24px; text-align: center; box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 32px; margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 6px; font-size: 17px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 15px; }

.home-pricing { text-align: center; }
.home-pricing h2 { font-size: 30px; margin-bottom: 4px; }
.home-pricing .pricing { justify-content: center; text-align: left; }
.lang-form { margin-left: 6px; display: inline-flex; align-items: center; }
.lang-form select { min-width: 0; padding: 6px 9px; font-size: 14px; }

/* ---- Theme toggle button (header) ---- */
.theme-toggle {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  width: 30px; height: 30px; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; font-size: 16px; color: var(--accent);
  transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ---- Hero floating icon boxes (Figma-style) ---- */
.hero-icons {
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
  margin: 30px 0 36px;
}
.hero-icon-box {
  width: 100px; height: 100px; border: 1.5px solid var(--line);
  border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background: var(--panel); position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hero-icon-box:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hero-icon-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
}
/* Anchor dots at corners (Figma-style selection handles) */
.hero-icon-box::before, .hero-icon-box::after,
.hero-icon-box .hero-icon-dot-tl, .hero-icon-box .hero-icon-dot-br {
  content: ""; position: absolute; width: 6px; height: 6px;
  border: 1.5px solid var(--line); background: var(--panel); border-radius: 1px;
}
.hero-icon-box::before { top: -3px; left: -3px; }
.hero-icon-box::after { bottom: -3px; right: -3px; }

/* ---- Metrics row ---- */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 34px;
}
.metric-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 16px; text-align: center;
  box-shadow: var(--shadow);
}
.metric-num {
  display: block; font-size: 26px; font-weight: 700; color: var(--accent);
  margin-bottom: 4px;
}
.metric-label {
  display: block; font-size: 13px; color: var(--muted); font-weight: 500;
}

/* ---- Tech logos footer ---- */
.tech-logos {
  border-top: 1px solid var(--line); padding: 22px 0 10px;
  margin-top: 10px;
}
.tech-logos-row {
  display: flex; justify-content: center; gap: 28px; flex-wrap: wrap;
}
.tech-logo {
  font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em;
  opacity: 0.7;
}

/* ---- Settings page ---- */
.settings-theme-row { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.settings-theme-btn {
  padding: 8px 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-weight: 600; cursor: pointer;
  font-family: inherit; font-size: 14px;
}
.settings-theme-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.settings-theme-btn:hover { border-color: var(--accent); }

@media (max-width: 820px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .topnav { gap: 12px; font-size: 14px; flex-wrap: wrap; }
  .main { padding: 20px; }
  .home { padding: 16px; }
  .hero-icons { gap: 10px; }
  .hero-icon-box { width: 80px; height: 80px; }
  .hero-icon-box svg { width: 30px; height: 30px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
