:root {
  --auth-navy: #101c2c;
  --auth-ink: #172334;
  --auth-muted: #667487;
  --auth-line: #dce5e8;
  --auth-surface: #ffffff;
  --auth-mint: #baf5df;
  --auth-teal: #0f9f8c;
  --auth-teal-dark: #087a6c;
  --auth-blue: #2879a8;
  --auth-blue-dark: #1e638d;
  --auth-danger: #a43b3b;
  --auth-danger-bg: #fff5f4;
  --auth-success: #176c54;
  --auth-success-bg: #effbf6;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f4f8f8;
}

body.auth-page {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--auth-ink);
  font-family: "Manrope", sans-serif;
  background:
    linear-gradient(rgba(16, 28, 44, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 28, 44, 0.025) 1px, transparent 1px),
    linear-gradient(135deg, rgba(186, 245, 223, 0.38), transparent 32%),
    linear-gradient(315deg, rgba(40, 121, 168, 0.1), transparent 28%),
    #f7faf9;
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
}

.auth-page a {
  color: var(--auth-accent);
  font-weight: 700;
  text-underline-offset: 3px;
}

.auth-page button,
.auth-page input {
  font: inherit;
}

.auth-page--professional {
  --auth-accent: var(--auth-teal);
  --auth-accent-dark: var(--auth-teal-dark);
  --auth-panel-wash: #eafaf5;
  --auth-panel-mark: rgba(15, 159, 140, 0.1);
}

.auth-page--customer {
  --auth-accent: var(--auth-blue);
  --auth-accent-dark: var(--auth-blue-dark);
  --auth-panel-wash: #edf7fb;
  --auth-panel-mark: rgba(40, 121, 168, 0.1);
}

.auth-shell {
  display: grid;
  width: min(1120px, calc(100% - 48px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 36px 0;
  place-items: center;
}

.auth-frame {
  width: 100%;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px 4px;
  color: var(--auth-navy);
  font-family: "Space Grotesk", sans-serif;
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
}

.auth-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(430px, 1.18fr);
  min-height: 650px;
  overflow: hidden;
  border: 1px solid rgba(16, 28, 44, 0.1);
  border-radius: 12px;
  background: var(--auth-surface);
  box-shadow: 0 24px 70px rgba(20, 45, 58, 0.13);
}

.auth-intro {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  padding: 58px 48px 42px;
  background: var(--auth-panel-wash);
}

.auth-intro::after {
  position: absolute;
  right: -85px;
  bottom: 90px;
  width: 250px;
  height: 250px;
  border: 1px solid var(--auth-panel-mark);
  border-radius: 32px;
  content: "";
  transform: rotate(38deg);
}

.auth-intro-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 44px;
  place-items: center;
  border: 1px solid rgba(16, 28, 44, 0.07);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 45, 58, 0.12);
  color: var(--auth-accent);
}

.auth-intro-icon .material-icons {
  font-size: 32px;
}

.auth-intro h1 {
  position: relative;
  z-index: 1;
  max-width: 280px;
  margin: 0;
  color: var(--auth-navy);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(34px, 3.2vw, 46px);
  letter-spacing: 0;
  line-height: 1.02;
}

.auth-intro h1::after {
  display: block;
  width: 48px;
  height: 3px;
  margin: 22px 0;
  background: var(--auth-accent);
  content: "";
}

.auth-intro-copy {
  position: relative;
  z-index: 1;
  max-width: 290px;
  margin: 0;
  color: #526274;
  font-size: 15px;
  line-height: 1.7;
}

.auth-benefits {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  margin: 30px 0 36px;
  padding: 0;
  list-style: none;
}

.auth-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #425466;
  font-size: 14px;
  font-weight: 650;
}

.auth-benefits .material-icons {
  color: var(--auth-accent);
  font-size: 20px;
}

.auth-trust {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 285px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(16, 28, 44, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #526274;
  font-size: 12px;
  line-height: 1.55;
}

.auth-trust .material-icons {
  color: var(--auth-accent);
  font-size: 25px;
}

.auth-form-panel {
  display: flex;
  align-items: center;
  padding: 58px clamp(48px, 7vw, 92px);
}

.auth-form-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.auth-form-header {
  margin-bottom: 32px;
}

.auth-form-header h2 {
  margin: 0 0 8px;
  color: var(--auth-navy);
  font-family: "Space Grotesk", sans-serif;
  font-size: 32px;
  letter-spacing: 0;
}

.auth-form-header p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field label {
  color: #263548;
  font-size: 13px;
  font-weight: 750;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  color: #7b8794;
  font-size: 20px;
  pointer-events: none;
  transform: translateY(-50%);
}

.auth-input-wrap input {
  width: 100%;
  height: 54px;
  padding: 0 48px;
  border: 1px solid #cad6da;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--auth-navy);
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-input-wrap input::placeholder {
  color: #8a96a3;
}

.auth-input-wrap input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-accent) 15%, transparent);
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #657382;
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle:hover {
  background: #f0f5f5;
  color: var(--auth-navy);
}

.auth-password-toggle .material-icons {
  font-size: 20px;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -2px;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4c5b6b;
  font-size: 13px;
  cursor: pointer;
}

.auth-remember input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--auth-accent);
}

.auth-forgot {
  min-height: 40px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--auth-accent);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.auth-forgot:hover {
  color: var(--auth-accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-forgot:disabled {
  cursor: wait;
  opacity: 0.6;
}

.auth-message {
  display: block;
  padding: 12px 14px;
  border: 1px solid #ebc4c0;
  border-radius: 8px;
  background: var(--auth-danger-bg);
  color: var(--auth-danger);
  font-size: 13px;
  line-height: 1.5;
}

.auth-message[hidden] {
  display: none;
}

.auth-message--success {
  border-color: #bde6d4;
  background: var(--auth-success-bg);
  color: var(--auth-success);
}

.auth-message a {
  color: inherit;
}

.auth-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--auth-accent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--auth-accent) 22%, transparent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-submit:hover:not(:disabled) {
  background: var(--auth-accent-dark);
  box-shadow: 0 13px 28px color-mix(in srgb, var(--auth-accent) 28%, transparent);
  transform: translateY(-1px);
}

.auth-submit:active:not(:disabled) {
  box-shadow: 0 6px 14px color-mix(in srgb, var(--auth-accent) 20%, transparent);
  transform: translateY(1px);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
}

.auth-spinner[hidden] {
  display: none;
}

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

.auth-register {
  margin: 26px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
  text-align: center;
}

.auth-shell--register {
  width: min(1200px, calc(100% - 48px));
}

.auth-card--register {
  grid-template-columns: minmax(320px, 0.78fr) minmax(500px, 1.22fr);
  min-height: 760px;
}

.auth-card--register .auth-form-panel {
  align-items: flex-start;
  padding: 48px clamp(44px, 6vw, 78px);
}

.auth-register-form {
  gap: 17px;
}

.auth-register-form .auth-field {
  position: relative;
}

.auth-register-form .auth-input-wrap input {
  height: 52px;
}

.auth-field-hint,
.auth-field-error {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.auth-field-hint {
  color: var(--auth-muted);
}

.auth-field-error {
  color: var(--auth-danger);
}

.auth-field-error[hidden] {
  display: none;
}

.auth-field:has(.auth-field-error:not([hidden])) .auth-field-hint {
  display: none;
}

.auth-input-wrap input[aria-invalid="true"] {
  border-color: var(--auth-danger);
  box-shadow: 0 0 0 3px rgba(164, 59, 59, 0.11);
}

.auth-choice-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.auth-choice-fieldset legend {
  margin-bottom: 10px;
  color: #263548;
  font-size: 13px;
  font-weight: 750;
}

.auth-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-radio-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #cad6da;
  border-radius: 8px;
  background: #fff;
  color: #425466;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.auth-radio-option:has(input:checked) {
  border-color: var(--auth-accent);
  background: color-mix(in srgb, var(--auth-accent) 9%, white);
  color: var(--auth-accent-dark);
}

.auth-radio-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--auth-accent);
}

.company-size-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.company-size-btn {
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid #cad6da;
  border-radius: 8px;
  background: #fff;
  color: #425466;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.company-size-btn:hover {
  border-color: var(--auth-accent);
}

.company-size-btn.active {
  border-color: var(--auth-accent);
  background: color-mix(in srgb, var(--auth-accent) 10%, white);
  color: var(--auth-accent-dark);
  box-shadow: inset 0 0 0 1px var(--auth-accent);
}

.auth-terms {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px 10px;
  align-items: start;
}

.auth-terms input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--auth-accent);
}

.auth-terms label {
  color: #4c5b6b;
  font-size: 12px;
  line-height: 1.6;
}

.auth-terms .auth-field-error {
  grid-column: 2;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--auth-accent);
  border-radius: 8px;
  background: #fff;
  color: var(--auth-accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.auth-secondary:hover {
  background: color-mix(in srgb, var(--auth-accent) 8%, white);
}

.auth-conditional[hidden] {
  display: none;
}

.suggestion-list {
  position: absolute;
  z-index: 20;
  top: calc(100% - 2px);
  right: 0;
  left: 0;
  max-height: 220px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 45, 58, 0.14);
  list-style: none;
}

.suggestion-list:empty {
  display: none !important;
}

.suggestion-list li {
  padding: 9px 11px;
  border-radius: 6px;
  color: #425466;
  font-size: 13px;
  cursor: pointer;
}

.suggestion-list li:hover,
.suggestion-list li:focus {
  outline: none;
  background: color-mix(in srgb, var(--auth-accent) 9%, white);
  color: var(--auth-accent-dark);
}

.auth-success-view {
  display: grid;
  min-height: 560px;
  place-items: center;
  text-align: center;
}

.auth-success-content {
  max-width: 470px;
}

.auth-success-icon {
  display: grid;
  width: 68px;
  height: 68px;
  margin: 0 auto 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--auth-panel-wash);
  color: var(--auth-accent);
}

.auth-success-icon .material-icons {
  font-size: 34px;
}

.auth-success-content h2 {
  margin: 0 0 12px;
  color: var(--auth-navy);
  font-family: "Space Grotesk", sans-serif;
  font-size: 32px;
}

.auth-success-content p {
  margin: 0 0 24px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.7;
}

.auth-page :focus-visible {
  outline: 3px solid color-mix(in srgb, var(--auth-accent) 35%, transparent);
  outline-offset: 3px;
}

@media (max-width: 880px) {
  .auth-shell {
    width: min(100% - 32px, 820px);
  }

  .auth-card {
    grid-template-columns: minmax(250px, 0.72fr) minmax(390px, 1.28fr);
  }

  .auth-intro {
    padding: 44px 30px 34px;
  }

  .auth-form-panel {
    padding: 48px 38px;
  }

  .auth-shell--register {
    width: min(100% - 32px, 860px);
  }

  .auth-card--register {
    grid-template-columns: minmax(240px, 0.68fr) minmax(430px, 1.32fr);
  }

  .auth-card--register .auth-form-panel {
    padding: 42px 32px;
  }

  .company-size-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  body.auth-page {
    background-size: 36px 36px, 36px 36px, auto, auto, auto;
  }

  .auth-shell {
    display: block;
    width: min(100% - 24px, 560px);
    padding: 20px 0 28px;
  }

  .auth-brand {
    margin-bottom: 14px;
  }

  .auth-card {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .auth-form-panel {
    order: 1;
    padding: 38px 26px;
  }

  .auth-intro {
    order: 2;
    min-height: 0;
    padding: 30px 26px;
  }

  .auth-intro-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 22px;
  }

  .auth-intro h1 {
    font-size: 30px;
  }

  .auth-intro h1::after {
    margin: 16px 0;
  }

  .auth-benefits {
    margin: 22px 0 26px;
  }

  .auth-trust {
    margin-top: 0;
  }

  .auth-page--register .auth-intro {
    order: 1;
  }

  .auth-page--register .auth-form-panel {
    order: 2;
  }

  .auth-page--register .auth-benefits,
  .auth-page--register .auth-trust {
    display: none;
  }

  .auth-card--register .auth-form-panel {
    padding: 34px 26px 38px;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .auth-shell {
    width: calc(100% - 20px);
    padding-top: 14px;
  }

  .auth-form-panel,
  .auth-intro {
    padding-right: 18px;
    padding-left: 18px;
  }

  .auth-form-header h2 {
    font-size: 28px;
  }

  .auth-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .auth-forgot {
    margin-left: 25px;
  }

  .company-size-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page *,
  .auth-page *::before,
  .auth-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}