:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a2230;
  --muted: #6b7280;
  --line: #e6e8ec;
  --accent: #e60028;
  --accent-hover: #c2001f;
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --warn: #c2001f;
  --warn-soft: #fff1f3;
  --warn-line: #ffd0d7;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(20, 30, 55, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 18px 64px;
}

/* ---------- Header ---------- */
.hero {
  text-align: center;
  padding: 8px 8px 22px;
}

.logo {
  width: min(280px, 78%);
  height: auto;
  max-height: 130px;
  object-fit: contain;
  margin: 0 auto 18px;
  display: block;
}

.hero h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text);
}

.hero .intro {
  font-size: 15px;
  color: var(--muted);
  margin: 0 auto;
  max-width: 400px;
}

/* ---------- Form card ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px;
}

.field-group {
  margin-bottom: 20px;
}

.field-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.field-group input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfc;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 0, 40, 0.1);
}

/* ---------- Progress ---------- */
.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.progress .dots {
  display: flex;
  gap: 6px;
}

.progress .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.2s;
}

.progress .dot.done {
  background: var(--success);
}

/* ---------- Step cards ---------- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.step-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.step-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 0, 40, 0.08);
}

.step-card.done {
  border-color: var(--success);
  background: var(--success-soft);
}

.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.step-badge {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-card.done .step-badge {
  background: var(--success);
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.step-helper {
  font-size: 14px;
  color: var(--muted);
  margin: 0 36px 12px;
}

/* Spach warning */
.spach-warn {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: 12px;
  color: var(--warn);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.spach-warn .icon {
  font-size: 18px;
  line-height: 1.3;
}

/* Buttons */
.action-button,
.secondary-button,
.confirm-button {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.action-button {
  background: var(--accent);
  color: #fff;
}

.action-button:hover {
  background: var(--accent-hover);
}

.confirm-button {
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
}

.confirm-button:hover {
  background: var(--warn-soft);
}

.secondary-button {
  background: #fff;
  color: var(--muted);
  border-color: var(--line);
  font-weight: 600;
  margin-top: 10px;
}

.secondary-button:hover {
  background: #f7f8fa;
}

.hidden {
  display: none !important;
}

/* Preview */
.preview {
  margin-top: 12px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.preview img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.saved-badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  background: var(--success);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

/* Submit */
.primary-button {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.primary-button:disabled {
  background: #c7cbd4;
  cursor: not-allowed;
}

.feedback {
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  min-height: 20px;
}

/* ---------- Crop overlay ---------- */
.crop-overlay {
  position: fixed;
  inset: 0;
  background: #0f1420;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 16px;
}

.crop-title {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  margin: 0;
  text-align: center;
}

.crop-stage {
  position: relative;
  max-width: 100%;
  line-height: 0;
  touch-action: none;
}

.crop-stage img {
  max-width: 100%;
  max-height: 64vh;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
  touch-action: none;
}

.handle {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  touch-action: none;
}

.handle[data-corner="tl"] { top: -12px; left: -12px; cursor: nwse-resize; }
.handle[data-corner="tr"] { top: -12px; right: -12px; cursor: nesw-resize; }
.handle[data-corner="bl"] { bottom: -12px; left: -12px; cursor: nesw-resize; }
.handle[data-corner="br"] { bottom: -12px; right: -12px; cursor: nwse-resize; }

.crop-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.crop-actions .action-button {
  background: var(--accent);
  color: #fff;
  margin: 0;
}

.crop-actions .secondary-button {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

.crop-actions .secondary-button:hover {
  background: rgba(255, 255, 255, 0.08);
}
