@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,450;9..144,600&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --ink: #2b2118;
  --ink-soft: #5a4d40;
  --cream: #f7f0e4;
  --cream-deep: #efe4d2;
  --card: #fffaf1;
  --copper: #b5622f;
  --copper-deep: #8f4a22;
  --gold: #b8934f;
  --line: rgba(43, 33, 24, 0.12);
  --success: #4a7856;
  --error: #a8452f;
  --radius: 18px;
  --shadow: 0 2px 6px rgba(43, 33, 24, 0.06), 0 12px 28px rgba(43, 33, 24, 0.07);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--cream);
}

body {
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 600px 400px at 15% -5%, rgba(181, 98, 47, 0.10), transparent 60%),
    radial-gradient(ellipse 500px 500px at 110% 20%, rgba(184, 147, 79, 0.14), transparent 55%);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 84px;
}

/* Header */
.app-header {
  padding: 28px 22px 18px;
}

.app-header .eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper-deep);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header .eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}

.app-header h1 {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 450;
  font-size: 30px;
  line-height: 1.15;
  margin: 6px 0 0;
  letter-spacing: -0.01em;
}

/* Screens */
.screen {
  flex: 1;
  padding: 4px 22px 20px;
  animation: rise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.screen[hidden] { display: none; }

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

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--copper) 60%, transparent);
  opacity: 0.7;
}

.card h2 {
  font-family: 'Fraunces', serif;
  font-weight: 450;
  font-size: 19px;
  margin: 0 0 4px;
}

.card .sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(74, 120, 86, 0.12);
  color: var(--success);
  margin-bottom: 10px;
}

.status-pill.pending {
  background: rgba(184, 147, 79, 0.16);
  color: var(--copper-deep);
}

.status-pill.error {
  background: rgba(168, 69, 47, 0.12);
  color: var(--error);
}

.status-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Fields */
.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.field-row:last-child { border-bottom: none; }

.field-label {
  font-size: 12px;
  color: var(--ink-soft);
  flex-shrink: 0;
  width: 40%;
}

.field-value {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  flex: 1;
  word-break: break-word;
}

.field-row.editable { cursor: pointer; }
.field-row.editable .field-value { color: var(--copper-deep); }
.field-row.editable .field-value::after {
  content: " ✎";
  font-size: 11px;
  opacity: 0.6;
}

/* Inputs */
.input-group { margin-bottom: 14px; }

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 600;
}

.input-group input, .input-group textarea {
  width: 100%;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.input-group input:focus, .input-group textarea:focus {
  outline: none;
  border-color: var(--copper);
}

.input-group textarea { resize: vertical; min-height: 64px; }

/* Buttons */
.btn {
  display: block;
  width: 100%;
  text-align: center;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 18px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--copper) 0%, var(--copper-deep) 100%);
  color: #fff8ee;
  box-shadow: 0 8px 18px rgba(181, 98, 47, 0.28);
}

.btn-secondary {
  background: transparent;
  color: var(--copper-deep);
  border: 1.5px solid var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 10px;
}

.btn-row { display: flex; gap: 10px; margin-top: 8px; }
.btn-row .btn { flex: 1; }

/* Price display */
.price-tag {
  font-family: 'Fraunces', serif;
  font-size: 34px;
  font-weight: 450;
  margin: 6px 0 2px;
  color: var(--copper-deep);
}

.price-tag .strike {
  font-size: 16px;
  color: var(--ink-soft);
  text-decoration: line-through;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  margin-left: 8px;
}

/* Promo */
.promo-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.promo-row input { flex: 1; }
.promo-row .btn { width: auto; padding: 12px 16px; }

/* Progress steps for registration */
.reg-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
}
.reg-progress span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}
.reg-progress span.done { background: var(--gold); }
.reg-progress span.active { background: var(--copper); }

/* Bottom nav */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 5;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(43, 33, 24, 0.08);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 8px 4px;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab-btn .glyph { font-size: 19px; line-height: 1; }
.tab-btn.active { color: var(--copper-deep); background: rgba(181, 98, 47, 0.08); }

/* Toast / inline message */
.msg {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  background: rgba(74, 120, 86, 0.1);
  color: var(--success);
}
.msg.error { background: rgba(168, 69, 47, 0.1); color: var(--error); }

/* Loading */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 13px;
}
.loader .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--copper);
  animation: pulse 1.1s ease-in-out infinite;
}
.loader .dot:nth-child(2) { animation-delay: 0.15s; }
.loader .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Gate screen (phone verification) */
.gate {
  min-height: 82vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 12px;
}

.gate .mark {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--copper), var(--gold));
  margin-bottom: 22px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 26px;
  color: #fff8ee;
  box-shadow: 0 10px 24px rgba(181, 98, 47, 0.3);
}

.gate h1 {
  font-family: 'Fraunces', serif;
  font-weight: 450;
  font-size: 26px;
  margin: 0 0 10px;
}

.gate p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
  max-width: 320px;
  margin: 0 0 26px;
}

.gate .btn { max-width: 280px; }
