*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pink: #f472b6;
  --pink-dark: #db2777;
  --pink-light: #fdf2f8;
  --pink-border: #fbcfe8;
  --purple: #a855f7;
  --text: #3b1a4a;
  --text-sub: #9d6daa;
  --white: #fff;
  --green: #16a34a;
  --radius: 16px;
}

/* ── Language Switcher ── */
.lang-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 0 0;
}
.lang-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--pink-border);
  background: var(--white);
  color: var(--text-sub);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.lang-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: var(--white);
  border-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  background: linear-gradient(135deg, #fdf2f8 0%, #faf5ff 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
}

.container {
  width: 100%;
  max-width: 480px;
}

/* ── Header ── */
.header {
  text-align: center;
  padding: 28px 0 16px;
}
.logo { font-size: 2.8rem; margin-bottom: 10px; }
h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink-dark), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
h2 {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink-dark), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle {
  margin-top: 8px;
  font-size: 1.1rem;
  color: var(--text-sub);
  line-height: 1.7;
  font-weight: 500;
}

/* ── Form ── */
#survey-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }

fieldset {
  border: 2px solid var(--pink-border);
  border-radius: var(--radius);
  background: var(--white);
  padding: 16px;
  box-shadow: 0 2px 12px rgba(244, 114, 182, 0.08);
}

legend {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  padding: 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: var(--white);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.options { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.option:hover { background: var(--pink-light); }
.option:has(input:checked) {
  background: linear-gradient(135deg, #fdf2f8, #faf5ff);
  border: 1px solid var(--pink-border);
}

.option input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--pink-dark);
  flex-shrink: 0;
  cursor: pointer;
}
.option span { font-size: 0.95rem; line-height: 1.4; color: var(--text); }

/* ── Buttons ── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.35);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--white);
  color: var(--pink-dark);
  border: 2px solid var(--pink-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(244, 114, 182, 0.1);
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover { background: var(--pink-light); }

.btn-copy {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--pink-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  margin-bottom: 10px;
  -webkit-tap-highlight-color: transparent;
}
.btn-copy.copied {
  background: #f0fdf4;
  border-color: var(--green);
  color: var(--green);
}

.btn-stars {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--white);
  color: var(--text-sub);
  border: 2px solid var(--pink-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
  margin-top: 10px;
  -webkit-tap-highlight-color: transparent;
}
.btn-stars:hover { background: var(--pink-light); }

.btn-text {
  display: block;
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--text-sub);
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  margin-top: 8px;
  -webkit-tap-highlight-color: transparent;
}
.btn-text:hover { text-decoration: underline; }

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--text-sub);
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--pink-border);
}

/* ── Loading ── */
#loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.loading-inner { text-align: center; }
.loading-inner p { margin-top: 16px; font-size: 1rem; color: var(--text); }
.loading-sub { color: var(--text-sub) !important; font-size: 0.85rem !important; margin-top: 4px !important; }

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--pink-border);
  border-top-color: var(--pink-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result ── */
#result-screen { padding-bottom: 24px; }
.review-box {
  background: var(--white);
  border: 2px solid var(--pink-border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
  min-height: 100px;
  box-shadow: 0 2px 12px rgba(244, 114, 182, 0.08);
}
#review-text {
  width: 100%;
  min-height: 120px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: inherit;
  overflow-y: auto;
  display: block;
}

.hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-sub);
  margin: 10px 0 4px;
}

/* ── Error ── */
#error-screen { text-align: center; padding: 40px 0; }
.error-detail {
  color: #c5221f;
  font-size: 0.95rem;
  margin: 16px 0 24px;
  line-height: 1.6;
}

/* ── Utilities ── */
.error {
  color: #c5221f;
  font-size: 0.85rem;
  text-align: center;
  padding: 8px;
}
.hidden { display: none !important; }

section { width: 100%; }
