* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    Roboto,
    Arial,
    sans-serif;
  background: #f3f2f1;
  color: #201f1e;
  line-height: 1.5;
}

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

.form-header {
  background: #ffffff;
  border-top: 8px solid #7a1f1f;
  border-radius: 6px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}
.form-header h1 {
  margin: 0 0 4px;
  font-size: 24px;
  color: #7a1f1f;
  letter-spacing: 0.3px;
}
.subtitle {
  margin: 0 0 12px;
  font-weight: 600;
  color: #444;
}
.note,
.required-note {
  font-size: 13px;
  color: #605e5c;
  margin: 6px 0 0;
}
.required-note .req,
.q .req {
  color: #a4262c;
}

.intro {
  background: #ffffff;
  border-radius: 6px;
  padding: 20px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}
.intro h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #7a1f1f;
}
.intro p {
  margin: 0;
  font-size: 15px;
}

form {
  background: #ffffff;
  border-radius: 6px;
  padding: 8px 28px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.q {
  padding: 20px 0;
  border-bottom: 1px solid #edebe9;
}
.q:last-of-type {
  border-bottom: none;
}
.q label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 8px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid #c8c6c4;
  border-radius: 4px;
  background: #fff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #7a1f1f;
  box-shadow: 0 0 0 2px rgba(122, 31, 31, 0.15);
}
textarea {
  resize: vertical;
  min-height: 90px;
}
.hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #605e5c;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}
.radio input {
  width: auto;
}

.scale {
  display: flex;
  align-items: center;
  gap: 12px;
}
.scale input[type="range"] {
  flex: 1;
}
.scale output {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  color: #7a1f1f;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.actions {
  padding-top: 24px;
  text-align: right;
}

button[type="submit"] {
  background: #7a1f1f;
  color: #fff;
  border: none;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
button[type="submit"]:hover {
  background: #5c1717;
}
button[type="submit"]:disabled {
  background: #b9a6a6;
  cursor: not-allowed;
}

.form-error {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fde7e9;
  color: #a4262c;
  border-left: 4px solid #a4262c;
  border-radius: 4px;
  font-size: 14px;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 31, 30, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}
.overlay-card {
  background: #fff;
  padding: 40px 48px;
  border-radius: 8px;
  text-align: center;
  max-width: 440px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.overlay-card h3 {
  margin: 18px 0 8px;
  color: #7a1f1f;
}
.overlay-card p {
  margin: 6px 0;
  font-size: 14px;
  color: #444;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 5px solid #edebe9;
  border-top-color: #7a1f1f;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.overlay-card .check {
  width: 56px;
  height: 56px;
  line-height: 56px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 32px;
  font-weight: 700;
}
.overlay-btn {
  display: inline-block;
  margin-top: 14px;
  background: #7a1f1f;
  color: #fff;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 4px;
  font-weight: 600;
  transition: background 0.15s;
}
.overlay-btn:hover {
  background: #5c1717;
}
.overlay-card .small {
  font-size: 12px;
  color: #888;
  margin-top: 12px;
}

@media (max-width: 560px) {
  .form-header,
  .intro,
  form {
    padding-left: 18px;
    padding-right: 18px;
  }
  .overlay-card {
    padding: 28px 22px;
    margin: 0 12px;
  }
}

[hidden] {
  display: none !important;
}
