:root {
  --primary: #163d8f;
  --text: #1f2a3d;
  --muted: #5b6474;
  --line: #d9e1ec;
  --surface: #ffffff;
  --danger: #c62828;
  --success: #1f7a1f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: #f6f7f9;
  padding: 16px;
}

.survey-page {
  width: min(1120px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.survey-header {
  display: flex;
  gap: 24px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  flex: 0 0 auto;
}

.company {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  color: #10233f;
}

.survey-header p:last-child {
  margin: 0;
  line-height: 1.75;
  color: var(--muted);
}

.survey-form {
  padding-top: 24px;
}

.form-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.form-section:last-of-type {
  border-bottom: 0;
}

.form-section h2 {
  margin: 0 0 20px;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.field-grid label span,
fieldset legend,
.question-block p,
.textarea-field span {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  line-height: 1.45;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  outline: 2px solid rgba(22, 61, 143, 0.15);
  border-color: var(--primary);
}

textarea {
  resize: vertical;
  min-height: 108px;
}

.checkbox-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  line-height: 1.5;
}

fieldset label:last-child {
  margin-bottom: 0;
}

.other-option {
  flex-wrap: wrap;
}

.other-option span {
  margin: 0;
}

.other-option input[type="text"] {
  min-width: 100%;
  margin-left: 0;
  margin-top: 8px;
}

.evaluation-section {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 18px;
  background: #fff;
}

.evaluation-section:last-child {
  margin-bottom: 0;
}

.evaluation-section h3 {
  margin: 0 0 18px;
  font-size: 1.15rem;
}

.question-block {
  padding: 14px 0;
  border-bottom: 1px solid #e7edf5;
}

.question-block:last-of-type {
  padding-bottom: 18px;
}

.question-block p {
  margin: 0 0 10px;
}

.rating-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rating-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-size: 0.95rem;
  cursor: pointer;
}

.rating-option input {
  margin: 0;
}

.textarea-field {
  display: block;
  margin-top: 18px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.submit-btn {
  border: 0;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 12px 20px;
  cursor: pointer;
}

.submit-btn:hover:not(:disabled) {
  background: #102e6f;
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.form-status {
  min-height: 24px;
  margin: 16px 0 0;
  font-weight: 700;
}

.form-status.error {
  color: var(--danger);
}

.form-status.success {
  color: var(--success);
}

.hidden-field {
  position: absolute;
  left: -9999px;
}

.input-error {
  border-color: var(--danger) !important;
}

@media (max-width: 900px) {
  .field-grid,
  .checkbox-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding: 12px;
  }

  .survey-page {
    padding: 18px;
  }

  .survey-header,
  .form-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .rating-row {
    flex-direction: column;
  }

  .rating-option {
    width: 100%;
  }
}
