/* ===== FPSpilot — dark modern theme ===== */
:root {
  --bg: #0b0d12;
  --surface: #141824;
  --surface-2: #1c2233;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef1f8;
  --muted: #98a0b3;
  --primary: #ff5c2b;
  --primary-2: #ff8a3d;
  --accent: #3da5ff;
  --good: #35d07f;
  --bad: #ff4d5e;
  --grad: linear-gradient(120deg, #ff5c2b, #ff8a3d);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #333a4d transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-size: 0.92em; }
.warn { color: var(--bad); }

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 18, 0.92);
  position: sticky; top: 0; z-index: 50;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-logo { border-radius: 7px; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--text); font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary-2); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 6px; }
.inline-form { display: inline; }
.link-btn { background: none; border: 0; color: var(--text); font: inherit; font-size: 0.95rem; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--primary-2); }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-opt { padding: 4px 10px; font-size: 0.8rem; color: var(--muted) !important; }
.lang-opt.active { background: var(--surface-2); color: var(--text) !important; }
.lang-opt:hover { text-decoration: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 18px rgba(255, 92, 43, 0.3); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(255, 77, 94, 0.4); }
.btn-danger:hover { background: rgba(255, 77, 94, 0.12); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 9px; }
.btn-block { width: 100%; }

/* ===== Hero ===== */
.hero { padding: 72px 0 48px; background: radial-gradient(700px 340px at 20% -10%, rgba(255, 92, 43, 0.16), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 44px; align-items: center; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.12; margin: 0 0 14px; letter-spacing: -0.03em; }
.hero-sub { color: var(--muted); font-size: 1.08rem; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-card { display: flex; justify-content: center; }
.mock-build {
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: 16px; padding: 22px 26px;
  width: 100%; max-width: 340px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transform: rotate(1.5deg);
}
.mock-title { font-weight: 700; margin-bottom: 14px; }
.mock-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.mock-row span:first-child { color: var(--muted); }
.mock-total { margin-top: 14px; text-align: right; font-weight: 800; font-size: 1.15rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ===== Sections ===== */
.section { padding: 40px 0; }
.section-title { font-size: 1.4rem; letter-spacing: -0.02em; margin: 0 0 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.see-all { font-size: 0.92rem; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.step-num {
  display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--grad); color: #fff; font-weight: 800; margin-bottom: 10px;
}
.step h3 { margin: 0 0 6px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* ===== Build cards ===== */
.build-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.build-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; color: var(--text); display: flex; flex-direction: column; transition: 0.15s;
}
.build-card:hover { text-decoration: none; border-color: rgba(255, 138, 61, 0.45); transform: translateY(-2px); }
.build-card-img { aspect-ratio: 16/9; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.build-card-img img { width: 100%; height: 100%; object-fit: cover; }
.build-card-placeholder { color: var(--muted); }
.build-card-body { padding: 14px 16px; }
.build-card-body h3 { margin: 0 0 4px; font-size: 1.02rem; }
.build-card-owner { margin: 0 0 6px; color: var(--muted); font-size: 0.88rem; display: flex; align-items: center; gap: 5px; }
.build-card-price { font-weight: 700; font-size: 0.92rem; color: var(--primary-2); }
.verified-badge { color: var(--accent); display: inline-flex; vertical-align: middle; }
.verified-badge.big { transform: translateY(2px); }

/* ===== Creator cards ===== */
.creator-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 14px; }
.creator-card {
  display: flex; gap: 14px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); transition: 0.15s;
}
.creator-card:hover { text-decoration: none; border-color: rgba(61, 165, 255, 0.4); transform: translateY(-2px); }
.creator-avatar, .profile-avatar {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
}
.creator-avatar img, .profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.creator-initial { font-weight: 800; font-size: 1.3rem; color: var(--primary-2); }
.creator-body h3 { margin: 0 0 3px; font-size: 1rem; display: flex; align-items: center; gap: 5px; }
.creator-bio { margin: 0; color: var(--muted); font-size: 0.86rem; }

/* ===== Pages ===== */
.page { padding: 40px 0 64px; }
.page-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -0.03em; margin: 0 0 22px; }
.empty-state { color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 26px; text-align: center; }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 26px; }

/* ===== Build page ===== */
.build-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.build-owner-line { color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: -12px; }
.build-photo { border-radius: var(--radius); border: 1px solid var(--border); margin: 18px 0; max-height: 480px; object-fit: cover; width: 100%; }
.build-photo.sm { max-width: 260px; margin: 10px 0 0; }
.build-desc { color: var(--muted); max-width: 720px; }
.comp-cat { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.comp-price { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.comp-buy { text-align: right; }
.total-label { font-weight: 700; text-align: right; }
.total-price { font-weight: 800; color: var(--primary-2); font-size: 1.05rem; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.table tfoot td { border-bottom: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.details-cell { max-width: 260px; }
.url-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }

/* ===== Forms ===== */
label { display: block; margin-bottom: 14px; font-size: 0.92rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font: inherit; font-size: 0.95rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 92, 43, 0.18); }
input[type="file"] { margin-top: 6px; color: var(--muted); font-size: 0.88rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 14px; padding: 14px 16px 4px; }
legend { padding: 0 8px; font-size: 0.85rem; color: var(--muted); }
.form-actions { display: flex; gap: 12px; margin-top: 22px; }

/* ===== Auth ===== */
.auth-wrap { display: flex; justify-content: center; padding: 56px 20px 72px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 30px 28px; position: relative;
}
.auth-card h1 { margin: 0 0 20px; font-size: 1.5rem; letter-spacing: -0.02em; }
.auth-alt { margin: 18px 0 0; font-size: 0.9rem; color: var(--muted); }

/* ===== Flash ===== */
.flash { border-radius: 10px; padding: 11px 14px; margin-bottom: 18px; font-size: 0.92rem; }
.flash-ok { background: rgba(53, 208, 127, 0.12); border: 1px solid rgba(53, 208, 127, 0.35); color: var(--good); }
.flash-err { background: rgba(255, 77, 94, 0.1); border: 1px solid rgba(255, 77, 94, 0.35); color: var(--bad); }

/* ===== Panel ===== */
.panel-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.panel-tab { padding: 9px 16px; border-radius: 10px 10px 0 0; color: var(--muted); font-size: 0.93rem; font-weight: 600; }
.panel-tab:hover { text-decoration: none; color: var(--text); }
.panel-tab.active { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-bottom-color: var(--surface); }
.tab-badge { background: var(--bad); color: #fff; font-size: 0.72rem; padding: 1px 7px; border-radius: 99px; }
.panel-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.card h2 { margin: 0 0 16px; font-size: 1.08rem; }
.avatar-row { display: flex; gap: 16px; align-items: flex-start; }
.profile-avatar.sm { width: 64px; height: 64px; }
.verified-line { display: flex; align-items: center; gap: 8px; color: var(--good); }
.panel-actions { margin-bottom: 20px; }

/* ===== Profile ===== */
.profile-head { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 28px; }
.profile-page .profile-avatar { width: 92px; height: 92px; }
.profile-meta h1 { margin: 0 0 6px; font-size: 1.6rem; display: flex; align-items: center; gap: 8px; }
.profile-bio { margin: 0 0 6px; max-width: 640px; }
.profile-socials { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.profile-socials a { text-transform: capitalize; font-size: 0.9rem; }

/* ===== Build form ===== */
.comp-form-list { display: flex; flex-direction: column; gap: 10px; }
.comp-form-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.comp-form-row summary { cursor: pointer; padding: 13px 16px; display: flex; gap: 12px; align-items: center; list-style: none; }
.comp-form-row summary::-webkit-details-marker { display: none; }
.comp-form-row summary::before { content: '+'; color: var(--primary-2); font-weight: 800; width: 14px; }
.comp-form-row[open] summary::before { content: '−'; }
.comp-cat-label { font-weight: 600; font-size: 0.94rem; }
.comp-filled { color: var(--muted); font-size: 0.88rem; }
.comp-fields { padding: 4px 16px 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }

/* ===== Report ===== */
.report-box { margin-top: 34px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.report-box summary { cursor: pointer; padding: 12px 16px; color: var(--muted); font-size: 0.9rem; }
.report-form { padding: 4px 16px 16px; max-width: 480px; }

/* ===== Admin ===== */
.admin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.admin-counts { display: flex; gap: 18px; color: var(--muted); font-size: 0.9rem; }
.admin-search { display: flex; gap: 10px; margin-bottom: 18px; max-width: 420px; }
.admin-search input { margin-top: 0; }
.role-badge { padding: 2px 9px; border-radius: 99px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.role-admin { background: rgba(255, 92, 43, 0.15); color: var(--primary-2); }
.role-creator { background: rgba(61, 165, 255, 0.15); color: var(--accent); }
.role-user { background: var(--surface-2); color: var(--muted); }
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.add-row-form { display: flex; gap: 10px; margin-bottom: 14px; }
.add-row-form input { margin-top: 0; }
.aff-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; align-items: end; }
.aff-form button { margin-bottom: 14px; }

/* ===== Legal / error ===== */
.legal-page { max-width: 760px; }
.legal-page h2 { font-size: 1.05rem; margin-top: 26px; }
.legal-page p, .legal-page li { color: var(--muted); font-size: 0.95rem; }
.error-page { text-align: center; padding: 90px 20px; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 36px 0 20px; }
.footer-grid { display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap; }
.footer-tagline { color: var(--muted); margin: 8px 0 4px; }
.footer-note { color: var(--muted); font-size: 0.8rem; max-width: 420px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--muted); font-size: 0.9rem; }
.footer-bottom { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; }

/* ===== Confirm modal ===== */
.confirm-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.confirm-modal-hidden { display: none; }
.confirm-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; max-width: 380px; width: calc(100% - 40px); }
.confirm-title { font-weight: 700; margin: 0 0 8px; }
.confirm-message { color: var(--muted); margin: 0 0 18px; font-size: 0.93rem; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .steps-grid, .build-grid, .creator-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .comp-fields, .aff-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: flex-start; padding: 16px 20px; gap: 14px;
  }
  .nav-links.open { display: flex; }
  .steps-grid, .build-grid, .creator-grid { grid-template-columns: 1fr; }
  .comp-fields, .aff-form { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; }
}
