* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Hiragino Kaku Gothic ProN",
    "Hiragino Sans",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
  color: #2f2f2f;
  background:
    linear-gradient(
      180deg,
      #fffaf4 0%,
      #fffdf9 45%,
      #f8f5f0 100%
    );
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

img,
video {
  display: block;
  max-width: 100%;
}


/* ========================================
   PAGE
======================================== */

.page {
  width: 100%;
  min-height: 100vh;
  padding: 32px 16px 64px;
}

.survey-view {
  width: 100%;
}

.card {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 24px 44px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.06);
}


/* ========================================
   HEADER
======================================== */

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  color: #9b7c61;
}

h1 {
  margin: 0;
  font-size: clamp(27px, 7vw, 40px);
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-align: center;
  color: #2f2f2f;
}

.intro-message {
  margin: 26px auto 0;
  padding: 20px;
  font-size: 14px;
  line-height: 1.9;
  color: #625d57;
  background: #faf7f2;
  border-radius: 16px;
}

.intro-message p {
  margin: 0;
}

.intro-message p + p {
  margin-top: 12px;
}


/* ========================================
   FORM SECTION
======================================== */

.form-section {
  margin-top: 52px;
}

.section-heading {
  position: relative;
  margin-bottom: 30px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e9e1d9;
}

.step {
  display: inline-block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #a08064;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.5;
  color: #342f2b;
}


/* ========================================
   QUESTION
======================================== */

.question {
  padding: 0;
  margin: 0 0 40px;
  border: 0;
}

.question:last-child {
  margin-bottom: 0;
}

.question legend,
.question-label {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.75;
  color: #35312e;
}

.question-number {
  margin-right: 3px;
  color: #806550;
}

.required-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 7px;
  vertical-align: 2px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  color: #ffffff;
  background: #a66e5c;
  border-radius: 5px;
}

.question-help {
  margin: -7px 0 15px;
  font-size: 13px;
  line-height: 1.75;
  color: #77716a;
}


/* ========================================
   CHOICE
======================================== */

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  margin-bottom: 9px;
  padding: 14px 16px;
  cursor: pointer;
  background: #faf9f7;
  border: 1px solid #e9e4df;
  border-radius: 12px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.choice:hover {
  background: #f7f3ee;
  border-color: #d7c8ba;
}

.choice:active {
  transform: scale(0.997);
}

.choice:has(input:checked) {
  background: #f6efe8;
  border-color: #bda58f;
}

.choice input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #8f725b;
}

.choice span {
  font-size: 14px;
  line-height: 1.55;
}


/* ========================================
   TEXTAREA
======================================== */

textarea {
  display: block;
  width: 100%;
  min-height: 140px;
  padding: 15px 16px;
  resize: vertical;
  color: #333333;
  line-height: 1.7;
  background: #faf9f7;
  border: 1px solid #ded8d2;
  border-radius: 12px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

textarea::placeholder {
  color: #aaa39d;
}

textarea:focus {
  background: #ffffff;
  border-color: #aa9078;
  box-shadow:
    0 0 0 3px rgba(170, 144, 120, 0.12);
}


/* ========================================
   CONDITIONAL QUESTION
======================================== */

.conditional-question {
  margin-top: -12px;
  padding: 22px 20px;
  background: #fcfaf7;
  border: 1px solid #ebe2da;
  border-radius: 16px;
}


/* ========================================
   FIELD ERROR
======================================== */

.field-error {
  min-height: 1.5em;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #a14e43;
}


/* ========================================
   UPLOAD
======================================== */

.upload-area {
  position: relative;
  display: block;
  width: 100%;
  height: 260px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #faf7f2;
  border: 2px dashed #d9cec3;
  border-radius: 20px;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.upload-area:hover {
  background: #f8f2eb;
  border-color: #bfa993;
}

.upload-area:active {
  transform: scale(0.995);
}

.upload-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(100% - 32px);
  margin: 0;
  padding: 0;
  text-align: center;
  transform: translate(-50%, -50%);
}

.upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 0 14px;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: #8d725c;
  background: #ffffff;
  border-radius: 50%;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.07);
}

.upload-main {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.image-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: #f4f1ed;
}


/* ========================================
   UPLOAD STATUS
======================================== */

.status-message {
  min-height: 1.5em;
  margin: 11px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: #716b65;
}


/* ========================================
   NOTICE
======================================== */

.notice-box {
  margin-top: 4px;
  padding: 16px 17px;
  font-size: 13px;
  line-height: 1.8;
  color: #69635d;
  background: #f7f4f0;
  border-left: 3px solid #bca58f;
  border-radius: 0 10px 10px 0;
}

.notice-box p {
  margin: 0;
}

.notice-box p + p {
  margin-top: 8px;
}


/* ========================================
   SUBMIT
======================================== */

.submit-section {
  margin-top: 58px;
  padding-top: 30px;
  border-top: 1px solid #e8e1da;
}

.submit-note {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
  color: #716b65;
}

.submit-button {
  width: 100%;
  padding: 18px 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff;
  background: #7e6652;
  border-radius: 14px;
  box-shadow:
    0 5px 16px rgba(126, 102, 82, 0.16);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.submit-button:not(:disabled):hover {
  opacity: 0.92;
  box-shadow:
    0 7px 20px rgba(126, 102, 82, 0.2);
}

.submit-button:not(:disabled):active {
  transform: translateY(1px);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}


/* ========================================
   THANK YOU
======================================== */

.thanks-view {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 0 48px;
}

.thanks-title {
  margin: 0;
  font-size: clamp(28px, 7vw, 42px);
  line-height: 1.4;
  text-align: center;
}

.thanks-message {
  margin: 18px 0 0;
  font-size: 16px;
  line-height: 1.9;
  text-align: center;
  color: #6e6861;
}

.thanks-gift-message {
  margin: 14px 0 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.9;
  text-align: center;
  color: #806550;
}


/* ========================================
   GENERATING
======================================== */

.generating-message {
  margin: 42px auto 0;
  padding: 34px 20px;
  text-align: center;
}

.generating-message p {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: #746e67;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 3px solid #e6ded6;
  border-top-color: #8f725b;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* ========================================
   GIFT AREA
======================================== */

.gift-area {
  margin-top: 42px;
}

.gift-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.gift-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px 20px 20px;
  background: #ffffff;
  border: 1px solid #eee8e2;
  border-radius: 22px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.055);
}

.gift-number {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #b19a85;
}

.gift-type {
  margin: 5px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #8f725b;
}

.gift-card h3 {
  margin: 10px 0 18px;
  font-size: 19px;
  line-height: 1.55;
}

.gift-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f4f1ed;
  border-radius: 15px;
}


/* ========================================
   VIDEO
======================================== */

.video-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f4f1ed;
  border-radius: 15px;
}

.gift-video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f4f1ed;
}


/* ========================================
   SAVE BUTTON
======================================== */

.save-button {
  width: 100%;
  margin-top: 16px;
  padding: 13px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: #7e6652;
  background: #faf7f2;
  border: 1px solid #d9cec3;
  border-radius: 12px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.save-button:hover {
  background: #f3ece5;
  border-color: #bfa993;
}

.save-button:active {
  transform: translateY(1px);
}

.save-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.save-status {
  min-height: 1.5em;
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  color: #a14e43;
}


/* ========================================
   GIFT NOTE
======================================== */

.gift-note {
  margin: 24px 0 0;
  font-size: 15px;
  line-height: 1.9;
  text-align: center;
  color: #746e67;
}


/* ========================================
   DESKTOP
======================================== */

@media (min-width: 900px) {

  .page {
    padding-top: 56px;
  }

  .card {
    padding: 48px 56px 56px;
  }

  .intro-message {
    padding: 22px 24px;
  }

  .form-section {
    margin-top: 58px;
  }

  .upload-area {
    height: 300px;
  }

  .gift-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  .gift-card {
    padding: 22px 18px 18px;
  }

  .gift-card h3 {
    min-height: 59px;
  }
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 480px) {

  .page {
    padding:
      20px
      12px
      48px;
  }

  .card {
    padding:
      30px
      18px
      38px;
    border-radius: 20px;
  }

  h1 {
    font-size: 27px;
  }

  .intro-message {
    margin-top: 22px;
    padding: 17px 16px;
    font-size: 13px;
  }

  .form-section {
    margin-top: 46px;
  }

  .section-heading {
    margin-bottom: 25px;
  }

  .section-heading h2 {
    font-size: 19px;
  }

  .question {
    margin-bottom: 35px;
  }

  .question legend,
  .question-label {
    font-size: 15px;
    line-height: 1.75;
  }

  .required-badge {
    margin-left: 5px;
  }

  .choice {
    min-height: 50px;
    padding: 13px 14px;
  }

  .choice span {
    font-size: 14px;
  }

  .conditional-question {
    padding: 19px 15px;
  }

  .upload-area {
    height: 230px;
  }

  .upload-icon {
    width: 52px;
    height: 52px;
    font-size: 26px;
  }

  .upload-main {
    font-size: 15px;
  }

  .notice-box {
    padding: 14px 15px;
  }

  .submit-section {
    margin-top: 50px;
  }

  .submit-button {
    padding: 17px 16px;
  }

  .gift-card {
    padding:
      22px
      18px
      18px;
  }

  .save-button {
    padding: 14px;
    font-size: 15px;
  }
}


/* ========================================
   SMALL MOBILE
======================================== */

@media (max-width: 360px) {

  .page {
    padding-left: 8px;
    padding-right: 8px;
  }

  .card {
    padding-left: 14px;
    padding-right: 14px;
  }

  h1 {
    font-size: 24px;
  }

  .choice {
    padding-left: 12px;
    padding-right: 12px;
  }
}


/* ========================================
   ACCESSIBILITY
======================================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   AFTER MULTIPLE IMAGE PREVIEW
======================================== */

.after-upload-area {
  height: auto;
  min-height: 260px;
}

.after-preview-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-height: 260px;
  padding: 12px;
  background: #f4f1ed;
}

.after-preview-item {
  position: relative;
  min-width: 0;
  height: 236px;
  overflow: hidden;
  background: #ebe7e2;
  border-radius: 14px;
}

.after-image-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f4f1ed;
}

.after-preview-label {
  position: absolute;
  top: 9px;
  left: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  background: rgba(71, 61, 53, 0.78);
  border-radius: 50%;
  pointer-events: none;
}


/* ========================================
   AFTER MULTIPLE IMAGE PREVIEW - DESKTOP
======================================== */

@media (min-width: 900px) {

  .after-upload-area {
    min-height: 300px;
  }

  .after-preview-grid {
    min-height: 300px;
  }

  .after-preview-item {
    height: 276px;
  }

}


/* ========================================
   AFTER MULTIPLE IMAGE PREVIEW - MOBILE
======================================== */

@media (max-width: 480px) {

  .after-upload-area {
    min-height: 230px;
  }

  .after-preview-grid {
    grid-template-columns: 1fr;
    min-height: 230px;
    padding: 10px;
  }

  .after-preview-item {
    height: 210px;
  }

}