:root {
  --bg: #edf3ef;
  --panel: #ffffff;
  --text: #102542;
  --muted: #5f6f7f;
  --line: #d8e1db;
  --accent: #2d6a4f;
  --accent-soft: #e4f3ea;
  --soft: #f6faf7;
  --warn: #fbf4e6;
  --shadow: 0 20px 50px rgba(16, 37, 66, 0.08);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(45, 106, 79, 0.12), transparent 28%),
    linear-gradient(180deg, #f6faf7 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  min-height: 100dvh;
  padding: 12px;
}

.hero {
  width: min(100%, 760px);
  margin: 0 auto;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(216, 225, 219, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel-home {
  padding: 20px;
}

.panel-language-only {
  min-height: calc(100dvh - 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

.panel-action-only {
  min-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-wizard {
  padding: 16px;
  min-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
}

.headline h1,
.section-title h2,
.summary-block h3 {
  margin: 0;
}

.headline {
  margin-bottom: 20px;
}

.headline h1 {
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 0.98;
  margin-bottom: 10px;
}

.headline.compact h1 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}

.headline p,
.section-title p,
.footer-note,
.progress-text,
.wizard-card p,
.state-card span,
.optional-note,
.summary-item span,
.result-badge {
  color: var(--muted);
}

.toolbar,
.wizard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wizard-top {
  margin-bottom: 12px;
}

.progress-track {
  width: 100%;
  height: 18px;
  margin-bottom: 16px;
  background: #edf2ee;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2d6a4f 0%, #4f9d75 100%);
}

.language-grid,
.action-grid {
  display: grid;
  gap: 14px;
}

.language-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 12px;
}

.language-card,
.action-card,
.choice-card,
.ghost-btn,
.primary-btn {
  border: 0;
  border-radius: 22px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.language-card,
.action-card,
.choice-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(16, 37, 66, 0.05);
}

.language-card,
.action-card {
  cursor: pointer;
}

.language-card:hover,
.action-card:hover,
.choice-card:hover,
.ghost-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
}

.language-card {
  min-height: clamp(100px, 19dvh, 132px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-align: center;
  aspect-ratio: 1 / 1;
}

.language-flag {
  font-size: clamp(2.35rem, 6.2vw, 4rem);
  line-height: 1;
}

.language-label {
  display: block;
  max-width: 100%;
  font-size: clamp(0.88rem, 2.2vw, 1.08rem);
  font-weight: 700;
  line-height: 1.15;
}

.action-grid {
  grid-template-columns: 1fr;
  flex: 1;
}

.action-card {
  min-height: 0;
  padding: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.action-title {
  margin-bottom: 8px;
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
}

.state-card {
  margin-top: 10px;
  padding: 14px;
  border-radius: 20px;
  background: var(--soft);
}

.state-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.08rem;
  line-height: 1.32;
}

.state-card-accent {
  background: var(--accent-soft);
}

.state-card-simple {
  text-align: center;
}

.state-card-simple strong {
  margin-top: 0;
  font-size: clamp(1.2rem, 3.5vw, 1.7rem);
  line-height: 1.2;
}

.visual {
  width: 150px;
  height: 96px;
  margin: 0 auto 8px;
  position: relative;
}

.visual-box {
  position: absolute;
  top: 28px;
  left: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #d4a373;
}

.visual-truck {
  position: absolute;
  top: 18px;
  right: 0;
  width: 76px;
  height: 40px;
  border: 3px solid var(--text);
  border-radius: 12px;
}

.visual-truck span:nth-child(1),
.visual-truck span:nth-child(2) {
  position: absolute;
  bottom: -13px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text);
}

.visual-truck span:nth-child(1) {
  left: 10px;
}

.visual-truck span:nth-child(2) {
  right: 10px;
}

.visual-truck span:nth-child(3) {
  position: absolute;
  right: -18px;
  top: 9px;
  width: 18px;
  height: 22px;
  border: 3px solid var(--text);
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

.visual-arrow {
  position: absolute;
  top: 38px;
  left: 36px;
  width: 62px;
  height: 4px;
  background: var(--accent);
}

.visual-arrow::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid var(--accent);
}

.arrow-left {
  transform: rotate(180deg);
}

.ghost-btn,
.primary-btn {
  min-height: 58px;
  padding: 0 18px;
  font-size: 1.08rem;
  font-weight: 700;
  cursor: pointer;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.primary-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
}

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

.wizard-card {
  min-height: calc(100dvh - 170px);
  padding: 20px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: step-in 0.2s ease;
}

.wizard-card-signature {
  justify-content: flex-start;
}

.question-badge {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.12);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 800;
}

.wizard-card h1 {
  margin: 12px 0 8px;
  font-size: clamp(1.9rem, 5.2vw, 3rem);
  line-height: 1.08;
  text-wrap: balance;
}

.wizard-card p {
  margin: 0 0 12px;
  font-size: 0.98rem;
}

.optional-note {
  margin-bottom: 10px;
  font-weight: 700;
}

.input-zone {
  margin-top: 8px;
  display: flex;
  flex: 1;
  align-items: center;
}

.wizard-card-signature .input-zone {
  display: block;
  width: 100%;
  margin-top: 12px;
}

.big-input,
.value-tile {
  width: 100%;
  min-height: 88px;
  padding: 20px 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: clamp(1.25rem, 4vw, 1.8rem);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.big-textarea {
  min-height: 180px;
  resize: none;
}

.value-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  font-weight: 800;
  text-align: center;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.choice-card {
  min-height: 128px;
  padding: 18px;
  text-align: center;
}

.choice-card.selected {
  background: var(--accent-soft);
  border-color: rgba(45, 106, 79, 0.45);
}

.choice-card strong {
  display: block;
  font-size: 1.7rem;
}

.choice-badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 37, 66, 0.08);
  font-size: 0.92rem;
  font-weight: 800;
}

.signature-wrap {
  width: 100%;
  border-radius: 26px;
  overflow: hidden;
  border: 2px dashed rgba(16, 37, 66, 0.22);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#signature-pad {
  display: block;
  width: 100%;
  height: 340px;
  background:
    linear-gradient(180deg, rgba(45, 106, 79, 0.04), rgba(45, 106, 79, 0)),
    #fff;
  touch-action: none;
}

.signature-clear {
  margin-top: 14px;
  width: 100%;
  min-height: 62px;
}

.wizard-actions {
  margin-top: 16px;
}

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

.summary-block {
  margin-top: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #fff;
}

.pin-block {
  margin-bottom: 0;
}

.pin-hint {
  margin: 8px 0 14px;
  color: var(--muted);
}

.pin-row {
  width: 100%;
}

.pin-input {
  text-align: center;
  letter-spacing: 0.35em;
  font-weight: 800;
}

.pin-error {
  margin-top: 10px;
  color: #b42318;
  font-weight: 700;
}

.summary-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.summary-item {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1ed;
}

.summary-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.result-badge {
  display: inline-flex;
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.1);
  font-weight: 800;
}

.return-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: 24px;
  background: var(--warn);
  font-size: 1.2rem;
  font-weight: 800;
}

.footer-note {
  margin-top: 18px;
}

@media (min-width: 700px) {
  .shell {
    padding: 14px;
  }

  .panel-home,
  .panel-wizard {
    padding: 24px;
  }

  .language-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
