:root {
  --overlay: #e7e8eb;
  --dialog-bg: #f7f7f8;
  --text-dark: #25282d;
  --text-body: #2f3338;
  --line: #d3d6da;
  --field-bg: #ffffff;
  --field-border: #9ca3ad;
  --accent: #007d93;
  --required: #d13438;
  --button-border: #a0a5ad;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", SegoeUI, Tahoma, Arial, sans-serif;
  color: var(--text-body);
  background: #eef0f2;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 34px 20px;
  position: relative;
  z-index: 3;
}

.form-card {
  width: min(100%, 720px);
  min-height: 660px;
  background: var(--dialog-bg);
  border-radius: 2px;
  border: 1px solid #d4d7dc;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.25);
  padding: 22px 30px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
  width: 100%;
}

.header-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ubl-logo {
  width: 156px;
  height: auto;
  display: block;
  object-fit: contain;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  color: var(--text-dark);
  font-family: "Segoe UI", SegoeUI, Tahoma, Arial, sans-serif;
  font-weight: 600;
}

.step-chip {
  display: inline-block;
  width: fit-content;
  font-size: 12px;
  color: #5e6670;
  background: #eef2f7;
  border: 1px solid #d6dce5;
  border-radius: 999px;
  padding: 2px 10px;
  line-height: 1.35;
}

.intro {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.4;
  color: #3b3f45;
  font-weight: 400;
  max-width: 560px;
  text-align: center;
}

.helper-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 24px;
  display: inline-block;
  width: fit-content;
  text-align: center;
}

.form-grid {
  margin-top: 12px;
  width: 100%;
}

.welcome-panel {
  border: 1px solid #d7dbe1;
  background: #ffffff;
  padding: 14px;
  margin-bottom: 12px;
}

.welcome-title {
  margin: 0 0 6px;
  font-size: 18px;
  color: #25282d;
}

.welcome-text {
  margin: 0;
  font-size: 14px;
  color: #4b5158;
}

.question {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: start;
  text-align: center;
  gap: 10px;
  margin: 14px 0;
}

#step-2 .question,
#step-3 .question {
  gap: 0;
}

#step-2 .question,
#step-3 .question {
  grid-template-columns: minmax(180px, 1fr) 24px minmax(260px, 1.15fr);
  justify-items: stretch;
  align-items: center;
  text-align: left;
  gap: 10px;
  margin: 14px 0;
}

#step-2 .label,
#step-3 .label {
  justify-content: flex-start;
  text-align: left;
}

#step-2 .radio-question {
  align-items: start;
}

#step-2 .radio-group {
  align-items: flex-start;
}

.captcha-question {
  display: flex;
  flex-direction: column;
  justify-items: initial;
  text-align: center;
  align-items: center;
  max-width: 560px;
  margin: 14px auto;
  gap: 8px;
}

.captcha-question > .label {
  justify-content: center;
  width: 100%;
  text-align: center;
}

.captcha-question > .asterisk {
  display: none;
}

.captcha-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.captcha-challenge {
  margin: 0;
  padding: 8px 10px;
  border: 1px dashed #aab2bc;
  background: #f8fafc;
  color: #25282d;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.captcha-challenge::before,
.captcha-challenge::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 1px;
  background: rgba(46, 71, 102, 0.2);
  pointer-events: none;
}

.captcha-challenge::before {
  top: 45%;
  transform: rotate(-2deg);
}

.captcha-challenge::after {
  top: 60%;
  transform: rotate(1deg);
}

.captcha-prefix {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #4f5966;
}

.captcha-word {
  display: inline-flex;
  align-items: center;
  letter-spacing: 0;
}

.captcha-char {
  display: inline-block;
  margin-right: 0;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  font-family: "Consolas", "Courier New", monospace;
  color: #1f2f46;
}

.captcha-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.captcha-controls .field,
.captcha-refresh {
  width: min(100%, 280px);
  min-width: 0;
}

.question > .asterisk {
  visibility: hidden;
}

.label {
  font-size: 14px;
  color: #3f4b63;
  margin: 0;
  font-weight: 400;
  white-space: normal;
  display: flex;
  align-items: center;
  justify-content: center;
}

.label::after {
  display: none;
}

.label .asterisk {
  color: var(--required);
  font-size: 18px;
  line-height: 0.65;
}

.field,
.date-field {
  width: 100%;
  border: 1px solid var(--field-border);
  border-radius: 0;
  height: 32px;
  padding: 7px 10px;
  font-size: 14px;
  color: #262b31;
  background: var(--field-bg);
  outline: none;
  font-family: "Segoe UI", SegoeUI, Tahoma, Arial, sans-serif;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select-field {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6e7781 50%),
    linear-gradient(135deg, #6e7781 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.field:focus,
.date-field:focus {
  border-color: #0078d4;
  box-shadow: inset 0 0 0 1px #0078d4;
}

.field::placeholder,
.date-field::placeholder {
  color: #8a8f97;
}

#step-2 #customer[readonly],
#step-2 #dealer[readonly] {
  background: #eceff3;
  color: #5f6873;
  border-color: #b8c0ca;
  cursor: not-allowed;
}

.radio-question {
  align-items: start;
  margin-top: 20px;
}

.radio-label::after {
  margin-bottom: 15px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 2px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #3a3f45;
}

.radio-item input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #82878f;
  border-radius: 50%;
  background: #fff;
  position: relative;
  margin: 0;
}

.radio-item input[type="radio"]:checked {
  border-color: var(--accent);
}

.radio-item input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.spacer {
  flex: 1;
}

.dialog-footer {
  border-top: 1px solid #cbced3;
  margin-top: 24px;
  padding-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.btn {
  min-width: 92px;
  height: 38px;
  border: 1px solid var(--button-border);
  background: #ffffff;
  color: #14213d;
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
  font-family: "Segoe UI", SegoeUI, Tahoma, Arial, sans-serif;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: #f5f7fa;
}

.btn-primary {
  background: #0f6cbd;
  border-color: #0f6cbd;
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #115ea3;
  border-color: #115ea3;
}

.is-hidden {
  display: none !important;
}

.footer-links {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  border-top: 1px solid #d7dbe1;
  padding-top: 12px;
  width: 100%;
}

.footer-links a {
  color: #0f6cbd;
  font-size: 12px;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.submit-message {
  margin: 12px 0 0;
  color: #107c10;
  font-size: 13px;
  font-weight: 600;
}

.bc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
}

.bc-modal {
  width: min(100%, 460px);
  background: #f7f7f8;
  border: 1px solid #d4d7dc;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.25);
  padding: 18px 20px 16px;
}

.bc-modal-success {
  border-left: 4px solid #107c10;
}

.bc-modal-error {
  border-left: 4px solid #d13438;
}

.bc-modal-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  color: #25282d;
}

.bc-modal-text {
  margin: 0;
  font-size: 14px;
  color: #2f3338;
  line-height: 1.45;
}

.bc-modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 992px) {
  .wrap {
    padding: 24px 16px;
  }

  .form-card {
    width: 100%;
    min-height: auto;
    padding: 20px;
  }

  .ubl-logo {
    width: 120px;
  }

  h1 {
    font-size: 20px;
  }

  .question {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .captcha-question {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .wrap {
    padding: 14px 10px;
  }

  .form-card {
    padding: 14px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16);
  }

  .header {
    margin-bottom: 14px;
  }

  .header-copy {
    gap: 8px;
    align-items: flex-start;
  }

  .ubl-logo {
    width: 96px;
  }

  h1 {
    font-size: 18px;
  }

  .intro,
  .helper-link {
    font-size: 14px;
  }

  .form-grid {
    margin-top: 6px;
  }

  .question {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 12px 0;
  }

  .captcha-controls {
    flex-direction: column;
  }

  .captcha-refresh {
    width: 100%;
  }

  .label {
    font-size: 14px;
    white-space: normal;
  }

  .label::after {
    display: none;
  }

  .question > .asterisk {
    display: none;
  }

  .field,
  .date-field {
    height: 40px;
    font-size: 14px;
  }

  .radio-item {
    font-size: 14px;
  }

  .btn {
    font-size: 14px;
  }

  .dialog-footer {
    justify-content: stretch;
  }

  .dialog-footer .btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .ubl-logo {
    width: 82px;
  }

  h1 {
    font-size: 16px;
  }

  .step-chip {
    font-size: 11px;
    padding: 2px 8px;
  }

  .intro {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .helper-link {
    font-size: 13px;
    margin-bottom: 14px;
  }

  .radio-group {
    gap: 10px;
  }

  .dialog-footer {
    flex-direction: column-reverse;
  }

  .dialog-footer .btn {
    width: 100%;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 360px) {
  .wrap {
    padding: 8px;
  }

  .form-card {
    padding: 12px;
    border-radius: 0;
  }

  .header-copy {
    gap: 6px;
  }

  .ubl-logo {
    width: 72px;
  }

  h1 {
    font-size: 15px;
    line-height: 1.2;
  }

  .step-chip {
    font-size: 10px;
    padding: 1px 7px;
  }

  .intro,
  .helper-link,
  .label,
  .radio-item {
    font-size: 12px;
  }

  .form-grid {
    margin-top: 2px;
  }

  .question {
    gap: 6px;
    margin: 10px 0;
  }

  .field,
  .date-field {
    height: 38px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .radio-item input[type="radio"] {
    width: 15px;
    height: 15px;
  }

  .dialog-footer {
    margin-top: 16px;
    padding-top: 14px;
    gap: 8px;
  }

  .dialog-footer .btn {
    height: 36px;
    font-size: 13px;
  }
}
