@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #040608;
  --panel: #07111d;
  --panel-2: #081220;
  --line: rgba(119, 144, 176, 0.2);
  --line-strong: rgba(119, 144, 176, 0.35);
  --text: #f2f5fb;
  --muted: #a6b1c3;
  --muted-2: #7f8b9e;
  --accent: #f0a11f;
  --accent-2: #d88f18;
  --blue: #5ca4ff;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  --mono: "Roboto Mono", monospace;
  --sans: "Roboto Mono", monospace;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--sans);
}

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

button,
input {
  font: inherit;
}

.login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(10, 16, 26, 0.2), rgba(3, 5, 8, 0.7)),
    #040608;
}

.login-page {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 12px 18px;
  padding-bottom: calc(12px + var(--login-footer-h, 88px));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  min-height: 0;
}

.login-frame {
  width: 100%;
  border: 1px solid rgba(89, 110, 140, 0.24);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  background:
    linear-gradient(180deg, rgba(5, 9, 15, 0.4), rgba(5, 9, 15, 0.75)),
    #04070b;
  box-shadow: var(--shadow);
}

.login-left {
  position: relative;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(5, 8, 14, 0.22), rgba(5, 8, 14, 0.58)),
    url("/images/backgrounds/login-bg-16x9.png") center center / cover no-repeat,
    #06111f;
}

.login-left__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 7, 13, 0.16) 0%, rgba(3, 7, 13, 0.06) 45%, rgba(3, 7, 13, 0.18) 100%);
}

.login-left__content {
  position: relative;
  z-index: 1;
  min-height: 100%;
  padding: clamp(14px, 2.5vh, 36px) 40px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 0;
}

.brand-block__crm {
  font-family: var(--mono);
  font-size: 98px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(240, 161, 31, 0.14);
}

.brand-block__divider {
  width: 1px;
  height: 88px;
  background: rgba(240, 161, 31, 0.72);
}

.brand-block__text {
  font-family: var(--mono);
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: 0.16em;
  color: #ecf1f8;
}

.hero-copy {
  margin-top: 28px; /* вместо auto */
  max-width: min(640px, 100%);
  padding-bottom: 18px;
}

.hero-copy h1 {
  margin: 0;
  font-size: 62px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f6f8fb;
}

.hero-copy__accent {
  width: 84px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  margin: 26px 0 26px;
  box-shadow: 0 0 18px rgba(240, 161, 31, 0.24);
}

.hero-copy p {
  margin: 0;
  max-width: min(620px, 100%);
  font-size: 21px;
  line-height: 1.5;
  color: rgba(230, 236, 245, 0.88);
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 38px;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 96px;
}

.feature-card__icon {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(240, 161, 31, 0.45);
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(8, 17, 29, 0.28);
}

.feature-card__icon img {
  width: 28px;
  height: 28px;
  display: block;
}

.feature-card__body {
  padding-top: 3px;
}

.feature-card__title {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 8px;
}

.feature-card__text {
  font-size: 15px;
  line-height: 1.45;
  color: rgba(220, 228, 239, 0.86);
}

@media (min-width: 1101px) {
  .login-left {
    /* Совпадает с высотой правой колонки: иначе фон обрывается, снизу видна полоса .login-frame */
    min-height: var(--login-right-col-height, auto);
    max-height: var(--login-right-col-height, none);
    overflow-y: auto;
    overflow-x: hidden;
  }
}

.login-page-footer {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, transparent, rgba(3, 5, 8, 0.92) 28%, rgba(3, 5, 8, 0.98));
  border-top: 1px solid rgba(89, 110, 140, 0.14);
  pointer-events: none;
}

.login-page-footer__inner {
  max-width: 1920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  pointer-events: auto;
}

.login-page-footer__platform {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(237, 242, 248, 0.84);
}

.login-page-footer__platform img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.login-page-footer__copyright {
  font-size: 13px;
  color: rgba(171, 183, 199, 0.78);
}

.login-right {
  box-sizing: border-box;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  padding: 26px 24px;
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(4, 9, 16, 0.84), rgba(3, 6, 12, 0.94)),
    #050b13;
  border-left: 1px solid rgba(89, 110, 140, 0.16);
}

.auth-card {
  width: 620px;
  max-width: 100%;
  border: 1px solid rgba(115, 139, 170, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(6, 14, 24, 0.98), rgba(4, 10, 18, 0.98)),
    #07121d;
  padding: 38px 38px 30px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

.auth-card__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.auth-card__logo img {
  width: 92px;
  height: 92px;
}

.auth-card__title {
  margin: 0;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.auth-card__subtitle {
  margin: 12px 0 28px;
  text-align: center;
  font-size: 16px;
  color: var(--muted);
}

.auth-alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(201, 72, 72, 0.56);
  background: rgba(108, 30, 30, 0.28);
  color: #ffd6d6;
  border-radius: 12px;
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-label {
  margin: 14px 0 10px;
  font-size: 16px;
  font-weight: 500;
  color: #eef3f9;
}

.input-shell {
  height: 58px;
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(117, 141, 172, 0.34);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(4, 9, 15, 0.92);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-shell:focus-within {
  border-color: rgba(240, 161, 31, 0.72);
  box-shadow: 0 0 0 3px rgba(240, 161, 31, 0.08);
}

.input-shell__icon {
  width: 58px;
  min-width: 58px;
  border-right: 1px solid rgba(117, 141, 172, 0.24);
  display: grid;
  place-items: center;
}

.input-shell__icon img {
  width: 22px;
  height: 22px;
}

.input-shell input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 16px;
  font-size: 16px;
}

.input-shell input::placeholder {
  color: rgba(155, 166, 182, 0.9);
}

.password-toggle {
  width: 56px;
  min-width: 56px;
  border: 0;
  border-left: 1px solid rgba(117, 141, 172, 0.24);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.password-toggle img {
  width: 24px;
  height: 24px;
}

.auth-meta {
  margin: 18px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #edf2f8;
  font-size: 15px;
}

.remember-me input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.forgot-link {
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
}

.primary-button,
.secondary-button {
  height: 58px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.04em;
}

.primary-button {
  border: 1px solid var(--accent-2);
  background: linear-gradient(180deg, #f2a627, #dc9116);
  color: #101318;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(240, 161, 31, 0.2);
}

.primary-button img,
.secondary-button img {
  width: 22px;
  height: 22px;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 24px 0;
  color: rgba(154, 167, 185, 0.9);
  font-size: 16px;
}

.divider span {
  height: 1px;
  background: rgba(117, 141, 172, 0.24);
}

.divider em {
  font-style: normal;
}

.secondary-button {
  border: 1px solid rgba(240, 161, 31, 0.72);
  background: transparent;
  color: #f0f4fa;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.auth-stats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(117, 141, 172, 0.18);
  padding-top: 24px;
}

.auth-stat {
  text-align: center;
  padding: 0 12px;
  position: relative;
}

.auth-stat:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 0;
  width: 1px;
  height: 72px;
  background: rgba(117, 141, 172, 0.18);
}

.auth-stat__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.auth-stat__icon img {
  width: 24px;
  height: 24px;
}

.auth-stat__title {
  font-size: 15px;
  color: #eef2f8;
  margin-bottom: 4px;
}

.auth-stat__value {
  font-size: 15px;
  color: rgba(212, 220, 231, 0.82);
}

@media (max-width: 1380px) {
  .login-frame {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .brand-block__crm {
    font-size: 82px;
  }

  .hero-copy h1 {
    font-size: 50px;
  }

  .feature-row {
    grid-template-columns: 1fr;
    max-width: 760px;
  }
}

@media (max-width: 1100px) {
  .login-frame {
    grid-template-columns: 1fr;
  }

  .login-left {
    max-height: none;
    overflow-y: visible;
  }

  .login-right {
    width: 100%;
    max-width: none;
    border-left: 0;
    border-top: 1px solid rgba(89, 110, 140, 0.16);
  }
}

@media (max-width: 760px) {
  .login-page {
    padding: 10px;
    padding-bottom: calc(10px + var(--login-footer-h, 88px));
  }

  .login-frame {
    min-height: auto;
  }

  .login-left__content {
    padding: 28px 22px 24px;
  }

  .brand-block {
    gap: 14px;
  }

  .brand-block__crm {
    font-size: 56px;
  }

  .brand-block__divider {
    height: 58px;
  }

  .brand-block__text {
    font-size: 14px;
    letter-spacing: 0.12em;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .hero-copy p {
    font-size: 17px;
  }

  .feature-row {
    gap: 16px;
  }

  .auth-card {
    padding: 24px 18px 22px;
  }

  .auth-stats {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .auth-stat:not(:last-child)::after {
    display: none;
  }

  .auth-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
