* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f6f7fb;
  color: #1c1d27;
  line-height: 1.5;
}

.container {
  max-width: 820px;
  margin: 2.5rem auto;
  padding: 0 1.5rem 3rem;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 18px 55px rgba(50, 50, 93, 0.12);
}

.container.consent {
  max-width: 880px;
}

header {
  border-bottom: 1px solid #e7e9f3;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.mq-logo {
  max-width: 220px;
  width: 100%;
  height: auto;
}

.consent-form-heading {
  margin: 0.2rem 0 0;
  color: #202236;
  font-size: 1.6rem;
  font-weight: 600;
}

.consent-form-subheading {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

header .study-subtitle {
  margin-top: 0;
}

.consent-section > h2 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.subtitle {
  font-size: 1.1rem;
  color: #4c4f66;
  margin-bottom: 1rem;
}

.introduction p,
.meta p {
  margin: 0.3rem 0;
}

.consent-section h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.consent-section.consent-confirmation {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.consent-points {
  padding-left: 1.25rem;
  margin: 1rem 0 1.5rem;
  display: grid;
  gap: 0.5rem;
}

.consent-confirmation {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  line-height: 1.4;
  width: 100%;
}

.consent-confirmation input[type="checkbox"] {
  margin-top: 0.25rem;
}


.secondary {
  background-color: #ffffff;
  color: #3730a3;
  border: 1px solid #3730a3;
  box-shadow: none;
}

.secondary:hover {
  background-color: #eef2ff;
}

.secondary:disabled {
  color: #8a8ea8;
  border-color: #8a8ea8;
  background-color: #ffffff;
}

.notice {
  background: #fff7ed;
  border: 1px solid #f3b64a;
  color: #7d4a00;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.notice[hidden] {
  display: none;
}

section.question-section {
  margin-bottom: 2rem;
}

.question-title {
  font-size: 1.35rem;
  color: #202236;
  margin-bottom: 1rem;
}

.question {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px solid #e1e4ef;
  border-radius: 8px;
  background: #fafbff;
}

.question legend {
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.helper-text {
  font-size: 0.9rem;
  color: #53566e;
  margin-bottom: 0.6rem;
}

.options {
  display: grid;
  gap: 0.35rem;
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

.option-label input[type="checkbox"],
.option-label input[type="radio"] {
  margin-top: 0.2rem;
}

.other-input {
  margin-left: 1.95rem;
  margin-top: 0.35rem;
  width: min(380px, 100%);
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd2e5;
  border-radius: 6px;
}

textarea {
  width: 100%;
  min-height: 110px;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd2e5;
  resize: vertical;
  font-family: inherit;
  font-size: 1rem;
}

textarea:focus,
input[type="text"]:focus {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.short-input {
  width: min(380px, 100%);
  padding: 0.65rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #cbd2e5;
  font-size: 1rem;
}

.short-input:focus {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
}

.thank-you-content {
  font-size: 1.05rem;
  color: #35385a;
  display: grid;
  gap: 1rem;
}

button[type="submit"] {
  background-color: #3730a3;
  border: none;
  border-radius: 999px;
  color: white;
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(55, 48, 163, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(55, 48, 163, 0.25);
}

button[type="submit"]:disabled {
  background-color: #a3a4b5;
  cursor: not-allowed;
  box-shadow: none;
}

.actions.consent-actions {
  justify-content: flex-start;
  align-items: stretch;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.actions.consent-actions button {
  width: 100%;
  max-width: 360px;
  min-width: 0;
}

#form-status {
  margin-top: 1.5rem;
  font-weight: 500;
}

#form-status.error {
  color: #b42318;
}

#form-status.success {
  color: #067647;
}

.error {
  color: #b42318;
}

.hidden {
  display: none !important;
}

.disabled {
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 640px) {
  .container {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0 1rem 2rem;
  }

  .actions {
    justify-content: center;
  }
}

@media (min-width: 720px) {
  .actions.consent-actions {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    width: auto;
  }

  .actions.consent-actions button {
    width: auto;
    min-width: 220px;
    max-width: none;
  }
}
