:root {
  --bg-main: #f6f9fe;
  --bg-elevated: #ffffff;
  --bg-elevated-soft: #eef3fd;
  --border-subtle: rgba(98, 117, 235, 0.18);
  --accent: #6275eb;
  --accent-soft: #7b8bef;
  --text-main: #444c63;
  --text-muted: rgba(68, 76, 99, 0.62);
  --shadow-soft: 0 18px 40px rgba(98, 117, 235, 0.14);
  --shadow-accent: 0 14px 28px rgba(98, 117, 235, 0.32);
  --radius-card: 28px;
  --radius-control: 16px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

body {
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  background: rgba(98, 117, 235, 0.08);
}

body::after {
  width: 220px;
  height: 220px;
  bottom: 80px;
  left: -70px;
  background: rgba(98, 117, 235, 0.06);
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 32px;
}

.app-hero {
  width: 100%;
  max-width: 420px;
  text-align: center;
  margin-bottom: 18px;
}

.app-hero__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: linear-gradient(145deg, #eef3fd, #ffffff);
  box-shadow: 0 12px 28px rgba(98, 117, 235, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-hero__icon img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.app-hero__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.app-hero__subtitle {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.app__main {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screen-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-card);
  padding: 22px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
}

.screen-card__title {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

.screen-card__status {
  margin: -10px 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.generated-badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6275eb, #7b8bef);
  box-shadow: var(--shadow-accent);
  color: #ffffff;
}

.generated-badge svg {
  display: block;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8faff 0%, #f3f7fe 100%);
  border: 1px solid rgba(98, 117, 235, 0.08);
}

.info-row__icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(98, 117, 235, 0.16), rgba(98, 117, 235, 0.08));
  color: var(--accent);
}

.info-row__body {
  min-width: 0;
}

.info-row__label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.info-row__value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  word-break: break-word;
}

.info-row__value--accent {
  color: var(--accent);
  font-size: 18px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.field-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon__glyph {
  position: absolute;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
}

.field-icon__glyph svg {
  display: block;
}

.field-icon__input,
.form__input,
.phone-login {
  width: 100%;
  min-height: 52px;
  padding: 0 14px 0 46px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.field-icon__input:focus,
.form__input:focus {
  border-color: rgba(98, 117, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(98, 117, 235, 0.12);
}

.phone-login {
  display: flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.phone-login__prefix {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding-left: 46px;
  padding-right: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.phone-login__input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 14px 0 0;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 15px;
  outline: none;
}

.phone-login:focus-within {
  border-color: rgba(98, 117, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(98, 117, 235, 0.12);
}

.field-icon--phone .field-icon__glyph,
.field-icon--login .field-icon__glyph {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.field-icon--login .phone-login,
.field-icon--phone .phone-login {
  width: 100%;
}

.field-icon--login .phone-login__input {
  padding-left: 0;
}

.screen-card--compact {
  padding: 16px 14px 14px;
}

.screen-card--compact .info-row {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 14px;
}

.screen-card--compact .info-row__icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.screen-card--compact .info-row__value--accent {
  font-size: 16px;
}

.screen-card--compact .form,
.screen-card--compact .btn--compact {
  margin-top: 0;
}

.screen-card--compact .btn--compact {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
}

.screen-card--compact .btn--compact + .btn--compact,
.screen-card--compact .btn--compact + form,
.screen-card--compact form + .btn--compact,
.screen-card--compact .qr-block + .remaining-note,
.screen-card--compact .remaining-note + .alert,
.screen-card--compact .alert + form,
.screen-card--compact .btn--primary + .qr-block {
  margin-top: 10px;
}

.screen-card--compact .qr-block {
  margin-top: 10px;
}

.screen-card--compact .qr-block__frame {
  padding: 12px;
  border-radius: 16px;
}

.screen-card--compact .qr-block__frame img {
  width: min(100%, 160px);
}

.screen-card--compact .remaining-note {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.screen-card--compact .alert {
  margin-top: 10px !important;
}

.screen-card--compact .btn--compact + .btn--compact,
.screen-card--compact form + .btn--compact {
  margin-top: 10px;
}

.form--inline-top {
  margin-top: 10px;
}

.ad-slot {
  min-height: 120px;
  margin-top: 4px;
  padding: 16px;
  border-radius: var(--radius-card);
  border: 2px dashed rgba(98, 117, 235, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(238, 243, 253, 0.88) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ad-slot__inner {
  width: 100%;
  min-height: 88px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(98, 117, 235, 0.35);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(98, 117, 235, 0.04),
      rgba(98, 117, 235, 0.04) 8px,
      rgba(255, 255, 255, 0.5) 8px,
      rgba(255, 255, 255, 0.5) 16px
    );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.ad-slot__badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(98, 117, 235, 0.12);
}

.ad-slot__hint {
  font-size: 11px;
  color: rgba(68, 76, 99, 0.45);
}

.password-field {
  position: relative;
}

.password-field__input {
  padding-right: 48px;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 3;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.password-field__toggle:hover {
  color: var(--accent);
  background: rgba(98, 117, 235, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 18px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn--full {
  width: 100%;
}

.btn--primary {
  background: linear-gradient(135deg, #6275eb, #7b8bef);
  color: #ffffff;
  box-shadow: var(--shadow-accent);
}

.btn--primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #5568d8, #6275eb);
}

.btn--primary svg {
  flex-shrink: 0;
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(98, 117, 235, 0.35);
  box-shadow: none;
}

.btn--outline:hover {
  background: rgba(98, 117, 235, 0.06);
}

.other-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(98, 117, 235, 0.1);
}

.other-actions__title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 18px;
  background: var(--bg-elevated);
  border: 1px solid rgba(98, 117, 235, 0.1);
  box-shadow: 0 8px 20px rgba(98, 117, 235, 0.08);
  text-decoration: none;
  color: var(--text-main);
}

.action-row:last-child {
  margin-bottom: 0;
}

.action-row__icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6275eb, #7b8bef);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(98, 117, 235, 0.24);
}

.action-row__label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

.action-row__chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

.qr-block {
  margin-top: 18px;
}

.qr-block__label {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.qr-block__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 22px;
  border: 2px dashed rgba(98, 117, 235, 0.22);
  background: linear-gradient(180deg, #fbfcff 0%, #f5f8fe 100%);
}

.qr-block__frame img {
  display: block;
  width: min(100%, 220px);
  height: auto;
  border-radius: 12px;
}

.remaining-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(98, 117, 235, 0.08);
  font-size: 14px;
  color: var(--text-main);
}

.alert {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.alert--error {
  background: rgba(224, 82, 82, 0.1);
  border: 1px solid rgba(224, 82, 82, 0.35);
  color: #b91c1c;
}

.alert--success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #15803d;
}

.alert--info {
  background: rgba(98, 117, 235, 0.1);
  border: 1px solid rgba(98, 117, 235, 0.28);
  color: var(--accent);
}

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-card);
  padding: 22px 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.card__title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
}

.card__text {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text-muted);
}

@supports (-webkit-touch-callout: none) {
  .btn,
  .form__input,
  .field-icon__input,
  .phone-login__input {
    -webkit-appearance: none;
    appearance: none;
  }

  .btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* Демо-версии главной: один экран мобильного без полосы прокрутки */
body:has(.app--one-screen) {
  overflow: hidden;
  height: 100dvh;
}

.app--one-screen {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: 8px 12px 10px;
  justify-content: flex-start;
  box-sizing: border-box;
}

.app--one-screen .app-hero {
  margin-bottom: 6px;
  flex-shrink: 0;
  width: 100%;
  max-width: 420px;
}

.app--one-screen .app__main {
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  gap: 6px;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
}

.app--one-screen .app__main .ad-slot--footer {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 0;
  padding: 0;
  min-height: 0;
  box-shadow: var(--shadow-soft);
}

.app--one-screen .app__main .ad-slot--footer .ad-slot__inner {
  min-height: 72px;
  border: 2px dashed rgba(98, 117, 235, 0.5);
  background: linear-gradient(180deg, #ffffff 0%, #eef3fd 100%);
}

.app-hero--centered {
  text-align: center;
}

.app-hero--centered .app-hero__inline {
  justify-content: center;
}

.app-hero--centered .app-hero__subtitle--inline {
  text-align: center;
}

.app-hero__icon--compact {
  width: 44px;
  height: 44px;
  margin: 0 auto 6px;
  border-radius: 14px;
}

.app-hero__icon--compact img {
  width: 32px;
  height: 32px;
}

.app-hero__title--compact {
  font-size: 22px;
}

.app--one-screen .app-hero__subtitle {
  margin-top: 4px;
  font-size: 11px;
}

.app-hero__inline {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: center;
}

.app-hero__icon--inline {
  width: 44px;
  height: 44px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 14px;
}

.app-hero__icon--inline img {
  width: 32px;
  height: 32px;
}

.app-hero__logo-inline {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(98, 117, 235, 0.14);
}

.app-hero__inline-text {
  min-width: 0;
}

.app-hero__title--inline {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.app-hero__subtitle--inline {
  margin: 2px 0 0;
  text-align: center;
}

.app-hero__driver-line {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-main);
  text-align: center;
}

.app-hero__driver-sep {
  margin: 0 0.35em;
  color: var(--text-muted);
  font-weight: 400;
}

.app-hero__driver-balance {
  color: var(--accent);
  font-weight: 700;
}

.screen-card--ultra {
  padding: 8px 10px;
  border-radius: 18px;
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden;
}

.screen-card--ultra .info-row {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 10px;
}

.screen-card--ultra .info-row__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.screen-card--ultra .info-row__icon svg {
  width: 16px;
  height: 16px;
}

.screen-card--ultra .info-row__label {
  font-size: 11px;
  margin-bottom: 0;
}

.screen-card--ultra .info-row__value {
  font-size: 14px;
}

.screen-card--ultra .info-row__value--accent {
  font-size: 15px;
}

.screen-card--ultra .btn--compact {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  margin-top: 0;
}

.screen-card--ultra .qr-block {
  margin-top: 8px;
}

.screen-card--ultra .qr-block__label {
  margin-bottom: 6px;
  font-size: 12px;
}

.screen-card--ultra .remaining-note--compact {
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 11px;
}

.screen-card--ultra .alert {
  margin-top: 6px !important;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.3;
}

.screen-card--ultra .form--inline-top,
.screen-card--ultra .form--compact {
  margin-top: 6px;
}

.screen-card--ultra .btn--compact + .btn--compact,
.screen-card--ultra form + .btn--compact,
.screen-card--ultra .alert + form,
.screen-card--ultra .remaining-note--compact + .alert,
.screen-card--ultra .qr-block + .remaining-note--compact,
.screen-card--ultra .pdf-qr-row + .remaining-note--compact,
.screen-card--ultra .btn--primary + .remaining-note--compact {
  margin-top: 6px;
}

.qr-block--compact .qr-block__frame {
  padding: 8px;
  border-radius: 14px;
}

.qr-block--compact .qr-block__frame img {
  width: min(100%, 120px);
}

.pdf-qr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

.btn--pdf-qr {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  min-height: 120px;
  padding: 8px 6px;
  border-radius: 14px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.btn--pdf-qr__label {
  display: block;
}

.pdf-qr-row__qr {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 14px;
  border: 2px dashed rgba(98, 117, 235, 0.22);
  background: linear-gradient(180deg, #fbfcff 0%, #f5f8fe 100%);
}

.pdf-qr-row__qr img {
  display: block;
  width: min(100%, 120px);
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

.ad-slot--compact {
  margin-top: 0;
  padding: 0;
  border-radius: 16px;
  flex-shrink: 0;
  min-height: 0;
}

.ad-slot--compact:not(.ad-slot--footer) {
  padding: 8px;
}

.ad-slot--compact .ad-slot__inner {
  min-height: 72px;
  padding: 10px;
}

.ad-slot--compact .ad-slot__label {
  font-size: 11px;
}

.ad-slot--compact .ad-slot__hint {
  font-size: 10px;
}

@media (max-height: 700px) {
  .app--one-screen {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .app-hero__title--compact,
  .app-hero__title--inline {
    font-size: 18px;
  }

  .app-hero__driver-line {
    font-size: 15px;
  }

  .screen-card--ultra .info-row {
    padding: 6px 8px;
    margin-bottom: 4px;
  }

  .btn--pdf-qr {
    width: 108px;
    height: 108px;
    min-height: 108px;
    flex-basis: 108px;
    font-size: 10px;
  }

  .pdf-qr-row__qr img {
    width: min(100%, 104px);
  }

  .qr-block--compact .qr-block__frame img {
    width: min(100%, 104px);
  }

  .ad-slot--compact .ad-slot__inner {
    min-height: 64px;
  }
}
