/* The landing (Pages/Shared/_Landing.cshtml) and the login popup (_LoginPopup.cshtml): loaded by / and /Login only.
   Colors are site.css's --ge-* tokens. */

/* The navbar stays on screen, so the login popup under its Войти does too. Its layer is site.css's */
.ge-app-shell.ge-landing-page .ge-navbar {
  position: sticky;
  top: 0;
}

.ge-landing {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
}

/* ---------- Login popup ---------- */

.ge-login-popup {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 1040;
  width: 384px;
  color: var(--ge-text);
  text-align: left;
  background: var(--ge-surface);
  border: 1px solid var(--ge-border);
  border-radius: var(--ge-radius-xl);
  box-shadow: 0 28px 64px color-mix(in srgb, var(--ge-shadow-tint-deep) 24%, transparent), 0 4px 12px color-mix(in srgb, var(--ge-shadow-tint-deep) 8%, transparent);
}

/* The form scrolls inside the popup when the screen is too short for it (a phone on its side): the navbar is sticky,
   so scrolling the page wouldn't bring the rest into view. The popup starts 14px under Войти, within the first 80px
   of the screen, so 94px less than the screen's height keeps it clear of the bottom. The caret stays outside the
   scrolling part */
.ge-login-popup__body {
  position: relative;
  max-height: calc(100vh - 94px);
  max-height: calc(100dvh - 94px);
  padding: 28px 28px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
}

/* Opened by a click (landing.js); on /Login it's simply there */
.ge-login-popup--opening {
  animation: ge-login-pop 0.18s ease-out;
}

.ge-login-popup[hidden] {
  display: none;
}

/* The caret pointing at Войти */
.ge-login-popup::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 40px;
  width: 16px;
  height: 16px;
  background: var(--ge-surface);
  border-top: 1px solid var(--ge-border);
  border-left: 1px solid var(--ge-border);
  border-top-left-radius: var(--ge-radius-xs);
  transform: rotate(45deg);
}

@keyframes ge-login-pop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.ge-login-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--ge-text-muted);
  font-size: var(--ge-font-title-phone);
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: var(--ge-radius-md);
}

.ge-login-popup__close:hover,
.ge-login-popup__close:focus {
  color: var(--ge-text-strong);
  background: var(--ge-primary-soft);
}

.ge-login-popup__title {
  margin: 0 0 4px;
  color: var(--ge-text-strong);
  font-size: var(--ge-font-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ge-login-popup__hint {
  margin: 0 0 20px;
  color: var(--ge-text-muted);
  font-size: var(--ge-font-md);
}

.ge-login-popup .form-group {
  margin-bottom: 14px;
}

.ge-login-popup__label {
  margin-bottom: 6px;
  color: var(--ge-text);
  font-size: var(--ge-font-sm);
  font-weight: 600;
}

.ge-login-popup .form-control {
  height: var(--ge-field-h);
}

.ge-login-popup__check {
  margin-bottom: 10px;
  font-size: var(--ge-font-sm);
  line-height: 1.5;
}

/* Native checkboxes (tests and password managers tick the input itself), in the brand color */
.ge-login-popup .form-check {
  padding-left: 26px;
}

/* 18px like every checkbox (site.css, Design system block), centred on the label's first line */
.ge-login-popup .form-check-input {
  width: 18px;
  height: 18px;
  margin-top: calc((1.5em - 18px) / 2);
  margin-left: -26px;
  accent-color: var(--ge-primary);
}

.ge-login-popup .ge-login-popup__submit {
  margin-top: 18px;
  padding: 12px;
  font-size: var(--ge-font-lg);
  font-weight: 600;
  border-radius: var(--ge-radius-md);
}

.ge-login-popup__errors.text-danger {
  margin-bottom: 16px;
  padding: 10px 14px;
  color: var(--ge-danger-text) !important;
  font-size: var(--ge-font-sm);
  background: var(--ge-danger-soft);
  border-radius: var(--ge-radius-md);
}

.ge-login-popup__errors p {
  margin: 0;
}

.ge-login-popup__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 18px;
  padding-top: 16px;
  color: var(--ge-text-muted);
  font-size: var(--ge-font-sm);
  border-top: 1px solid var(--ge-border);
}

/* lazy.css draws every plain link blue and underlined */
.ge-landing-page .ge-login-popup a:not(.btn):not(.nav-link),
.ge-landing-page .lp a:not(.btn):not(.nav-link) {
  color: var(--ge-primary-dark);
  font-weight: 600;
  border-bottom: 1px solid color-mix(in srgb, var(--ge-primary-dark) 35%, transparent);
}

.ge-landing-page .ge-login-popup a:not(.btn):not(.nav-link):hover,
.ge-landing-page .lp a:not(.btn):not(.nav-link):hover {
  color: var(--ge-text-strong);
  border-bottom-color: currentColor;
}

/* ---------- Landing ---------- */

.lp {
  color: var(--ge-text);
  overflow-x: hidden;
}

.lp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.lp-eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 14px;
  color: var(--ge-primary-dark);
  font-size: var(--ge-font-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--ge-primary-soft);
  border-radius: var(--ge-radius-pill);
}

.lp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.lp-actions--center {
  justify-content: center;
}

.lp .btn-lg {
  padding: 14px 28px;
  font-size: var(--ge-font-lg);
  font-weight: 600;
  border-radius: var(--ge-radius-md);
}

/* The hero's second button: a white one, visible on the tinted page */
.lp-hero .btn-outline-primary {
  color: var(--ge-primary-dark);
  background: var(--ge-surface);
  border: 1px solid var(--ge-border-strong);
}

.lp-hero .btn-outline-primary:hover,
.lp-hero .btn-outline-primary:focus {
  color: var(--ge-text-strong);
  background: var(--ge-primary-soft);
  border-color: var(--ge-primary);
}

/* Hero */

.lp-hero {
  position: relative;
  padding: 72px 0 56px;
}

.lp-hero::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -160px;
  width: 720px;
  height: 720px;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--ge-primary) 18%, transparent) 0%, color-mix(in srgb, var(--ge-primary) 0%, transparent) 65%);
}

.lp-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 64px;
  align-items: center;
}

.lp-hero__title {
  margin: 0 0 20px;
  color: var(--ge-text-strong);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.lp-hero__lead {
  max-width: 34em;
  margin: 0 0 32px;
  color: var(--ge-text-muted);
  font-size: var(--ge-font-lg);
  line-height: 1.55;
}

.lp-hero__note {
  max-width: 32em;
  margin: 18px 0 0;
  color: var(--ge-text-muted);
  font-size: var(--ge-font-md);
  line-height: 1.5;
}

.lp-hero__note strong {
  color: var(--ge-text-strong);
}

.lp-hero__visual {
  position: relative;
  padding-bottom: 88px;
}

/* A screenshot in a browser-window frame */
.lp-shot {
  margin: 0;
  overflow: hidden;
  background: var(--ge-surface);
  border: 1px solid var(--ge-border);
  border-radius: var(--ge-radius-lg);
  box-shadow: 0 30px 60px color-mix(in srgb, var(--ge-shadow-tint) 14%, transparent), 0 6px 16px color-mix(in srgb, var(--ge-shadow-tint) 6%, transparent);
}

.lp-shot__bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--ge-surface-soft);
  border-bottom: 1px solid var(--ge-border);
}

.lp-shot__bar span {
  width: 10px;
  height: 10px;
  background: var(--ge-border-strong);
  border-radius: 50%;
}

.lp-shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* The hero's task screenshot starts the demo (docs/planning/free-demo-overlay.md): the whole picture is one link, and
   its button sits bottom right, clear of the result screenshot over the bottom left */
/* Not drawn as a link: no underline (site.css) or bottom border (above), so the selector beats both */
.ge-app-shell.ge-landing-page .lp-shot a.lp-shot__link:not(.btn):not(.nav-link):not(.ge-brand) {
  position: relative;
  display: block;
  border-bottom: 0;
  text-decoration: none;
}

.lp-shot__try {
  position: absolute;
  right: 20px;
  bottom: 20px;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--ge-shadow-tint) 24%, transparent);
  pointer-events: none;
}

.lp-shot__link:hover .lp-shot__try,
.lp-shot__link:focus-visible .lp-shot__try {
  background: var(--ge-primary-hover-dark);
  border-color: var(--ge-primary-hover-dark);
}

/* Inside the picture's edge: .lp-shot clips anything drawn outside it */
.lp-shot__link:focus-visible {
  outline: 2px solid var(--ge-primary-dark);
  outline-offset: -2px;
}

.lp-shot--float {
  position: absolute;
  bottom: 0;
  left: -48px;
  width: 56%;
  border-radius: var(--ge-radius-md);
  box-shadow: 0 24px 48px color-mix(in srgb, var(--ge-shadow-tint) 22%, transparent), 0 4px 12px color-mix(in srgb, var(--ge-shadow-tint) 8%, transparent);
}

/* Trust strip */

.lp-proof {
  padding: 8px 0 32px;
}

.lp-proof__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 auto;
  list-style: none;
}

.lp-proof__item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: color-mix(in srgb, var(--ge-surface) 82%, transparent);
  border: 1px solid var(--ge-border);
  border-radius: var(--ge-radius-lg);
}

/* The icon is its own 40px tinted tile: the padding leaves an 18px glyph */
.lp-proof__item > .ge-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 11px;
  color: var(--ge-primary);
  background: var(--ge-primary-soft);
  border-radius: var(--ge-radius-md);
}

.lp-proof__item strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ge-text-strong);
  font-size: var(--ge-font-md);
  line-height: 1.3;
}

.lp-proof__item span {
  display: block;
  color: var(--ge-text-muted);
  font-size: var(--ge-font-sm);
  line-height: 1.4;
}

/* Sections */

.lp-section {
  padding: 96px 0;
}

.lp-section--tinted {
  background: linear-gradient(180deg, color-mix(in srgb, var(--ge-surface) 70%, transparent) 0%, color-mix(in srgb, var(--ge-primary-soft) 65%, transparent) 100%);
  border-top: 1px solid var(--ge-border);
  border-bottom: 1px solid var(--ge-border);
}

.lp-section__head {
  max-width: 760px;
  margin: 0 auto 64px;
  text-align: center;
}

.lp-section__title {
  margin: 0 0 14px;
  color: var(--ge-text-strong);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lp-section__lead {
  margin: 0;
  color: var(--ge-text-muted);
  font-size: var(--ge-font-lg);
  line-height: 1.55;
}

/* Feature rows: a screenshot beside its story */

.lp-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.lp-feature + .lp-feature {
  margin-top: 104px;
}

.lp-feature--reverse {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
}

.lp-feature--reverse .lp-feature__shot {
  order: 2;
}

.lp-feature__step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--ge-primary-dark);
  font-size: var(--ge-font-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lp-feature__step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--ge-on-primary);
  font-size: var(--ge-font-sm);
  letter-spacing: 0;
  background: linear-gradient(180deg, var(--ge-primary) 0%, var(--ge-primary-dark) 100%);
  border-radius: var(--ge-radius-md);
}

.lp-feature__title {
  margin: 0 0 16px;
  color: var(--ge-text-strong);
  font-size: clamp(22px, 2.3vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lp-feature__copy > p {
  margin: 0;
  font-size: var(--ge-font-lg);
  line-height: 1.6;
}

.lp-checks {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.lp-checks li {
  position: relative;
  padding-left: 34px;
  line-height: 1.45;
}

.lp-checks li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  background: var(--ge-success-soft) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3e%3cpath d='M2.5 6.2l2.3 2.3 4.7-4.9' fill='none' stroke='%232ea06a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e") center / 12px no-repeat;
  border-radius: 50%;
}

/* Audience */

.lp-audience {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.lp-audience__list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-audience__list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  color: var(--ge-text-strong);
  font-size: var(--ge-font-lg);
  font-weight: 600;
  background: var(--ge-surface);
  border: 1px solid var(--ge-border);
  border-radius: var(--ge-radius-md);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--ge-shadow-tint) 5%, transparent);
}

.lp-audience__list .ge-icon {
  width: 22px;
  height: 22px;
  color: var(--ge-primary);
}

/* Plans: the cards are site.css .ge-plans and .ge-plan-card, shared with Тарифы */

.lp-plans {
  margin: 0 auto;
}

.lp-pricing__note {
  margin: 32px 0 0;
  color: var(--ge-text-muted);
  text-align: center;
}

.lp-pricing__note a {
  margin-left: 6px;
}

/* Closing call to action */

.lp-cta {
  padding: 0 0 96px;
}

.lp-cta__box {
  padding: 64px 32px;
  color: var(--ge-on-primary);
  text-align: center;
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--ge-surface) 16%, transparent), transparent 42%),
    linear-gradient(135deg, var(--ge-primary-dark) 0%, var(--ge-primary-deep) 55%, var(--ge-primary-deeper) 100%);
  border-radius: var(--ge-radius-2xl);
  box-shadow: 0 30px 60px color-mix(in srgb, var(--ge-primary-deep) 28%, transparent);
}

.lp-cta__title {
  margin: 0 0 12px;
  color: var(--ge-on-primary);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lp-cta__lead {
  max-width: 36em;
  margin: 0 auto 28px;
  color: color-mix(in srgb, var(--ge-surface) 92%, transparent);
  font-size: var(--ge-font-lg);
  line-height: 1.5;
}

/* Войти in the closing block's text: on the purple, so not the usual link colour. It has to beat site.css's link rule
   (.ge-app-shell a:not(…) x6, (0,7,1)) as well as the landing's own above */
.ge-app-shell.ge-landing-page .lp-cta__lead a.lp-cta__link:not(.btn):not(.nav-link):not(.ge-brand),
.ge-app-shell.ge-landing-page .lp-cta__lead a.lp-cta__link:not(.btn):not(.nav-link):not(.ge-brand):hover {
  color: var(--ge-on-primary);
  border-bottom: 0;
  text-decoration: underline;
}

.lp-cta .btn-light {
  color: var(--ge-primary-dark);
  background: var(--ge-surface);
  border-color: var(--ge-surface);
}

.lp-cta .btn-light:hover,
.lp-cta .btn-light:focus {
  color: var(--ge-text-strong);
  background: var(--ge-primary-soft);
}

.lp-cta .btn-outline-light {
  color: var(--ge-on-primary);
  background: transparent;
  border: 2px solid color-mix(in srgb, var(--ge-surface) 75%, transparent);
}

.lp-cta .btn-outline-light:hover,
.lp-cta .btn-outline-light:focus {
  color: var(--ge-on-primary);
  background: color-mix(in srgb, var(--ge-surface) 14%, transparent);
  border-color: var(--ge-surface);
}

/* ---------- Smaller screens ---------- */

@media (max-width: 991.98px) {
  .lp-hero {
    padding: 40px 0 32px;
  }

  .lp-hero__grid,
  .lp-feature,
  .lp-feature--reverse,
  .lp-audience {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .lp-shot--float {
    left: -16px;
    width: 52%;
  }

  .lp-feature--reverse .lp-feature__shot {
    order: 0;
  }

  .lp-feature + .lp-feature {
    margin-top: 72px;
  }

  .lp-proof__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-section {
    padding: 64px 0;
  }

  .lp-section__head {
    margin-bottom: 40px;
  }
}

@media (max-width: 575.98px) {
  /* Under the navbar, as wide as the screen */
  .ge-login-popup {
    position: fixed;
    top: 72px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .ge-login-popup__body {
    max-height: calc(100vh - 84px);
    max-height: calc(100dvh - 84px);
    padding: 24px 20px 18px;
  }

  .ge-login-popup::before {
    display: none;
  }

  .lp-container {
    padding: 0 16px;
  }

  .lp-hero__lead {
    font-size: var(--ge-font-lg);
  }

  /* The same screenshots follow a screen below, in the features */
  .lp-hero__visual {
    display: none;
  }

  .lp-proof__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .lp .btn-lg {
    width: 100%;
  }

  .lp-cta {
    padding-bottom: 64px;
  }

  .lp-cta__box {
    padding: 40px 20px;
    border-radius: var(--ge-radius-xl);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ge-login-popup--opening {
    animation: none;
  }
}
