:root {
  --bg: #ffffff;
  --bg-soft: #f3f6f9;
  --bg-alt: #f7f9fc;
  --text: #2c2e2e;
  --text-muted: #7a7a7a;
  --border: #e6ebf0;
  --primary: #fcb132;
  --primary-hover: #e9a01f;
  --primary-ink: #2c2e2e;
  --primary-soft: #fcb13233;
  --secondary: #ffffff;
  --secondary-border: #d9e0e7;
  --blue: #4c86c5;
  --blue-soft: #4c86c514;
  --success: #00b34b;
  --success-soft: #00b34b14;
  --danger: #d80027;
  --danger-soft: #d8002714;
  --shadow: 0 12px 32px rgba(44, 46, 46, 0.08);
  --shadow-sm: 0 4px 14px rgba(44, 46, 46, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1120px;
  --header-h: 72px;
  --font: "primary-font", Tahoma, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.35rem);
}

[id] {
  scroll-margin-top: calc(var(--header-h) + 0.35rem);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 420px at 100% -10%, rgba(252, 177, 50, 0.12), transparent 55%),
    radial-gradient(900px 360px at 0% 20%, rgba(76, 134, 197, 0.08), transparent 50%),
    var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: absolute;
  right: 1rem;
  top: -100px;
  z-index: 200;
  background: var(--text);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 10px;
}

.skip-link:focus {
  top: 1rem;
}

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

.section {
  padding: 3.25rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2rem;
}

.section-head h2,
.hero h1,
.cta-panel h2,
.bot-card h3,
.channel-card h3,
.benefit-item h3,
.panel-head h3 {
  margin: 0 0 0.75rem;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-head p,
.lead,
.panel-head p,
.bot-card p,
.channel-card p,
.benefit-item p,
.cta-panel p {
  margin: 0;
  color: var(--text-muted);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230, 235, 240, 0.9);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.header-nav {
  display: none;
  gap: 1.1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--primary-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s var(--ease), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  position: relative;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 8px 18px rgba(252, 177, 50, 0.28);
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  border-color: var(--secondary-border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled),
.btn-secondary:focus-visible:not(:disabled) {
  border-color: #c5ced8;
  background: #fbfcfe;
}

.btn-ghost {
  background: transparent;
  border-color: var(--secondary-border);
}

.btn-link {
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.btn.is-loading {
  pointer-events: none;
}

.btn.is-loading .btn-label {
  opacity: 0;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(44, 46, 46, 0.2);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.btn-arrow {
  flex-shrink: 0;
  opacity: 0.9;
}

/* Hero — flat bg matching bots section; video flush to bottom */
.hero {
  background: var(--bg-alt);
  padding-top: 1.75rem;
  padding-bottom: 0;
}

.hero.section {
  padding-bottom: 0;
}

.hero-layout {
  display: grid;
  gap: 1.5rem;
  align-items: end;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.hero-content {
  padding-bottom: 1.5rem;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: rgba(76, 134, 197, 0.1);
  color: #1d4f91;
  font-weight: 700;
  font-size: 0.82rem;
}

.pill-free {
  background: var(--primary-soft);
  color: #9a6700;
}

.hero h1 {
  font-size: clamp(1.6rem, 4.6vw, 2.45rem);
  max-width: 22ch;
}

.lead {
  margin-bottom: 1.35rem !important;
  max-width: 36rem;
}

.hero-note {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  margin: 0;
  line-height: 0;
}

.hero-video {
  width: min(100%, 420px);
  max-height: min(58vh, 480px);
  height: auto;
  object-fit: contain;
  object-position: bottom center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: block;
  margin: 0;
  vertical-align: bottom;
}

/* Shared test boxes (former hero panel look) */
.demo-box {
  background: linear-gradient(160deg, #fff 0%, var(--bg-soft) 100%);
  border: 1px solid rgba(76, 134, 197, 0.08);
  border-radius: 28px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.section-head-in-box {
  margin-bottom: 1.5rem;
}

.demo-kicker {
  margin: 0 0 0.55rem;
  color: #9a6700;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Steps — no borders (avoid looking like buttons) */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 1.25rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.25rem;
  border: 0;
  background: transparent;
  border-radius: 0;
  pointer-events: none;
  user-select: none;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(44, 46, 46, 0.06);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.step.is-active {
  color: var(--text);
  background: transparent;
  border: 0;
}

.step.is-active .step-num {
  background: var(--primary);
  color: var(--primary-ink);
}

.step.is-done {
  color: var(--success);
  background: transparent;
  border: 0;
}

.step.is-done .step-num {
  background: var(--success);
  color: #fff;
}

/* Panels & forms */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: none;
  margin-bottom: 1.1rem;
}

.demo-box .panel {
  background: rgba(255, 255, 255, 0.72);
}

.otp-form {
  display: grid;
  gap: 1.15rem;
  margin-top: 1.15rem;
}

.form-row label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.input-group {
  display: grid;
  gap: 0.75rem;
}

input[type="tel"],
input[type="text"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.hint {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.field-error {
  margin: 0.45rem 0 0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 600;
}

.otp-timer {
  margin: 0.45rem 0 0;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 700;
}

.verified-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--success-soft);
  border: 1px solid rgba(0, 179, 75, 0.25);
  color: var(--success);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 1.1rem;
  font-weight: 700;
}

.verified-bar > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.phone-masked {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  margin-inline: 0.25rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(0, 179, 75, 0.15);
}

.channels-lock-hint {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
}

.channels-lock-hint.is-hidden {
  display: none;
}

/* Channels */
.channels {
  display: grid;
  gap: 1rem;
  transition: opacity 0.25s ease;
}

.channels.is-disabled {
  opacity: 0.55;
}

.channel-card,
.bot-card,
.benefit-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
}

.channel-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, border-color 0.2s ease;
}

.channel-card > p:not(.channel-status) {
  flex: 1 1 auto;
}

.channel-card .channel-send-btn {
  margin-top: auto;
}

.channels:not(.is-disabled) .channel-card:not(.is-channel-offline):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(252, 177, 50, 0.35);
}

.channel-card.is-channel-offline {
  opacity: 0.72;
  background: #f8fafc;
  border-style: dashed;
}

.channel-offline-badge {
  display: inline-flex;
  width: fit-content;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #5b6470;
  font-size: 0.78rem;
  font-weight: 700;
}

.channel-status.is-offline {
  color: #5b6470;
  font-weight: 600;
}

.channel-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.channel-icon img {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
}

.channel-icon-sms {
  background: var(--blue);
}

.channel-icon-bale,
.channel-icon-rubika {
  background: #fff;
  border: 1px solid var(--border);
}

.channel-status {
  min-height: 1.4em;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.channel-status.is-success {
  color: var(--success);
  font-weight: 700;
}

.channel-status.is-error {
  color: var(--danger);
  font-weight: 700;
}

.channel-status.is-loading {
  color: var(--text-muted);
}

.inline-cta {
  margin-top: 1.75rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  animation: fade-up 0.45s var(--ease);
}

.inline-cta p {
  margin: 0 0 1rem;
  font-weight: 700;
}

.inline-cta .hero-actions {
  justify-content: center;
}

/* Bots */
.bots-grid {
  display: grid;
  gap: 1rem;
}

.bot-card {
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease;
}

.bot-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.bot-badge {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #9a6700;
  font-size: 0.8rem;
  font-weight: 700;
}

.bot-badge-alt {
  background: var(--blue-soft);
  color: #1d4f91;
}

.messenger-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.messenger-btn {
  gap: 0.5rem;
}

.msgr-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

/* Benefits */
.benefits-grid {
  display: grid;
  gap: 1rem;
}

.benefit-item {
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease;
}

.benefit-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.benefit-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 0.75rem;
  background: var(--blue-soft);
  color: var(--blue);
}

/* CTA */
.cta-panel {
  text-align: center;
  background:
    radial-gradient(600px 220px at 80% 0%, rgba(252, 177, 50, 0.22), transparent 55%),
    linear-gradient(160deg, #1f2933 0%, #2c3a47 100%);
  color: #fff;
  border-radius: 28px;
  padding: 2.4rem 1.4rem;
}

.cta-panel p {
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 1.5rem !important;
}

.cta-panel .btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.cta-panel .btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.cta-panel .hero-actions {
  justify-content: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: #fff;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.footer-brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--blue);
  font-weight: 700;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 120;
  min-width: min(92vw, 320px);
  max-width: min(92vw, 420px);
  background: var(--text);
  color: #fff;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease);
  text-align: center;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
}

.toast[hidden] {
  display: none !important;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(100%, 420px);
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  animation: fade-up 0.3s var(--ease);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  border: 0;
  background: var(--bg-soft);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-card h3 {
  margin: 0 0 0.5rem;
  padding-left: 2rem;
}

.modal-card p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.qr-box {
  width: 180px;
  height: 180px;
  margin: 0 auto 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: var(--bg-alt);
  font-weight: 700;
  overflow: hidden;
}

.qr-box img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  background: #fff;
}

.is-hidden {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 768px) {
  .container {
    width: min(100% - 2rem, var(--container));
  }

  .section {
    padding: 4.25rem 0;
  }

  .hero.section {
    padding-top: 2.5rem;
    padding-bottom: 0;
  }

  .header-nav {
    display: flex;
  }

  .hero-layout {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
    align-items: end;
  }

  .hero-content {
    padding-bottom: 2rem;
  }

  .hero-video {
    width: min(100%, 480px);
    max-height: min(64vh, 520px);
  }

  .demo-box {
    padding: 2.25rem;
  }

  .input-group {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .steps {
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .step {
    flex-direction: row;
    justify-content: center;
    font-size: 0.92rem;
    padding: 0.35rem 0.5rem;
  }

  .channels {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .messenger-actions {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .cta-panel {
    padding: 3.5rem;
  }
}

@media (max-width: 767px) {
  .header-actions .btn-ghost {
    display: none;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .step span:not(.step-num) {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
