/* ==========================================================
   E-Signature page — builds on styles.css and feature.css
   ========================================================== */

/* ---------- Hero animation ----------
   The voucher reaches its signing step, the signature is drawn, then
   Verified appears. Resting styles are the final state, so with reduced
   motion the finished, signed voucher shows. */

.es-hero {
  max-width: 540px;
}

.es-step-on {
  animation: es-step-on 7s ease-in-out infinite;
}

.es-signature {
  stroke-dasharray: 420;
  stroke-dashoffset: 0;
  animation: es-draw 7s ease-in-out infinite;
}

.es-badge {
  transform-box: fill-box;
  transform-origin: center;
  animation: es-badge 7s ease-out infinite;
}

.es-token {
  transform: translateX(270px);
  animation: es-token 7s ease-in-out infinite;
}

@keyframes es-step-on {
  0%, 18% { opacity: 0; }
  26%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes es-draw {
  0%, 28% { stroke-dashoffset: 420; }
  52%, 92% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 420; }
}

@keyframes es-badge {
  0%, 54% { opacity: 0; transform: scale(0.6); }
  62%, 92% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

@keyframes es-token {
  0% { transform: translateX(0); }
  22%, 100% { transform: translateX(270px); }
}

@media (prefers-reduced-motion: reduce) {
  .es-step-on,
  .es-signature,
  .es-badge,
  .es-token {
    animation: none;
  }
}

/* ---------- Why switch ---------- */

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 56px;
}

.compare__card {
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.compare__card--yes {
  border: 2px solid var(--accent);
  box-shadow: 0 16px 40px -20px rgba(255, 122, 0, 0.35);
}

.compare__card h3 {
  font-size: 20px;
  letter-spacing: -0.015em;
}

.compare__card--yes h3 {
  color: var(--accent-ink);
}

.compare__list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.compare__list li {
  position: relative;
  padding-left: 32px;
  font-size: 15.5px;
}

.compare__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 10px;
}

.compare__list--no li {
  color: var(--muted);
}

.compare__list--no li::before {
  border: 1.5px solid var(--line-strong);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 3l6 6M9 3l-6 6' fill='none' stroke='%23a1a1a8' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.compare__list--yes li::before {
  background-color: #2e9e5b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- What you can sign ---------- */

.docs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 56px;
}

.doc {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.doc__icon {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 10px;
  background: #fff1e5;
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc h3 {
  margin-top: 20px;
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.doc p {
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--ink-2);
  flex: 1;
}

.doc__signer {
  align-self: flex-start;
  margin-top: 20px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--bg-alt);
  border: 1px solid var(--line);
}

/* ---------- How it works ---------- */

.numbered {
  display: grid;
  gap: 28px;
  margin-top: 36px;
  counter-reset: step;
}

.numbered li {
  position: relative;
  padding-left: 56px;
  counter-increment: step;
}

.numbered li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-weight: 600;
  font-size: 15px;
  color: var(--accent-ink);
}

.numbered h3 {
  font-size: 18px;
  letter-spacing: -0.015em;
}

.numbered p {
  margin-top: 6px;
  font-size: 15.5px;
  color: var(--ink-2);
}

.inline-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.inline-link:hover {
  text-decoration-color: var(--accent);
}

/* the printed voucher */

.paper {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 18px 40px -16px rgba(0, 0, 0, 0.18);
  font-size: 12.5px;
  line-height: 1.45;
}

.paper__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}

.paper__head > div {
  display: flex;
  flex-direction: column;
}

.paper__head strong {
  font-size: 14px;
  letter-spacing: 0.06em;
}

.paper__head span {
  color: var(--muted);
}

.paper__no {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.paper__meta {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.paper__meta div {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
}

.paper__meta dt {
  color: var(--muted);
}

.paper__table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.paper__table th,
.paper__table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.paper__table th:first-child,
.paper__table td:first-child {
  text-align: left;
}

.paper__table th {
  font-weight: 500;
  color: var(--muted);
}

.slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.slot {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.slot svg {
  width: 100%;
  height: 34px;
  fill: none;
  stroke: #1d3b8f;
  stroke-width: 2;
  stroke-linecap: round;
}

.slot b {
  padding-top: 4px;
  border-top: 1px solid var(--ink);
  font-size: 12px;
}

.slot span {
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Security ---------- */

.trust {
  display: grid;
  gap: 22px;
  margin-top: 32px;
}

.trust li {
  display: flex;
  gap: 16px;
}

.trust svg {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trust h3 {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.trust p {
  margin-top: 2px;
  font-size: 15px;
  color: var(--ink-2);
}

.mock__label--top {
  margin-top: 0;
}

.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}

.states {
  display: grid;
  margin-top: 8px;
}

.state {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 0 12px 34px;
  border-bottom: 1px solid var(--line);
}

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

.state::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 10px;
}

.state span {
  font-size: 13px;
  color: var(--muted);
}

.state--ok b { color: #1f7a45; }
.state--warn b { color: #b45309; }
.state--bad b { color: #c62828; }

.state--ok::before {
  background-color: #2e9e5b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.state--warn::before {
  background-color: #d97706;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 2.5v4.5M6 9.3v.2' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.state--bad::before {
  background-color: #d32f2f;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 3l6 6M9 3l-6 6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---------- Sign for me + customer ---------- */

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
}

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

.pair__item h2 {
  margin-top: 20px;
  font-size: clamp(26px, 2.8vw, 32px);
}

.pair__item .checks {
  margin: 24px 0 32px;
}

.pair__item .row__media {
  margin-top: auto;
}

.delegate {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8eefc;
  color: #1d3b8f;
  font-size: 12.5px;
  font-weight: 600;
}

.delegate__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.delegate__who span {
  font-size: 12.5px;
  color: var(--muted);
}

.today {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  background: #fff1e5;
}

.otp {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: #1f7a45;
}

.otp svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the tablet signature pad */

.tablet {
  padding: 14px;
  border-radius: 22px;
  background: #1b1b1e;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.35);
}

.tablet__screen {
  padding: 20px;
  border-radius: 10px;
  background: #fff;
}

.tablet__head {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.tablet__head span {
  font-size: 12.5px;
  color: var(--muted);
}

.pad {
  position: relative;
  margin-top: 14px;
  padding: 10px 16px 30px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--bg-alt);
}

.pad svg {
  width: 100%;
  height: 80px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.pad__line {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 26px;
  height: 1px;
  background: var(--line-strong);
}

.pad__label {
  position: absolute;
  left: 16px;
  bottom: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.tablet__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.btn-mini--dark {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}

/* ---------- Plans ---------- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 56px;
}

.plan {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.plan--yes {
  border: 2px solid var(--accent);
}

.plan__tag {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.plan__tag--accent {
  color: var(--accent-ink);
}

.plan h3 {
  margin-top: 10px;
  font-size: 20px;
  letter-spacing: -0.015em;
}

.plan p:not(.plan__tag) {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink-2);
}

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

@media (max-width: 1024px) {
  .docs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 80px;
  }
}

@media (max-width: 760px) {
  .compare,
  .plans {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .compare,
  .docs,
  .plans {
    margin-top: 40px;
  }

  .compare__card,
  .plan {
    padding: 24px;
  }

  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .doc {
    padding: 22px;
  }

  .paper {
    padding: 18px;
  }

  .paper__head {
    flex-direction: column;
    gap: 4px;
  }

  .paper__no {
    text-align: left;
  }

  .slots {
    gap: 10px;
  }

  .tablet {
    padding: 10px;
  }

  .tablet__screen {
    padding: 14px;
  }
}
