/* Saytchi.online — dizayn tokenlari
   Ink:      #14213D
   Bg:       #F4F6FB
   Surface:  #FFFFFF
   Primary:  #1F4FD8  (blueprint blue)
   Accent:   #FF7A33  (signal orange — faqat asosiy CTA uchun)
   Success:  #1FAA59
   Danger:   #E5484D
   Line:     #D8DEEC
   Muted:    #64708A
   Display type: 'Space Grotesk'   Body type: 'Inter'
*/

:root {
  --ink: #14213D;
  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --primary: #1F4FD8;
  --primary-dark: #17399E;
  --accent: #FF7A33;
  --success: #1FAA59;
  --danger: #E5484D;
  --line: #D8DEEC;
  --muted: #64708A;
  --radius: 14px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

:root:not([data-theme="light"]) {
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .4em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink); }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 13px 22px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  min-height: 46px;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(255,122,51,.28); }
.btn-primary:hover { background: #ff6a1a; }
.btn-secondary { background: var(--surface); color: var(--primary); border: 1.5px solid var(--line); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-danger { background: #FCE9E9; color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 13px; min-height: 36px; border-radius: 10px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary);
}
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field .hint.ok { color: var(--success); }
.field .hint.bad { color: var(--danger); }
.input-prefix {
  display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface);
}
.input-prefix span { padding: 12px 10px; background: #EEF1F8; color: var(--muted); font-size: 13px; white-space: nowrap; }
.input-prefix input { border: none; border-radius: 0; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(244,246,251,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 8px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 19px; color: var(--ink); }
.logo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* ---------- Hero (blueprint grid) ---------- */
.hero {
  position: relative;
  padding: 64px 0 56px;
  background-image:
    linear-gradient(rgba(31,79,216,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,79,216,.07) 1px, transparent 1px);
  background-size: 28px 28px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero .container { position: relative; z-index: 1; }
.eyebrow-plain { color: var(--primary); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); max-width: 640px; }
.hero .lead { font-size: 17px; color: var(--muted); max-width: 520px; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-url {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px 8px 8px; font-size: 13px; color: var(--muted);
}
.hero-url b { color: var(--ink); }
.hero-url .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
.section-head { max-width: 560px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 32px); }
.section-head p { color: var(--muted); }

/* ---------- Template gallery ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.tpl-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color .15s ease, transform .15s ease;
}
.tpl-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.tpl-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.tpl-card .preview { aspect-ratio: 4/3; background: #EEF1F8; }
.tpl-card .preview img { width: 100%; height: 100%; object-fit: cover; }
.tpl-card .meta { padding: 14px 16px; }
.tpl-card .meta h3 { font-size: 16px; margin-bottom: 4px; }
.tpl-card .meta p { font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- Pricing (spec sheet, not card kit) ---------- */
.spec-table { border-top: 1px solid var(--line); }
.spec-row {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px;
  padding: 16px 4px; border-bottom: 1px solid var(--line); align-items: center;
}
.spec-row.head { font-size: 12px; text-transform: none; color: var(--muted); font-weight: 600; }
.spec-row .plan-name { font-weight: 600; font-family: 'Space Grotesk', sans-serif; }
.spec-row .price { font-size: 20px; font-weight: 700; }
.spec-row .price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.card-hint { font-size: 13px; color: var(--muted); margin-top: 10px; }
.card-hint code { background: #EEF1F8; padding: 2px 7px; border-radius: 6px; font-family: monospace; color: var(--ink); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 32px 0 calc(32px + env(safe-area-inset-bottom, 0px)); }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; }

/* ---------- App shell (post-login) ---------- */
.app-shell { min-height: 100vh; padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.app-topbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.app-topbar-inner { max-width: 720px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
.app-container { max-width: 720px; margin: 0 auto; padding: 20px; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottom-nav-inner {
  max-width: 720px; margin: 0 auto; display: flex; justify-content: space-around; padding: 6px 6px;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 600;
  cursor: pointer; border: none; background: none;
}
.nav-item svg { width: 22px; height: 22px; stroke: var(--muted); fill: none; stroke-width: 1.8; }
.nav-item.active { color: var(--primary); }
.nav-item.active svg { stroke: var(--primary); }

/* ---------- Cards / lists ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.site-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.site-item h3 { font-size: 16px; margin-bottom: 4px; }
.site-item .slug { font-size: 13px; color: var(--primary); word-break: break-all; }
.site-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.badge.active { background: #E7F7EE; color: var(--success); }
.badge.active::before { background: var(--success); }
.badge.pending { background: #FFF3E8; color: var(--accent); }
.badge.pending::before { background: var(--accent); }
.badge.inactive, .badge.rejected { background: #FCE9E9; color: var(--danger); }
.badge.inactive::before, .badge.rejected::before { background: var(--danger); }

.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; stroke: var(--line); margin: 0 auto 14px; }

/* ---------- Auth modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,33,61,.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 620px) { .modal-overlay { align-items: center; } }
.modal {
  background: var(--surface); width: 100%; max-width: 420px;
  border-radius: 20px 20px 0 0; padding: 26px 22px calc(26px + env(safe-area-inset-bottom, 0px));
  max-height: 90vh; overflow-y: auto;
}
@media (min-width: 620px) { .modal { border-radius: 20px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; padding: 4px; }
.tabs { display: flex; gap: 6px; background: #EEF1F8; padding: 4px; border-radius: 10px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 9px; border: none; background: none; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20,33,61,.1); }

/* ---------- Upload dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 26px 16px; text-align: center;
  cursor: pointer; background: var(--surface); color: var(--muted); font-size: 13px;
}
.dropzone.has-file { border-color: var(--success); color: var(--ink); }
.dropzone svg { width: 30px; height: 30px; stroke: var(--muted); margin: 0 auto 8px; }

.pay-card { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.pay-card .amount { font-family: 'Space Grotesk', sans-serif; font-size: 26px; font-weight: 700; }
.pay-card .card-number { font-size: 19px; letter-spacing: 1px; margin-top: 10px; font-family: monospace; }
.pay-card .label { font-size: 12px; opacity: .8; margin-top: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 13px; z-index: 60;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 90vw; text-align: center;
}

/* ---------- Loading ---------- */
.spinner { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
