:root {
  --bg: #e4e3da;
  --white: #ffffff;
  --text: #000000;
  --muted: #666660;
  --border: #000000;
  --border-light: #c8c7be;
  --accent: #d9ff81;
  --accent-alt: #ff8585;
  --success: #81ffad;
  --success-text: #0a4020;
  --error: #cc0000;
  --radius: 2em;
  --radius-sm: 1em;
  --font: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-accent: 'Castoro', Georgia, serif;
  --inline-pad: clamp(1.5rem, 5.3dvw, 4rem);
}

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

html { font-size: 62.5%; }

body {
  font-family: var(--font);
  font-size: 1.6rem;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.header {
  background: var(--bg);
  padding: 2em var(--inline-pad) 1.5em;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1em;
  flex-shrink: 0;
}

.header-logo {
  color: var(--text);
  text-decoration: none;
  display: block;
}

.header-logo svg {
  width: 90px;
  height: auto;
}

.header-page-label {
  font-size: 6rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1;
}

.label-sora {
  font-family: var(--font);
  font-style: normal;
  font-size: 1em;
}

.label-castoro {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1em;
}

.header-page-label em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
}


.header-version {
  font-size: 1rem;
  color: var(--muted);
  font-family: monospace;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ── Rubber Band ── */
.rubber-band {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.rubber-band-path {
  stroke: #ff8585;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-band 2.8s cubic-bezier(0.25, 0, 0.1, 1) forwards;
}

@keyframes draw-band {
  to { stroke-dashoffset: 0; }
}

/* ── Progress ── */
.progress-wrap {
  background: transparent;
  padding: 1.2rem var(--inline-pad);
  position: relative;
  z-index: 1;
}
.progress-inner { max-width: 680px; margin: 0 auto; }

.progress-title {
  text-align: right;
  margin-bottom: 80px;
}
.progress-track {
  height: 6px;
  background: #000;
  border-radius: 99px;
}
.progress-fill {
  height: 100%;
  background: #d9ff81;
  border-radius: 99px;
  transition: width 0.45s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
}
.progress-label {
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: 0.6rem;
  display: flex;
  justify-content: space-between;
}

/* ── Main ── */
.main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 4rem var(--inline-pad) 6rem;
}
.container { width: 100%; max-width: 660px; }

/* ── Step ── */
.step { display: none; animation: fadeIn 0.3s ease; }
.step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Card ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 3.5rem;
  margin-bottom: 1.5rem;
}

.step-badge {
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  background: var(--accent);
  padding: 0.3em 1em;
  border-radius: 2em;
  margin-bottom: 1.5rem;
}

.card h1 {
  font-size: clamp(2rem, 2.8dvw, 3.2rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

/* Akzentwort innerhalb von Headlines: <em> in Castoro italic */
.card h1 em, .summary-header h1 em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
}

.card p.intro {
  color: var(--muted);
  line-height: 1.65;
  font-size: 1.5rem;
}

/* ── Question ── */
.question { margin-top: 2.5rem; }
.question + .question { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border-light); }

.q-label {
  display: block;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ── Text inputs ── */
.text-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
  appearance: none;
}
.text-input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}
textarea.text-input {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.has-error .text-input { border-color: var(--error); }

/* ── Rating ── */
.rating-scale {
  display: flex;
  gap: 6px;
}
.rating-btn {
  flex: 1;
  height: 48px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--muted);
  font-family: var(--font);
}
.rating-btn:hover {
  border-color: var(--text);
  color: var(--text);
  background: var(--bg);
}
.rating-btn.selected {
  border-color: var(--text);
  background: var(--accent);
  color: var(--text);
  transform: scale(1.05);
}
.rating-labels {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: 0.6rem;
  padding: 0 2px;
}
.has-error .rating-scale .rating-btn { border-color: #fca5a5; }

/* ── Clarification ── */
.clarification { margin-top: 1rem; }
.clarification-toggle {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.clarification-toggle:hover { opacity: 0.6; }
.clarification-field {
  display: none;
  margin-top: 0.8rem;
}
.clarification-field.open { display: block; }
.clarification-field textarea {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  font-family: var(--font);
  resize: vertical;
  min-height: 90px;
  outline: none;
  line-height: 1.5;
}
.clarification-field textarea:focus { border-color: var(--text); }

/* ── Error ── */
.error-msg {
  display: none;
  color: var(--error);
  font-size: 1.2rem;
  margin-top: 0.5rem;
}
.has-error .error-msg { display: block; }

/* ── Navigation ── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn {
  padding: 0.7em 1.6em;
  border-radius: 2em;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid var(--text);
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-primary { background: var(--text); color: var(--white); }
.btn-primary:hover { background: #222; }
.btn-primary:hover svg, .btn-secondary:hover svg { translate: 3px 0; }
.btn svg { transition: translate 0.2s cubic-bezier(.34,1.12,.83,1.44); }

.lottie-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}
.btn-primary .lottie-icon { filter: invert(1); }
.btn-secondary { background: transparent; color: var(--text); }
.btn-secondary:hover { background: var(--border-light); }
.btn-success { background: #86c6ff; color: var(--text); border-color: #86c6ff; }
.btn-success:hover { opacity: 0.85; }

/* ── Summary ── */
.summary-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.summary-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  margin-bottom: 1.5rem;
  border: 1.5px solid var(--text);
}
.summary-header h1 {
  font-size: 2.6rem;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  margin-bottom: 0.75rem;
}
.summary-header p {
  color: var(--muted);
  font-size: 1.4rem;
}

.link-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.link-box .link-url {
  flex: 1;
  font-size: 1.2rem;
  color: var(--text);
  word-break: break-all;
  font-family: monospace;
  opacity: 0.7;
}
.btn-copy {
  padding: 0.5em 1.2em;
  background: var(--text);
  color: var(--white);
  border: none;
  border-radius: 2em;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
  flex-shrink: 0;
}
.btn-copy:hover { opacity: 0.8; }
.btn-copy.copied { background: var(--success); color: var(--success-text); }

.action-bar {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.action-bar .btn { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 600px) {
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-bar .btn { text-align: center; justify-content: center; }
}

.summary-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 3rem;
  margin-bottom: 1.25rem;
}
.summary-section h2 {
  font-size: 2rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.summary-item { margin-bottom: 1.5rem; }
.summary-item:last-child { margin-bottom: 0; }
.summary-q {
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.summary-a {
  font-size: 1.4rem;
  line-height: 1.65;
  color: var(--muted);
}
.summary-a.empty { color: var(--muted); }
.summary-a.empty em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
}

.rating-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.rating-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--text);
  color: var(--text);
  font-weight: 500;
  font-size: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rating-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: 99px;
}
.rating-bar-fill {
  height: 100%;
  background: var(--text);
  border-radius: 99px;
}

/* ── Mail modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 3rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}
.modal-title {
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}
.modal-steps { display: flex; flex-direction: column; gap: 0; }

.modal-step {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: opacity 0.2s;
}
.modal-step:last-child { border-bottom: none; }
.modal-step.locked { opacity: 0.35; pointer-events: none; }
.modal-step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: var(--success-text);
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--text);
  color: var(--text);
  font-weight: 500;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s;
}
.step-body { flex: 1; }
.step-label {
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}
.step-desc {
  font-size: 1.3rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.step-desc strong { color: var(--text); }

.btn.disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
  text-decoration: none;
}
a.btn { text-decoration: none; }

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

/* ── Draft restore banner ── */
.draft-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 2rem;
}
.draft-discard {
  background: #d9ff81;
  border: none;
  color: #000;
  border-radius: 2em;
  padding: 0.3em 1em;
  font-size: 1.3rem;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  flex-shrink: 0;
}
.draft-discard:hover { opacity: 0.85; }

/* ── Notice box ── */
.notice-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #fff5f0;
  border: 2px solid var(--accent-alt);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  gap: 1.5rem;
}
.notice-icon {
  flex-shrink: 0;
  line-height: 1;
}
.notice-icon .lottie-icon {
  width: 96px;
  height: 96px;
}
.notice-text {
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--text);
  width: 80%;
}
.notice-text strong {
  display: block;
  font-size: 2rem;
  font-weight: 500;
  max-width: 80%;
  margin: 0 auto 1rem;
  line-height: 1.4;
}
.notice-text strong em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  font-size: 2.2rem;
}
.notice-text span {
  display: block;
}

/* ── Upload zone ── */
.upload-zone {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
}
.upload-label {
  font-size: 1.3rem;
  color: var(--muted);
  flex: 1;
}
.upload-btn {
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Print ── */
@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .main { padding: 0; }
  .header { border: none; }
  .progress-wrap { display: none; }
  .summary-section { border: 1px solid #ddd; break-inside: avoid; }
}

@media (max-width: 600px) {
  .card { padding: 2rem 1.75rem; }
  .card h1 { font-size: 2rem; }
  .summary-section { padding: 1.75rem; }
  .header { padding: 1.5em var(--inline-pad) 1em; }
  .header-logo svg { width: 70px; }
}
