* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: #4a372d;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 15%, rgba(255, 213, 168, 0.7), transparent 36%),
    radial-gradient(circle at 88% 18%, rgba(255, 189, 145, 0.55), transparent 40%),
    radial-gradient(circle at 74% 85%, rgba(255, 229, 197, 0.7), transparent 35%),
    linear-gradient(135deg, #f4e3d2 0%, #efd4b8 45%, #e6c5a7 100%);
}

.page-shell {
  width: 100%;
  max-width: 980px;
  margin: 28px auto;
  padding: 24px;
  padding-bottom: 24px;
  border-radius: 22px;
  background: rgba(255, 248, 239, 0.78);
  border: 1px solid rgba(160, 106, 73, 0.18);
  backdrop-filter: blur(8px);
  box-shadow:
    0 26px 60px rgba(127, 83, 53, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.45) inset;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

h1 {
  margin-top: 0;
  margin-bottom: 6px;
  color: #5b3f31;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.hero p {
  margin-top: 0;
  color: rgba(97, 67, 53, 0.92);
}

.hero-icon {
  font-size: 52px !important;
  color: #d37f45;
  filter: drop-shadow(0 6px 14px rgba(211, 127, 69, 0.28));
}

.survey-form {
  display: grid;
  gap: 20px;
}

.section {
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(
    140deg,
    rgba(255, 255, 255, 0.72),
    rgba(255, 244, 231, 0.74)
  );
  border: 1px solid rgba(175, 121, 88, 0.2);
}

.section h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.32rem;
  color: #6b4b3a;
}

.field {
  margin-bottom: 12px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-weight: 600 !important;
  margin-bottom: 6px;
  color: #6d4f3f !important;
  font-size: 0.96rem;
}

.field textarea,
.field input {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(182, 136, 105, 0.36);
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  outline: none;
  background: rgba(255, 251, 245, 0.95);
  color: #4d392f;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field textarea:focus,
.field input:focus {
  border-color: #c17749;
  box-shadow: 0 0 0 2px rgba(193, 119, 73, 0.2);
}

.field--clickable .option-hints {
  margin: 0 0 8px;
  line-height: 1.6;
  font-size: 0.95rem;
  color: #6d4f3f;
}

.option-chip {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  color: #8b5a3c;
  cursor: pointer;
  border-bottom: 1px dashed #c17749;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.option-chip:hover,
.option-chip:focus {
  color: #c17749;
  border-bottom-color: #a85f2f;
  outline: none;
}

.option-chip:active {
  color: #7a4a2c;
}

.option-sep,
.option-paren {
  color: rgba(109, 79, 63, 0.65);
  margin: 0 2px;
  user-select: none;
}

/* Нижняя панель сохранения — закреплена на всех устройствах */
.save-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  padding: 12px 24px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  background: rgba(255, 247, 236, 0.97);
  border-top: 1px solid rgba(175, 121, 88, 0.28);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 -4px 24px rgba(127, 83, 53, 0.12);
}

.save-bar-inner {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.save-bar-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

#submitBtn,
#loadBtn {
  flex: 1;
  margin: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.load-btn {
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.95);
  color: #6b4b3a;
  border: 1px solid rgba(175, 121, 88, 0.45);
  box-shadow: none;
}

.save-bar .status {
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: center;
}

.save-bar .status:empty {
  display: none;
}

.gradient-btn {
  border-radius: 999px;
  background: linear-gradient(110deg, #c87545, #d9925e, #eab48a);
  background-size: 180% 180%;
  animation: pulseGradient 6s ease infinite;
  box-shadow: 0 14px 28px rgba(152, 94, 57, 0.3);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  margin: 0;
  color: #5a4134;
  font-weight: 500;
}

@keyframes pulseGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Мобильные */
@media (max-width: 700px) {
  .page-shell {
    margin: 0;
    max-width: none;
    width: 100%;
    border-radius: 0;
    min-height: auto;
    padding: 16px;
    padding-bottom: 16px;
    border-left: none;
    border-right: none;
  }

  .hero {
    align-items: flex-start;
  }

  h1 {
    font-size: 1.7rem;
  }

  .survey-form {
    gap: 14px;
  }

  .section {
    padding: 14px;
  }

  .field textarea {
    min-height: 80px;
  }

  .save-bar {
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
}
