@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-cyrillic.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --bg: #0a0714;
  --bg-elevated: #120c20;
  --surface: #16101f;
  --surface-2: #1c1429;
  --border: rgba(180, 140, 255, 0.14);
  --border-strong: rgba(180, 140, 255, 0.28);
  --text: #f3eefc;
  --text-dim: #a89bc4;
  --text-faint: #6f6488;
  --accent: #8b5cf6;
  --accent-2: #c084fc;
  --accent-glow: rgba(139, 92, 246, 0.35);
  --radius: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(120% 60% at 85% -10%, #1c1030 0%, transparent 55%),
              radial-gradient(80% 50% at 0% 0%, #150c26 0%, transparent 50%),
              var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.dim { color: var(--text-dim); }
.small { font-size: 0.85rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.accent { color: var(--accent-2); }

/* header */
.site-header { border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(10,7,20,0.82); backdrop-filter: blur(10px); z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; }
.brand-name span { color: var(--accent-2); }
.main-nav { display: flex; gap: 28px; font-size: 0.92rem; color: var(--text-dim); }
.main-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.inline-form { display: inline; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-size: 0.92rem; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: all .15s ease; font-family: var(--font); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #6d28d9); color: #fff; box-shadow: 0 4px 20px var(--accent-glow); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }
.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-block { width: 100%; margin-top: 6px; }

/* hero */
.hero { padding: 72px 0 40px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 40px; }
.hero-copy h1 { font-size: 2.6rem; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 18px; }
.hero-copy p { color: var(--text-dim); font-size: 1.05rem; max-width: 480px; margin: 0 0 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { position: relative; height: 380px; display: flex; align-items: center; justify-content: center; perspective: 1200px; }
.hero-rings { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-rings .ring { fill: none; stroke: url(#none); stroke-width: 1; }
.ring-1, .ring-2, .ring-3 { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.ring-2 { stroke: rgba(192,132,252,0.16); }
.ring-3 { stroke: rgba(139,92,246,0.22); }
.ring-dot { fill: var(--accent-2); filter: drop-shadow(0 0 6px var(--accent-2)); }
.hero-rings { animation: spin-slow 40s linear infinite; transform-origin: center; }

.hero-card-stage { transform-style: preserve-3d; animation: card-float 7s ease-in-out infinite; }
.hero-card {
  width: 260px; height: 164px; border-radius: 18px; padding: 22px;
  background: linear-gradient(135deg, #2a1a4a 0%, #17102a 55%, #0d0818 100%);
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6), 0 0 40px -10px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.05);
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: ''; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 0deg, rgba(192,132,252,0.15) 60deg, transparent 140deg);
  animation: sheen-rotate 6s linear infinite;
}
.hero-card-top { display: flex; align-items: center; justify-content: space-between; z-index: 1; }
.hero-card-chip { width: 38px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #d9c4ff, #a78bfa); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); position: relative; }
.hero-card-chip::before, .hero-card-chip::after { content: ''; position: absolute; left: 6px; right: 6px; height: 1px; background: rgba(0,0,0,0.25); }
.hero-card-chip::before { top: 9px; }
.hero-card-chip::after { top: 18px; }
.hero-card-wave { width: 22px; height: 22px; border: 1.5px solid var(--accent-2); border-radius: 50%; opacity: 0.6; }
.hero-card-number { font-family: 'Menlo', 'Consolas', monospace; letter-spacing: 2px; font-size: 1.05rem; color: rgba(243,238,252,0.85); z-index: 1; }
.hero-card-bottom { display: flex; align-items: center; justify-content: space-between; z-index: 1; }
.hero-card-label { font-size: 0.68rem; letter-spacing: 1.5px; color: var(--text-dim); }
.hero-card-brand { font-weight: 700; font-size: 0.95rem; color: var(--accent-2); }

@keyframes card-float {
  0%, 100% { transform: rotateY(-14deg) rotateX(6deg) translateY(0); }
  50% { transform: rotateY(6deg) rotateX(-4deg) translateY(-10px); }
}
@keyframes sheen-rotate { to { transform: rotate(360deg); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .hero-rings, .hero-card-stage, .hero-card::before { animation: none; }
}

/* sections */
.section-title { font-size: 1.5rem; margin: 0 0 22px; letter-spacing: -0.01em; }
.catalog { padding: 50px 0; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.category-card, .product-card { display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, transform .15s; }
.category-card:hover, .product-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.category-icon { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: linear-gradient(160deg, rgba(139,92,246,0.16), rgba(139,92,246,0.05)); border: 1px solid var(--border); color: var(--accent-2); flex-shrink: 0; }
.category-icon svg { width: 100%; height: 100%; display: block; }
.category-label { flex: 1; font-weight: 500; }
.category-arrow, .product-arrow { color: var(--text-faint); }
.category-card-custom { border-style: dashed; }

.how { padding: 40px 0 80px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.how-step { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.how-num { color: var(--accent-2); font-size: 0.8rem; font-weight: 700; letter-spacing: 1px; }
.how-step h3 { margin: 10px 0 8px; font-size: 1.05rem; }
.how-step p { margin: 0; font-size: 0.92rem; }

/* generic pages */
.page-section { padding: 48px 0 80px; }
.page-narrow { max-width: 620px; }
.page-title { font-size: 1.9rem; margin: 14px 0 22px; letter-spacing: -0.015em; }
.back-link { color: var(--text-dim); font-size: 0.9rem; }
.back-link:hover { color: var(--accent-2); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; }
.card-title { font-size: 1.05rem; margin: 0 0 14px; }
.kv { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.kv:last-of-type { border-bottom: none; }
.kv span { color: var(--text-dim); flex-shrink: 0; }
.kv strong { text-align: right; word-break: break-word; min-width: 0; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.product-card { flex-direction: column; align-items: flex-start; gap: 6px; }
.product-card-name { font-weight: 600; }
.product-card-meta { display: flex; justify-content: space-between; width: 100%; margin-top: 10px; font-size: 0.9rem; color: var(--accent-2); }

.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-size: 0.9rem; color: var(--text-dim); }
.form input[type=text], .form input[type=email], .form input[type=password], .form textarea, .form select {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px;
  color: var(--text); font-family: var(--font); font-size: 0.95rem; outline: none;
}
.form input:focus, .form textarea:focus, .form select:focus { border-color: var(--accent); }
.form select {
  appearance: none; -webkit-appearance: none; color-scheme: dark; cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a89bc4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.form select option { background: var(--surface-2); color: var(--text); }
.checkbox-label { flex-direction: row !important; align-items: flex-start; gap: 8px !important; }
.checkbox-label input { margin-top: 3px; flex-shrink: 0; }

.amount-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -6px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); font-family: var(--font); font-size: 0.85rem; cursor: pointer; transition: all .15s ease; }
.chip:hover { border-color: var(--accent-2); color: var(--text); }
.chip-active { border-color: var(--accent); color: var(--accent-2); background: rgba(139,92,246,0.12); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 12px; height: 380px; overflow-y: auto; padding: 14px; margin-top: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; color: var(--text-faint); }
.chat-empty-icon { font-size: 1.8rem; }
.chat-empty-title { color: var(--text-dim); font-weight: 500; font-size: 0.95rem; }
.chat-empty-sub { font-size: 0.85rem; }
.chat-msg { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 0.92rem; line-height: 1.45; word-wrap: break-word; }
.chat-msg-customer { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #6d28d9); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg-admin { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-msg-time { display: block; margin-top: 5px; font-size: 0.72rem; opacity: 0.65; }
.chat-form { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; }
.chat-form textarea {
  flex: 1; resize: none; min-height: 46px; max-height: 140px; padding: 12px 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-family: var(--font); font-size: 0.92rem; line-height: 1.3; outline: none;
  transition: border-color .15s ease;
}
.chat-form textarea::placeholder { color: var(--text-faint); }
.chat-form textarea:focus { border-color: var(--accent); }
.chat-form button { flex-shrink: 0; }

.status-banner { display: flex; align-items: center; gap: 14px; }
.status-banner-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; background: rgba(74,222,128,0.12); color: #4ade80; }
.status-banner p { margin: 2px 0 0; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 16px; }
.alert-error { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); color: #fca5a5; }
.alert-success { background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.3); color: #86efac; }
.alert-info { background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.3); color: var(--accent-2); }

.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-row { display: grid; grid-template-columns: 100px 1fr 1fr 100px; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 0.9rem; }
.order-row:hover { border-color: var(--border-strong); }
.order-row > span:not(.order-code) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* admin orders list: code, category, email, price, date, status — one extra column vs the base .order-row */
.order-row-admin { grid-template-columns: 90px 1.1fr 1.3fr 80px 140px 90px; }
.order-code { font-family: 'Menlo', 'Consolas', monospace; color: var(--accent-2); display: inline-flex; align-items: center; gap: 6px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: #facc15; box-shadow: 0 0 0 3px rgba(250,204,21,0.18); flex-shrink: 0; }
.status { font-size: 0.8rem; padding: 3px 10px; border-radius: 999px; text-align: center; }
.status-pending { background: rgba(250,204,21,0.12); color: #facc15; }
.status-paid { background: rgba(96,165,250,0.12); color: #60a5fa; }
.status-fulfilled { background: rgba(74,222,128,0.12); color: #4ade80; }
.status-cancelled { background: rgba(248,113,113,0.12); color: #f87171; }

.pay-card { text-align: center; padding: 32px 24px; }
.pay-amount { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.02em; }
.pay-sub { margin: 4px 0 24px; }
.pay-card .kv { text-align: left; }
.pay-note { text-align: left; margin-top: 20px; }

.delivered-payload { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; white-space: pre-wrap; font-family: 'Menlo','Consolas',monospace; font-size: 0.85rem; }

.legal h2 { font-size: 1.1rem; margin: 28px 0 8px; }
.legal p { color: var(--text-dim); font-size: 0.95rem; }

.admin-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 14px; }
.admin-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; font-size: 0.9rem; }
.admin-nav a { color: var(--text-dim); }
.admin-nav a:hover { color: var(--text); }

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 50px 0 24px; }
.footer-inner { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 30px; }
.footer-col a { display: block; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 8px; }
.footer-col a:hover { color: var(--accent-2); }
.footer-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); margin-bottom: 12px; }
.footer-bottom { margin-top: 40px; font-size: 0.82rem; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { height: 300px; order: -1; }
  .hero-copy h1 { font-size: 2.1rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .order-row { grid-template-columns: 80px 1fr 80px; }
  .order-row span:nth-child(3) { display: none; }
  .order-row-admin { grid-template-columns: 80px 1fr 80px 80px; }
  .order-row-admin span:nth-child(5) { display: none; }

  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; row-gap: 10px; }
  .main-nav { order: 3; width: 100%; justify-content: center; gap: 22px; }
  .header-actions { margin-left: auto; }
  .header-actions .btn { padding: 8px 14px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .hero-copy h1 { font-size: 1.7rem; }
  .page-title { font-size: 1.5rem; }
  .pay-amount { font-size: 2rem; }
  .card { padding: 18px; }
  .order-row { grid-template-columns: 70px 1fr 70px; gap: 8px; padding: 12px 14px; font-size: 0.82rem; }
  .order-row-admin { grid-template-columns: 70px 1fr 70px 70px; gap: 8px; padding: 12px 14px; font-size: 0.82rem; }
}

/* support widget */
#support-widget { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
#support-toggle {
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #6d28d9); box-shadow: 0 8px 24px var(--accent-glow);
  font-size: 1.4rem; display: flex; align-items: center; justify-content: center; position: relative;
}
#support-badge { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: #facc15; box-shadow: 0 0 0 2px var(--bg); }
#support-panel {
  width: 340px; max-width: calc(100vw - 40px); height: 460px; max-height: 70vh;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: 0 20px 50px -10px rgba(0,0,0,0.5); display: flex; flex-direction: column; overflow: hidden;
}
#support-panel[hidden] { display: none; }
#support-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.92rem; }
#support-close { background: none; border: none; color: var(--text-dim); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 2px 4px; }
#support-close:hover { color: var(--text); }
#support-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.support-msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 0.88rem; line-height: 1.4; word-wrap: break-word; }
.support-msg-visitor { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #6d28d9); color: #fff; border-bottom-right-radius: 4px; }
.support-msg-other { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
#support-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
#support-form textarea {
  flex: 1; resize: none; min-height: 38px; max-height: 100px; padding: 9px 13px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-family: var(--font); font-size: 0.88rem; outline: none;
}
#support-form textarea:focus { border-color: var(--accent); }
#support-form button { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--accent); color: #fff; cursor: pointer; flex-shrink: 0; font-size: 0.95rem; }

@media (max-width: 480px) {
  #support-widget { right: 12px; bottom: 12px; }
  #support-panel { width: calc(100vw - 24px); }
}
