/* ===========================================================
   Мои Услуги — design tokens
   Deep indigo base (not pure black) + teal/violet/coral triad.
   Display: Space Grotesk · Body: Manrope · Data/time: IBM Plex Mono
   Signature element: the animated "time rail" (see .rail)
   =========================================================== */

:root {
  --ink: #0a0e1c;
  --ink-2: #0d1224;
  --panel: #131829;
  --panel-2: #1b2238;
  --panel-border: #232c49;

  --pulse: #46e0c4;      /* slot-open / customer-side accent */
  --pulse-dim: #2a8a78;
  --signal: #7c6ff0;     /* owner/business-side accent */
  --signal-dim: #4d449e;
  --ember: #ff6b4a;      /* primary CTA */
  --ember-dim: #c94f34;

  --paper: #edeffb;
  --mist: #8791b3;
  --mist-dim: #5b6389;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;

  --shadow-glow-pulse: 0 0 0 1px rgba(70, 224, 196, 0.25), 0 8px 30px -8px rgba(70, 224, 196, 0.35);
  --shadow-glow-signal: 0 0 0 1px rgba(124, 111, 240, 0.25), 0 8px 30px -8px rgba(124, 111, 240, 0.35);
  --shadow-card: 0 12px 40px -16px rgba(0, 0, 0, 0.6);

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse 120% 60% at 50% -10%, #161d38 0%, var(--ink) 55%);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--paper);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 28, 0.72);
  border-bottom: 1px solid var(--panel-border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pulse); box-shadow: 0 0 12px 2px var(--pulse); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 0.95rem; color: var(--mist); }
.nav-links a:hover { color: var(--paper); }
.nav-cta {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ember);
  color: #170a06;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.nav-cta:hover { background: #ff8163; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ember); color: #170a06; }
.btn-primary:hover { background: #ff8163; box-shadow: 0 6px 24px -6px rgba(255, 107, 74, 0.6); }
.btn-ghost { background: transparent; color: var(--paper); border: 1px solid var(--panel-border); }
.btn-ghost:hover { border-color: var(--pulse); color: var(--pulse); }
.btn-signal { background: var(--signal); color: #0d0a24; }
.btn-signal:hover { background: #9186fa; box-shadow: var(--shadow-glow-signal); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero + signature time rail ---------- */

.hero { padding: 88px 0 40px; text-align: center; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  max-width: 780px;
  margin: 0 auto 18px;
}
.hero .accent { color: var(--pulse); }
.hero p.lede {
  color: var(--mist);
  max-width: 560px;
  margin: 0 auto 32px;
  font-size: 1.1rem;
}
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }

.rail-wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.rail {
  position: relative;
  height: 74px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--panel) 0%, var(--ink-2) 100%);
  border: 1px solid var(--panel-border);
  overflow: hidden;
}
.rail-line {
  position: absolute;
  left: 24px; right: 24px; top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--panel-border) 10%, var(--panel-border) 90%, transparent);
  transform: translateY(-50%);
}
.rail-ticks {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  padding: 0 24px 10px;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mist-dim);
}
.rail-node {
  position: absolute;
  top: 50%; width: 12px; height: 12px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--ember-dim);
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.15);
  animation: rail-pop 0.6s ease both;
}
.rail-node.open {
  background: var(--pulse);
  box-shadow: 0 0 0 4px rgba(70, 224, 196, 0.22), 0 0 16px 2px rgba(70, 224, 196, 0.5);
  animation: rail-pop 0.6s ease both, rail-glow 2.4s ease-in-out infinite 0.6s;
}
@keyframes rail-pop {
  from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes rail-glow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(70, 224, 196, 0.22), 0 0 16px 2px rgba(70, 224, 196, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(70, 224, 196, 0.1), 0 0 26px 6px rgba(70, 224, 196, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .rail-node { animation: none !important; }
}
.rail-caption {
  text-align: center; color: var(--mist-dim); font-family: var(--font-mono);
  font-size: 0.75rem; margin-top: 12px; letter-spacing: 0.02em;
}

/* ---------- Sections ---------- */

section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 10px; }
.section-head h2 { font-size: 1.6rem; }
.section-head .eyebrow { font-family: var(--font-mono); font-size: 0.75rem; color: var(--pulse); text-transform: uppercase; letter-spacing: 0.08em; display: block; margin-bottom: 8px; }
.muted { color: var(--mist); }

/* ---------- Category grid ---------- */

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.cat-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.cat-card:hover { transform: translateY(-3px); border-color: var(--pulse); box-shadow: var(--shadow-glow-pulse); }
.cat-card.active { border-color: var(--pulse); background: var(--panel-2); }
.cat-card .emoji { font-size: 1.8rem; margin-bottom: 8px; }
.cat-card .label { font-size: 0.85rem; font-weight: 600; }
.cat-card .count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--mist); display: block; margin-top: 4px; }

/* ---------- Business cards ---------- */

.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.biz-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.biz-card:hover { border-color: var(--signal); transform: translateY(-2px); }
.biz-card .logo {
  width: 52px; height: 52px; border-radius: 14px; background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--pulse);
  margin-bottom: 14px; overflow: hidden;
}
.biz-card .logo img { width: 100%; height: 100%; object-fit: cover; }
.biz-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.biz-card .cat-tag { font-size: 0.78rem; color: var(--signal); font-weight: 600; }
.biz-card .addr { font-size: 0.85rem; color: var(--mist); margin: 10px 0 16px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--mist); }

/* ---------- Steps (real sequence -> numbering justified) ---------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius-md); padding: 24px; }
.step .num { font-family: var(--font-mono); color: var(--signal); font-size: 0.85rem; margin-bottom: 10px; display: block; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Pricing ---------- */

.price-card {
  max-width: 380px; margin: 0 auto;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--signal-dim);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  text-align: center;
  box-shadow: var(--shadow-glow-signal);
}
.price-card .amount { font-family: var(--font-display); font-size: 3rem; font-weight: 700; margin: 6px 0; }
.price-card .amount span { font-size: 1rem; color: var(--mist); font-family: var(--font-body); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 24px 0; text-align: left; color: var(--mist); font-size: 0.92rem; }
.price-card li { padding: 7px 0; border-bottom: 1px solid var(--panel-border); }
.price-card li::before { content: "✓ "; color: var(--pulse); font-weight: 700; }

/* ---------- Forms ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; color: var(--mist); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  background: var(--ink-2);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--pulse);
  box-shadow: 0 0 0 3px rgba(70, 224, 196, 0.15);
}
.field-hint { font-size: 0.78rem; color: var(--mist-dim); margin-top: 5px; }
.repeat-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; margin-bottom: 10px; align-items: center; }
@media (max-width: 640px) { .repeat-row { grid-template-columns: 1fr; } }
.repeat-remove { background: transparent; border: 1px solid var(--panel-border); color: var(--mist); border-radius: 8px; width: 38px; height: 38px; cursor: pointer; }
.repeat-remove:hover { border-color: var(--ember); color: var(--ember); }
.add-row-btn { background: transparent; border: 1px dashed var(--panel-border); color: var(--mist); padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem; width: 100%; margin-top: 4px; }
.add-row-btn:hover { border-color: var(--signal); color: var(--signal); }

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 0.9rem; }
.flash-error { background: rgba(255, 107, 74, 0.12); border: 1px solid var(--ember-dim); color: #ffb7a3; }
.flash-success { background: rgba(70, 224, 196, 0.12); border: 1px solid var(--pulse-dim); color: var(--pulse); }
.flash-info { background: rgba(124, 111, 240, 0.12); border: 1px solid var(--signal-dim); color: #c8c2ff; }

fieldset { border: none; padding: 0; margin: 0 0 24px; }
legend { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 14px; padding: 0; }

/* ---------- Dashboard ---------- */

.dash-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .dash-layout { grid-template-columns: 1fr; } }
.dash-nav { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius-md); padding: 10px; position: sticky; top: 88px; }
.dash-nav button {
  display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px;
  background: transparent; border: none; color: var(--mist); font-weight: 600; font-size: 0.9rem; cursor: pointer;
  margin-bottom: 2px;
}
.dash-nav button.active, .dash-nav button:hover { background: var(--panel-2); color: var(--paper); }
.dash-panel { display: none; }
.dash-panel.active { display: block; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius-md); padding: 18px 22px; min-width: 140px; }
.stat .n { font-family: var(--font-display); font-size: 1.8rem; }
.stat .l { color: var(--mist); font-size: 0.8rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; color: var(--mist); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--panel-border); }
td { padding: 12px; border-bottom: 1px solid var(--panel-border); }
tr:last-child td { border-bottom: none; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: var(--panel-2); color: var(--mist); }
.pill-active { background: rgba(70, 224, 196, 0.15); color: var(--pulse); }
.list-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--panel-border); }
.list-row:last-child { border-bottom: none; }

/* ---------- Booking (tenant storefront) ---------- */

.storefront-header { display: flex; align-items: center; gap: 18px; padding: 40px 0 20px; flex-wrap: wrap; }
.storefront-header .logo { width: 72px; height: 72px; border-radius: 18px; background: var(--panel); border: 1px solid var(--panel-border); overflow: hidden; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.6rem; color: var(--pulse); }
.storefront-header .logo img { width: 100%; height: 100%; object-fit: cover; }

.booking-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .booking-grid { grid-template-columns: 1fr; } }
.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--panel-border);
  background: var(--panel); cursor: pointer; font-size: 0.88rem; color: var(--mist);
}
.chip:hover { border-color: var(--signal); }
.chip.selected { border-color: var(--pulse); background: var(--panel-2); color: var(--paper); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 14px; }
.slot {
  padding: 10px 6px; text-align: center; border-radius: 10px; border: 1px solid var(--panel-border);
  background: var(--ink-2); font-family: var(--font-mono); font-size: 0.85rem; cursor: pointer; color: var(--paper);
}
.slot:hover { border-color: var(--pulse); }
.slot.selected { background: var(--pulse); color: #06231d; border-color: var(--pulse); font-weight: 700; }
.slot-empty { grid-column: 1 / -1; color: var(--mist); text-align: center; padding: 20px; font-size: 0.9rem; }

.footer { border-top: 1px solid var(--panel-border); margin-top: 60px; padding: 30px 0; text-align: center; color: var(--mist-dim); font-size: 0.85rem; }
