/* QRipt shared site chrome + legal pages */
:root {
  --bg: #0a0a0a;
  --card: #121212;
  --border: #222;
  --muted: #a3a3a3;
  --text: #f5f5f5;
  --green: #16a34a;
}

* { box-sizing: border-box; }

body.legal-page,
body.page-home {
  background: #050508;
  color: var(--text);
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

a { color: var(--green); text-decoration: none; font-weight: 600; }
a:hover { color: #22c55e; text-decoration: underline; }

.site-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1rem 1rem 0.5rem;
  position: relative;
  z-index: 40;
}

.site-top.wide {
  max-width: 720px;
}

.site-logo img {
  height: 3.5rem;
  width: auto;
  display: block;
}

.site-top-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #e5e5e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.menu-btn:hover,
.menu-btn[aria-expanded="true"] {
  background: #262626;
  border-color: #444;
}
.menu-btn svg { display: block; }

.menu-panel {
  display: none;
  position: absolute;
  top: calc(100% - 0.15rem);
  right: 1rem;
  width: min(260px, calc(100% - 2rem));
  background: #141414;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 0.4rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  z-index: 50;
}
.menu-panel.open { display: block; }
.menu-panel a,
.menu-panel .menu-soon {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--green);
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  position: relative;
}
.menu-panel a:hover,
.menu-panel .menu-soon:hover {
  background: #1f1f1f;
  color: #22c55e;
  text-decoration: none;
}
.menu-soon-tip {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%) scale(0.92);
  background: #16a34a;
  color: #07140a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.menu-soon-tip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

.legal-page main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.legal-page h1 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0.75rem 0 0.4rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #fff;
}

.legal-page .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.legal-page h2 {
  font-size: 1.1rem;
  font-weight: 650;
  margin: 1.75rem 0 0.55rem;
  color: #fff;
  line-height: 1.35;
}

.legal-page p,
.legal-page li {
  color: #d4d4d4;
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 0.75rem;
}

.legal-page ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

.legal-page .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

/* —— Форма обратной связи —— */
.contact-form-lead {
  margin-top: -0.25rem !important;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.contact-field > span {
  font-size: 0.85rem;
  color: #a3a3a3;
  font-weight: 600;
}
.contact-field em {
  color: #16a34a;
  font-style: normal;
}
.contact-field input,
.contact-field textarea {
  width: 100%;
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}
.contact-field input:focus,
.contact-field textarea:focus {
  border-color: #16a34a;
}
.contact-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #a3a3a3;
  cursor: pointer;
}
.contact-consent input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: #16a34a;
  width: 16px;
  height: 16px;
}
.contact-error {
  color: #ef4444;
  font-size: 0.88rem;
  margin: 0;
}
.contact-submit {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 0.75rem;
  background: #16a34a;
  color: #07140a;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.contact-submit:hover { opacity: 0.92; }
.contact-submit:active { transform: scale(0.98); }
.contact-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.contact-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  background: #16a34a;
  color: #07140a;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.contact-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 1.1rem 1rem 1.4rem;
  margin-top: auto;
}

.site-footer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  color: #737373;
}

.site-footer a { color: #a3a3a3; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .sep { color: #333; }

/* —— Desktop: крупный логотип слева + горизонтальное меню —— */
@media (min-width: 900px) {
  .site-top,
  .site-top.wide {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 1.35rem 2.75rem 1rem;
    gap: 2.5rem;
    align-items: center;
  }

  .site-logo {
    order: 1;
    flex-shrink: 0;
  }

  .site-logo img {
    height: 4.35rem;
  }

  .menu-panel,
  .menu-panel.open {
    display: flex !important;
    order: 2;
    position: static;
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    margin: 0 0 0 10rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.15rem 0.45rem;
  }

  .menu-panel a,
  .menu-panel .menu-soon {
    width: auto;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    color: var(--green);
  }

  .menu-panel a:hover,
  .menu-panel .menu-soon:hover {
    background: #1a1a1a;
    color: #22c55e;
  }

  .menu-soon-tip {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -1.55rem;
    transform: translateX(-50%) scale(0.92);
  }

  .menu-soon-tip.show {
    transform: translateX(-50%) scale(1);
  }

  .site-top-right {
    order: 3;
    flex-shrink: 0;
    margin-left: auto;
  }

  .menu-btn {
    display: none;
  }

  .legal-page main {
    max-width: 820px;
    padding-top: 1.5rem;
  }
}

/* —— Звёздный фон (лёгкий CSS + canvas в stars-bg.js) —— */
.space-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 15% -5%, rgba(40, 90, 160, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 45% at 95% 5%, rgba(22, 163, 74, 0.07), transparent 50%),
    radial-gradient(ellipse 60% 40% at 70% 100%, rgba(50, 70, 140, 0.10), transparent 55%),
    #050508;
}
.space-bg .stars-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

body.legal-page > header,
body.page-home > header {
  position: relative;
  z-index: 50;
}
body.legal-page > main,
body.legal-page > footer,
body.page-home > main,
body.page-home > footer {
  position: relative;
  z-index: 1;
}
/* confirm/modal must stay fixed overlays above header (do not force position:relative) */
body.page-home > #confirm-popup,
body.page-home > #modal {
  position: fixed;
  z-index: 60;
}
