/* DTI signing experience — mobile first, works from 320px up. */
:root {
  --ink: #0f1c33;
  --ink-soft: #4a5568;
  --line: #dfe4ec;
  --bg: #f4f6fa;
  --card: #ffffff;
  --brand: #1f3864;
  --brand-strong: #16294a;
  --accent: #0f766e;
  --danger: #b42318;
  --ok: #067647;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 28, 51, .06), 0 8px 24px rgba(15, 28, 51, .07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* ---------- top bar ---------- */
.topbar { background: var(--brand); color: #fff; padding: 14px 0; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__mark {
  font-weight: 700; letter-spacing: .06em; background: rgba(255, 255, 255, .16);
  border-radius: 8px; padding: 4px 9px; font-size: 14px;
}
.brand__name { font-size: 13px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip {
  font-size: 12px; background: rgba(255, 255, 255, .14); border-radius: 999px;
  padding: 4px 10px; white-space: nowrap;
}

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 16px 0; box-shadow: var(--shadow);
}
.card--intro h1 { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }
.card--center { text-align: center; }
.card.is-disabled { opacity: .5; pointer-events: none; }
.card h2 { font-size: 16px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.mt { margin-top: 24px; }

.step {
  display: inline-grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 600;
}

.lead { font-size: 17px; margin: 0 0 6px; }
.hint { color: var(--ink-soft); font-size: 13px; margin: 8px 0 0; }

/* ---------- facts ---------- */
.facts { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; }
.facts > div {
  display: flex; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); padding-top: 10px;
}
.facts dt { color: var(--ink-soft); font-size: 14px; margin: 0; }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; word-break: break-all; font-weight: 400; }

/* ---------- pdf ---------- */
.pdf-frame {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #fbfcfe; height: 62vh; min-height: 320px; max-height: 640px;
}
.pdf-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- schedule ---------- */
.schedule { margin-top: 14px; }
.schedule summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 8px 0; }
table, .schedule-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
thead th { color: var(--ink-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tfoot td { font-weight: 700; border-bottom: none; }
.num { text-align: right; white-space: nowrap; }

/* ---------- OTP ---------- */
.phone { font-size: 20px; font-weight: 600; letter-spacing: .03em; margin: 6px 0 16px; }
.otp-input {
  width: 100%; max-width: 260px; font-size: 28px; letter-spacing: .35em; text-align: center;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-variant-numeric: tabular-nums;
}
label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.text-input {
  width: 100%; padding: 12px; font-size: 16px; border: 1px solid var(--line);
  border-radius: 10px; font-family: inherit;
}
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font: inherit; font-weight: 600; font-size: 15px; padding: 12px 18px; border-radius: 10px;
  cursor: pointer; min-height: 46px; transition: background .15s ease, opacity .15s ease;
}
.btn:hover:not(:disabled) { background: var(--brand-strong); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--secondary { background: var(--accent); border-color: var(--accent); }
.btn--ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn--primary { background: var(--accent); border-color: var(--accent); font-size: 16px; letter-spacing: .02em; }
.btn--block { display: block; width: 100%; margin-top: 18px; }

/* ---------- tabs + signature ---------- */
.tabs { display: flex; gap: 8px; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tab {
  flex: 1; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink-soft); padding: 10px; border-radius: 8px; cursor: pointer; min-height: 42px;
}
.tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 28, 51, .12); }

.signature-preview {
  /* Keep in sync with SIGNATURE_FONT_NAME — this is what the student sees,
     and the server renders the same face into the document. */
  font-family: "Euphoria Script", "Segoe Script", "Brush Script MT", cursive;
  font-size: 46px; line-height: 1.4; color: #10204a; min-height: 74px;
  border-bottom: 2px solid var(--ink); margin: 16px 0 4px; padding: 6px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.canvas-wrap { position: relative; border: 1px dashed var(--line); border-radius: 10px; background: #fbfcfe; }
#sig-canvas { display: block; width: 100%; height: 200px; touch-action: none; border-radius: 10px; }
.canvas-baseline {
  position: absolute; left: 18px; right: 18px; bottom: 42px; height: 1px; background: var(--line);
  pointer-events: none;
}

.checkbox { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; font-size: 15px; color: var(--ink); }
.checkbox input { width: 22px; height: 22px; margin: 0; flex: 0 0 22px; accent-color: var(--accent); }

.reject { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.reject summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.reject .btn { margin-top: 10px; }

/* ---------- status ---------- */
.status { font-size: 14px; margin-top: 12px; padding: 10px 12px; border-radius: 8px; }
.status--ok { background: #e7f6ee; color: var(--ok); }
.status--err { background: #fdecea; color: var(--danger); }

.tick {
  width: 56px; height: 56px; border-radius: 50%; background: #e7f6ee; color: var(--ok);
  display: grid; place-items: center; font-size: 30px; margin: 0 auto 12px;
}
.tick--warn { background: #fdf3e7; color: #b54708; }

/* ---------- footer ---------- */
.footer { color: var(--ink-soft); font-size: 12px; padding-bottom: 40px; text-align: center; }
.footer a { color: inherit; }
.footer__legal { opacity: .8; }

@media (min-width: 640px) {
  .card { padding: 26px; }
  .card--intro h1 { font-size: 24px; }
  .brand__name { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
