:root {
  --red: #c1121f;
  --red-dark: #9f0f1a;
  --green: #006847;
  --green-soft: #eef8f4;
  --white: #ffffff;
  --ink: #111827;
  --text: #344054;
  --muted: #667085;
  --border: #e1e7ec;
  --surface: #f7f9fb;
  --shadow: 0 22px 70px rgba(16, 24, 40, 0.1);
  --soft-shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
  --font: "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 18%, rgba(193, 18, 31, 0.05), transparent 260px),
    radial-gradient(circle at 80% 18%, rgba(0, 104, 71, 0.05), transparent 280px),
    var(--white);
  font-family: var(--font);
  overflow: hidden;
}

body,
button,
input,
select {
  font-family: var(--font);
}

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

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 66px 1fr 46px;
}

.header {
  border-bottom: 2px solid var(--red);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.header-inner,
.footer-inner {
  width: min(1160px, calc(100% - 72px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text strong {
  color: var(--red);
  font-size: 20px;
  font-weight: 850;
}

.brand-text small {
  margin-top: 4px;
  color: #475467;
  font-size: 10.4px;
  font-weight: 500;
}

.language {
  position: relative;
}

.language-button {
  height: 32px;
  min-width: 116px;
  border: 1px solid #e0e6eb;
  border-radius: 10px;
  background: var(--white);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  box-shadow: 0 5px 14px rgba(16, 24, 40, 0.045);
  font-size: 12px;
}

.language-button img {
  width: 15px;
  height: 15px;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 150px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
  display: none;
  z-index: 20;
}

.language.open .language-menu {
  display: grid;
  gap: 3px;
}

.language-menu button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  font-size: 12px;
}

.language-menu button.active,
.language-menu button:hover {
  background: var(--green-soft);
  color: var(--green);
}

.main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 6px;
}

.auth-wrap {
  width: min(1060px, calc(100% - 72px));
}

.auth-card {
  height: 438px;
  display: grid;
  grid-template-columns: 500px 1fr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.auth-hero {
  position: relative;
  height: 100%;
  min-height: 438px;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: #f5f7f6;
}

.auth-hero picture,
.auth-hero-image {
  width: 100%;
  height: 100%;
}

.auth-hero picture {
  position: absolute;
  inset: 0;
  display: block;
  aspect-ratio: auto;
}

.auth-hero-image {
  display: block;
  object-fit: cover;
  object-position: 22% center;
  filter: saturate(0.92) contrast(0.99) brightness(0.99);
}

.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-hero::before {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, transparent 9%, transparent 91%, rgba(255, 255, 255, 0.06) 100%),
    linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.12) 60%, rgba(0, 0, 0, 0.58) 100%);
}

.auth-hero::after {
  z-index: 2;
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.3);
}

.auth-hero-overlay {
  position: absolute;
  z-index: 3;
  left: 26px;
  bottom: 24px;
  width: 360px;
  max-width: calc(100% - 52px);
  padding: 10px 13px 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--white);
  backdrop-filter: blur(5px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.auth-hero-overlay h1,
.auth-hero-overlay h2,
.auth-hero-overlay p {
  margin: 0;
}

.auth-hero-overlay h1 {
  font-size: 17px;
  line-height: 1.12;
  font-weight: 820;
}

.auth-hero-overlay h2 {
  margin-top: 3px;
  font-size: 12.4px;
  line-height: 1.18;
  font-weight: 600;
}

.auth-hero-overlay p {
  margin-top: 6px;
  max-width: 320px;
  color: rgba(255, 255, 255, 0.91);
  font-size: 9.9px;
  line-height: 1.35;
}

.auth-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 24px 34px;
}

body[data-auth-mode="register"] .auth-panel {
  padding: 16px 28px;
}

.tabs {
  height: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 17px;
  padding: 4px;
  border: 1px solid #e5eaee;
  border-radius: 11px;
  background: #f4f6f7;
}

body[data-auth-mode="register"] .tabs {
  margin-bottom: 8px;
}

.tab {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.tab.active {
  background: var(--white);
  color: var(--red);
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.08);
}

.form-screen,
.register-flow {
  display: none;
}

.form-screen.active,
.register-flow.active {
  display: block;
}

.form-screen {
  max-height: 100%;
  min-height: 0;
}

.register-flow {
  max-height: 100%;
}

.form-title {
  margin: 0 0 15px;
  font-size: 18.2px;
  line-height: 1.15;
  font-weight: 850;
}

body[data-auth-mode="register"] .form-title {
  margin-bottom: 8px;
  font-size: 16.8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body[data-auth-mode="register"] .form-grid {
  gap: 7px 10px;
}

.field {
  display: grid;
  gap: 5px;
  color: var(--text);
  font-size: 11px;
}

body[data-auth-mode="register"] .field {
  gap: 3px;
  font-size: 10px;
}

.full {
  grid-column: 1 / -1;
}

.input,
.select {
  width: 100%;
  height: 37px;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  outline: 0;
  background: var(--white);
  color: var(--text);
  padding: 0 12px;
  font-size: 12.2px;
}

body[data-auth-mode="register"] .input,
body[data-auth-mode="register"] .select {
  height: 32px;
  font-size: 11.4px;
}

.input:focus,
.select:focus,
.password-toggle:focus,
.language-button:focus,
.language-menu button:focus,
.link-button:focus,
.secondary-link button:focus,
.modal-close:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 104, 71, 0.08);
}

.input.invalid {
  border-color: var(--red);
}

.error {
  min-height: 13px;
  color: var(--red);
  font-size: 10.2px;
  line-height: 1.25;
}

body[data-auth-mode="register"] .error {
  min-height: 0;
  font-size: 9px;
  line-height: 1.15;
}

.block-error {
  display: block;
  margin-top: -2px;
  margin-bottom: 7px;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap .input {
  padding-right: 66px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  min-width: 54px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: #f1f4f6;
  color: var(--red);
  transform: translateY(-50%);
  font-size: 10.5px;
  font-weight: 800;
}

body[data-auth-mode="register"] .password-toggle {
  height: 22px;
  min-width: 50px;
  font-size: 9.4px;
}

.login-options,
.terms,
.checkline {
  display: flex;
  align-items: center;
}

.login-options {
  justify-content: space-between;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 10.8px;
}

.checkline,
.terms {
  gap: 8px;
}

.terms {
  align-items: flex-start;
  margin: 9px 0 10px;
  color: var(--text);
  font-size: 10.2px;
  line-height: 1.35;
}

.terms a {
  color: var(--red);
  font-weight: 800;
}

.terms a:hover,
.terms a:focus-visible {
  text-decoration: underline;
}

body[data-auth-mode="register"] .terms {
  margin: 7px 0 5px;
  font-size: 9.2px;
  line-height: 1.25;
}

.consent-note {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 9.8px;
  line-height: 1.35;
}

body[data-auth-mode="register"] .consent-note {
  margin: 0 0 6px;
  font-size: 8.8px;
  line-height: 1.25;
}

.checkline input,
.terms input,
.choice input {
  accent-color: var(--red);
}

.link-button,
.secondary-link button {
  border: 0;
  background: transparent;
  color: var(--red);
  padding: 0;
  font-weight: 800;
}

.primary,
.secondary-action {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  font-size: 12.8px;
  font-weight: 850;
}

body[data-auth-mode="register"] .primary,
body[data-auth-mode="register"] .secondary-action {
  height: 32px;
}

.auth-submit {
  display: block;
  position: relative;
  z-index: 2;
  visibility: visible;
  opacity: 1;
  margin-top: 4px;
}

.primary {
  border: 0;
  background: var(--red);
  color: var(--white);
  box-shadow: 0 12px 22px rgba(193, 18, 31, 0.17);
}

.primary:hover {
  background: var(--red-dark);
}

.primary:disabled {
  cursor: not-allowed;
  background: #c7cdd4;
  box-shadow: none;
}

.primary.loading,
.secondary-action.loading {
  cursor: wait;
}

.secondary-action {
  margin: 10px 0;
  border: 1px solid rgba(0, 104, 71, 0.22);
  background: var(--green-soft);
  color: var(--green);
}

.secondary-action:disabled {
  cursor: not-allowed;
  border-color: #d5dbe1;
  background: #f0f2f4;
  color: var(--muted);
}

.secondary-link {
  margin: 9px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 10.8px;
}

body[data-auth-mode="register"] .secondary-link {
  margin-top: 6px;
}

.step-mini {
  display: flex;
  gap: 7px;
  margin-bottom: 12px;
}

body[data-auth-mode="register"] .step-mini {
  margin-bottom: 6px;
}

.dot {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: #e5eaee;
}

.dot.active {
  background: var(--red);
}

.password-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

body[data-auth-mode="register"] .password-meter {
  margin-top: 7px;
  gap: 8px;
  font-size: 9.2px;
}

.password-meter span {
  height: 5px;
  border-radius: 999px;
  background: #e5eaee;
  overflow: hidden;
}

.password-meter span::before {
  content: "";
  display: block;
  width: var(--strength-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--strength-color, #e5eaee);
  transition: width 0.2s ease;
}

.agency-choice {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.choice {
  min-height: 46px;
  display: grid;
  grid-template-columns: 1fr 18px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #dfe7ec;
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

.choice:has(input:checked) {
  border-color: var(--green);
  background: #fbfffc;
}

.invite-code {
  display: none;
  margin-bottom: 10px;
}

.invite-code.visible {
  display: grid;
}

.phone-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
}

.code-field {
  margin: 2px 0 10px;
}

.otp-status {
  min-height: 14px;
  margin: -4px 0 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.bot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.trust {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(220px, 0.92fr);
  gap: 7px;
  margin-top: 7px;
}

.trust-item {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #e6ecef;
  border-radius: 8px;
  background: var(--white);
  padding: 6px 9px;
  text-align: center;
}

.trust-item img {
  width: 21px;
  height: 21px;
}

.trust-item span {
  color: var(--ink);
  font-size: 10.6px;
  font-weight: 500;
}

.trust-apps {
  min-height: 38px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid #e6ecef;
  border-radius: 8px;
  background: var(--white);
  padding: 6px;
}

.trust-apps a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-radius: 6px;
}

.trust-apps a:focus-visible,
.trust-apps a:hover {
  box-shadow: 0 0 0 3px rgba(0, 104, 71, 0.08);
}

.trust-apps img {
  width: 86px;
  max-width: 100%;
  height: 24px;
  display: block;
}

.footer {
  background: var(--red);
  color: var(--white);
}

.footer strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}

.footer span,
.footer-links {
  font-size: 9px;
}

.footer span {
  display: block;
  margin-top: 3px;
}

.footer-links {
  display: flex;
  gap: 18px;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100% - 36px));
  display: none;
  border: 1px solid var(--border);
  border-left: 5px solid var(--green);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 13px 15px;
  color: var(--text);
  font-size: 13px;
}

.toast.error {
  border-left-color: var(--red);
}

.modal {
  width: min(420px, calc(100% - 32px));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0;
}

.modal::backdrop {
  background: rgba(17, 24, 39, 0.35);
}

.modal form {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
}

.modal h2,
.modal p {
  margin: 0;
}

.modal h2 {
  font-size: 20px;
}

.modal p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f1f4f6;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

body.legal-page {
  overflow: auto;
}

.content-shell {
  min-height: 100vh;
}

.content-main {
  width: min(1040px, calc(100% - 72px));
  margin: 0 auto;
  padding: 26px 0 32px;
}

.content-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--soft-shadow);
  padding: 30px;
}

.content-card h1 {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.15;
}

.content-card .lead {
  max-width: 720px;
  margin: 0 0 22px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.notice {
  margin: 0 0 18px;
  border-left: 4px solid var(--red);
  border-radius: 8px;
  background: #fff6f7;
  padding: 12px 14px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.legal-section {
  display: grid;
  gap: 7px;
  border-top: 1px solid #eef2f5;
  padding: 16px 0;
}

.legal-section:last-child {
  padding-bottom: 0;
}

.legal-section h2,
.contact-form h2 {
  margin: 0;
  color: var(--red);
  font-size: 16px;
  line-height: 1.25;
}

.legal-section p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.legal-section ul {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.company-info {
  border: 1px solid #e6ecef;
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.compact-notice {
  margin-bottom: 22px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 26px;
}

.contact-info {
  display: grid;
  gap: 7px;
  min-height: 86px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.contact-info strong {
  color: var(--green);
  font-size: 12px;
}

.contact-info span {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  border-top: 1px solid #eef2f5;
  padding-top: 22px;
}

.contact-form h2,
.contact-form .full,
.contact-form .primary {
  grid-column: 1 / -1;
}

.textarea {
  min-height: 120px;
  resize: vertical;
  padding-top: 10px;
  line-height: 1.5;
}

@media (pointer: coarse) {
  .language-button,
  .primary,
  .secondary-action,
  .tab {
    min-height: 42px;
  }

  .password-toggle {
    min-height: 30px;
  }
}

@media (max-width: 1120px) {
  .auth-card {
    grid-template-columns: 470px 1fr;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .shell {
    display: block;
  }

  .header-inner,
  .footer-inner,
  .auth-wrap,
  .content-main {
    width: calc(100% - 28px);
  }

  .header-inner {
    padding: 12px 0;
  }

  .main {
    padding: 18px 0;
  }

  .auth-card {
    height: auto;
    grid-template-columns: 1fr;
  }

  .auth-hero {
    height: 340px;
    min-height: 340px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .auth-panel {
    padding: 24px;
  }

  .trust {
    grid-template-columns: 1fr 1fr;
  }

  .trust-apps {
    grid-column: 1 / -1;
  }

  .footer-inner {
    min-height: 70px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    padding: 12px 0;
  }

  .footer-links {
    flex-wrap: wrap;
  }

  .content-main {
    padding: 18px 0 24px;
  }

  .content-card {
    padding: 22px;
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .brand-text strong {
    font-size: 18px;
  }

  .brand-text small {
    font-size: 9.5px;
  }

  .language-button {
    min-width: 104px;
    padding-inline: 8px;
  }

  .auth-hero {
    height: 300px;
    min-height: 300px;
  }

  .auth-hero-overlay {
    left: 18px;
    bottom: 18px;
    max-width: calc(100% - 36px);
  }

  .form-grid,
  .phone-row,
  .trust,
  .contact-grid,
  .contact-form {
    grid-template-columns: 1fr;
  }

  .trust-apps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-card h1 {
    font-size: 24px;
  }
}
