:root {
  --bg: #eef4fb;
  --bg-2: #dce7f5;
  --panel: rgba(255, 255, 255, 0.92);
  --primary: #3497d0;
  --primary-dark: #233f78;
  --accent: #54b7ea;
  --text: #1f3558;
  --muted: #5b6f8f;
  --danger: #ff6f6f;
  --radius: 16px;
  --shadow: 0 16px 35px rgba(26, 51, 89, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(84, 183, 234, 0.26), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(35, 63, 120, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

.bg-glow {
  position: fixed;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0%" stop-color="%2354b7ea" stop-opacity="0.18" /><stop offset="100%" stop-color="%23000000" stop-opacity="0" /></linearGradient></defs><rect width="120" height="120" fill="none" stroke="url(%23g)" stroke-width="0.8" /></svg>');
  opacity: 0.25;
  pointer-events: none;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 18px 60px;
  position: relative;
  z-index: 1;
}

.hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero__badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid rgba(35, 63, 120, 0.28);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.hero__logo {
  display: block;
  width: min(220px, 60vw);
  height: auto;
  margin: 4px auto 12px;
  filter: drop-shadow(0 8px 18px rgba(35, 63, 120, 0.18));
}

.hero__title {
  font-family: 'Cinzel', serif;
  font-size: 30px;
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--primary-dark);
  letter-spacing: 0.08em;
  text-wrap: balance;
}

.hero__subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  text-wrap: pretty;
}

body[data-single-form="true"] .form-switch {
  display: none;
}

.form-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(35, 63, 120, 0.18);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.switch-btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(84, 183, 234, 0.32);
}

.switch-btn:active {
  transform: scale(0.98);
}

.card {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(35, 63, 120, 0.14);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.progress {
  margin-bottom: 20px;
}

.progress__label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress__bar {
  height: 8px;
  background: rgba(35, 63, 120, 0.14);
  border-radius: 999px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 33%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transition: width 0.3s ease;
}

.step {
  display: none;
}

.step.is-active {
  display: block;
  animation: fadeUp 0.4s ease;
}

.step__title {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.4;
  color: var(--primary-dark);
  word-break: keep-all;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

label {
  font-size: 14px;
  color: var(--muted);
}

input,
select {
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(35, 63, 120, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 16px;
}

textarea {
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(35, 63, 120, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 16px;
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(84, 183, 234, 0.35);
  border-color: rgba(52, 151, 208, 0.46);
}

.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(35, 63, 120, 0.16);
  background: rgba(255, 255, 255, 0.78);
}

.hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.photo-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(35, 63, 120, 0.2);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-card button {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.summary {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(35, 63, 120, 0.12);
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
}

.status {
  margin: 16px 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(35, 63, 120, 0.2);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  display: none;
}

.status.is-visible {
  display: block;
}

.calendar-embed {
  margin-top: 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(35, 63, 120, 0.18);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}

.slot-btn {
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid rgba(35, 63, 120, 0.2);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.slot-btn.is-selected {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #ffffff;
  border-color: transparent;
}

.slot-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(84, 183, 234, 0.28);
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(35, 63, 120, 0.24);
  color: var(--text);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--primary));
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.done {
  background: var(--panel);
  border: 1px solid rgba(35, 63, 120, 0.2);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.done__action {
  margin: 4px 0 0;
}

.done h2,
.done p {
  margin: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.done h2 {
  line-height: 1.35;
  text-wrap: balance;
}

.done p {
  line-height: 1.7;
  text-wrap: pretty;
}

.hidden {
  display: none !important;
}

.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 42, 74, 0.35);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.loading__box {
  background: var(--panel);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(35, 63, 120, 0.18);
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(52, 151, 208, 0.22);
  border-top-color: var(--primary);
  margin: 0 auto 12px;
  animation: spin 1s linear infinite;
}

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

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .app {
    padding: 22px 14px 40px;
  }

  .card,
  .done {
    padding: 18px 16px;
  }

  .hero {
    margin-bottom: 18px;
  }

  .hero__logo {
    width: min(190px, 58vw);
    margin-bottom: 10px;
  }

  .hero__title {
    font-size: 25px;
    letter-spacing: 0.03em;
  }

  .hero__subtitle {
    font-size: 13px;
  }

  .step__title {
    font-size: 17px;
    margin-bottom: 14px;
  }

  .progress__label {
    gap: 10px;
    align-items: center;
  }

  .btn {
    min-height: 50px;
    font-size: 15px;
  }

  .actions {
    flex-direction: column;
  }

  .form-switch {
    grid-template-columns: 1fr;
  }
}
