/* ТаблицУм — светлый лендинг с синим акцентом */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f8ff;
  --bg-tint: #e8effc;
  --text: #141a24;
  --text-muted: #5b6578;
  --border: #e2e8f4;
  --border-strong: #c5d0e4;
  /* Основной акцент — blue */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-pressed: #1e40af;
  --primary-text: #ffffff;
  --primary-soft: #dbeafe;
  --primary-soft-2: #eff6ff;
  --focus: #3b82f6;
  --danger: #b42318;
  --success: #067647;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 40px rgba(37, 99, 235, 0.12);
  --shadow-btn: 0 6px 16px rgba(37, 99, 235, 0.28);
  --header-h: 64px;
  --container: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img,
video,
iframe {
  max-width: 100%;
}

a {
  color: var(--primary-hover);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-pressed);
}

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

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.narrow {
  width: min(100% - 2rem, 560px);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
}

.logo::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 4px;
  background: linear-gradient(135deg, #60a5fa 0%, var(--primary) 55%, #1d4ed8 100%);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.logo:hover {
  color: var(--primary-hover);
}

.nav {
  display: none;
  gap: 1.25rem;
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--primary-hover);
}

.header-inner .telegram-btn {
  color: #24A1DE;
  margin-left: 0.25rem;
}

.header-inner .telegram-btn:hover {
  color: #1B8AC0;
  background: rgba(36, 161, 222, 0.1);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease,
    transform 0.15s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(180deg, #3b82f6 0%, var(--primary) 100%);
  color: var(--primary-text);
  border-color: var(--primary-hover);
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #2563eb 0%, var(--primary-hover) 100%);
  color: var(--primary-text);
  border-color: var(--primary-pressed);
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.35);
}

.btn-primary:active:not(:disabled) {
  background: var(--primary-pressed);
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
}

.btn-secondary {
  background: var(--bg);
  color: var(--primary-hover);
  border-color: #93c5fd;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-soft-2);
  color: var(--primary-pressed);
  border-color: var(--primary);
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

/* Hero & sections */

.hero {
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(1200px 420px at 12% -10%, rgba(96, 165, 250, 0.2), transparent 55%),
    radial-gradient(900px 380px at 88% 0%, rgba(37, 99, 235, 0.1), transparent 50%),
    var(--bg);
}

.hero-inner {
  max-width: 720px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  color: var(--primary-hover);
  background: var(--primary-soft);
  border: 1px solid #93c5fd;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.lead,
.section-lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  letter-spacing: -0.02em;
}

.section h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-top: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #93c5fd);
}

.feature-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 1.75rem;
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  border-top: 3px solid var(--primary);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.feature-card:hover {
  border-color: #93c5fd;
  border-top-color: var(--primary-hover);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Video */

.video-wrap {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 16 / 9;
  position: relative;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.08);
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.35rem;
  padding: 1.5rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(96, 165, 250, 0.22), transparent 55%),
    linear-gradient(180deg, #eff6ff 0%, #e8effc 100%);
}

.video-placeholder-title {
  margin: 0;
  font-weight: 650;
}

.video-placeholder-text {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.video-frame,
.video-frame iframe,
.video-frame video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

/* Quiz */

.quiz-form {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.06);
  border-top: 3px solid var(--primary);
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.optional {
  font-weight: 400;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #93c5fd;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.form-status {
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.form-status.is-success {
  color: var(--success);
}

.form-status.is-error {
  color: var(--danger);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0 2.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.site-footer a {
  color: var(--primary-hover);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-inner p {
  margin: 0;
}

.footer-note a {
  color: var(--primary-hover);
}

.footer-contacts {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.telegram-btn {
  color: #24A1DE;
}

.telegram-btn:hover {
  color: #1B8AC0;
  background: rgba(36, 161, 222, 0.1);
}

/* Fullscreen editor */

.editor-screen[hidden] {
  display: none !important;
}

.editor-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--bg);
}

.editor-screen-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.35rem 0.65rem 0.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #eff6ff 0%, var(--bg) 100%);
}

.editor-screen-title {
  margin: 0;
  flex: 1;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-screen-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg-alt);
}

.editor-screen-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

/* Loader для iframe */
.iframe-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 10;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader-text {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.iframe-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg);
}

.iframe-hint code {
  font-size: 0.9em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .editor-screen-title {
    display: none;
  }
}

/* Responsive */

@media (min-width: 720px) {
  .nav {
    display: flex;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }
}

@media (min-width: 960px) {
  .hero {
    padding: 5rem 0 4rem;
  }

  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .site-header .btn-sm {
    display: none;
  }

  .quiz-form {
    padding: 1.15rem;
  }
}
