/* ==========================================================================
   Screen s19 — MoA Signing (EX-03) · Stage 5 Badge
   ========================================================================== */

/* ---- MoA document header (in hero) ------------------------------------ */

.moa-doc {
  margin-top: 4px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent);
}

.moa-doc__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 650;
  color: var(--accent-ink);
}

.moa-doc__ref {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-500);
}

/* ---- Agreed terms ----------------------------------------------------- */

.terms {
  display: flex;
  flex-direction: column;
}

.terms__row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  font-size: var(--fs-sm);
  line-height: 1.55;
  border-bottom: 1px solid var(--line);
}

.terms__row:first-child {
  padding-top: 0;
}

.terms__key {
  color: var(--ink-500);
}

.terms__val {
  font-weight: 600;
  color: var(--ink-900);
}

.terms__val.is-locked {
  color: var(--success-ink);
}

/* Farmer payout — highlighted closing row */
.terms__row--total {
  align-items: baseline;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--success-line);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--success-soft), #f7fbf7);
}

.terms__row--total .terms__key {
  font-weight: 650;
  color: var(--success-ink);
}

.terms__row--total .terms__val {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---- Legal clauses ---------------------------------------------------- */

.legal {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.legal .callout {
  padding: 20px;
  border-radius: var(--r-lg);
}

.legal .callout__title {
  margin-bottom: 8px;
  font-family: var(--font-display);
  line-height: 1.5;
}

.legal .callout__body {
  line-height: 1.7;
}

/* ---- Signatures ------------------------------------------------------- */

.signers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ink-50);
  border: 1px solid var(--line);
}

.signer__party {
  min-width: 0;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--ink-700);
}

.signer__status {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  white-space: nowrap;
  color: var(--success-ink);
  background: var(--success-soft);
  border: 1px solid var(--success-line);
}

/* Pending signature — signing pad */
.sign-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  padding: 22px 18px;
  border-radius: var(--r-md);
  text-align: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(21, 101, 192, 0.035) 10px 20px),
    var(--info-soft);
  border: 2px dashed #90caf9;
  cursor: pointer;
  transition: border-color var(--dur-fast), transform var(--dur) var(--ease-out), box-shadow var(--dur);
}

.sign-pad:hover {
  border-color: var(--info);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -16px rgba(21, 101, 192, 0.6);
}

.sign-pad__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
  border-radius: 50%;
  font-size: 24px;
  background: var(--surface);
  box-shadow: 0 0 0 6px rgba(144, 202, 249, 0.3), var(--shadow-sm);
}

.sign-pad__text {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--info-ink);
}

.sign-pad__sub {
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: #607d8b;
}

/* ---- Stage 5 badge (celebration card, 8a pattern) -------------------- */

.badge-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 24px 30px;
  border-radius: var(--r-xl);
  text-align: center;
  color: #fff;
  background:
    radial-gradient(260px 200px at 50% 30%, rgba(255, 213, 79, 0.24), transparent 70%),
    linear-gradient(135deg, var(--hero-from) 0%, var(--hero-via) 55%, var(--hero-to) 100%);
  box-shadow: 0 24px 48px -24px var(--accent-glow), var(--shadow-md);
}

.badge-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1.2px);
  background-size: 22px 22px;
  pointer-events: none;
}

.badge-card .medal {
  width: 116px;
  height: 116px;
  margin: 8px auto 22px;
}

.badge-card .medal__icon {
  font-size: 52px;
}

.badge-card__title {
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
}

.badge-card__sub {
  max-width: 320px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.badge-card .ribbon {
  margin-top: 8px;
}

/* ---- Running coins total --------------------------------------------- */

.coins-total__label {
  flex: 1;
  min-width: 0;
  font-weight: 650;
  color: #c25e00;
}

.coins-total__value {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 800;
  line-height: 1;
  color: #bf360c;
  font-variant-numeric: tabular-nums;
}

/* ---- Responsive ------------------------------------------------------- */

@media (max-width: 600px) {
  .terms__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}
