:root {
  --ink: #1b2233;
  --muted: #6b7488;
  --line: #e7eaf3;
  --brand: #6d5efc;
  --brand-2: #9a6bff;
  --brand-3: #ff7eb6;
  --ok: #12a150;
  --err: #d64545;
  --card: #ffffff;
  --radius: 22px;
  --shadow-sm: 0 1px 2px rgba(24, 31, 56, .05), 0 6px 18px rgba(24, 31, 56, .06);
  --shadow-md: 0 10px 40px rgba(75, 60, 180, .14);
  --focus: 0 0 0 4px rgba(109, 94, 252, .22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans Georgian", sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background:
    radial-gradient(1100px 500px at 80% -10%, #efe9ff 0%, rgba(239,233,255,0) 60%),
    radial-gradient(900px 500px at -10% 10%, #ffe9f4 0%, rgba(255,233,244,0) 55%),
    #f6f7fc;
  min-height: 100vh;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #6d5efc 0%, #8b5cff 42%, #b45bff 100%);
  color: #fff;
  padding: 46px 20px 92px;
  text-align: center;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  opacity: .35;
}
.hero::before { width: 260px; height: 260px; background: #ff9ecb; top: -90px; right: -40px; }
.hero::after  { width: 220px; height: 220px; background: #79e6ff; bottom: -110px; left: -30px; opacity: .28; }
.hero-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero-badge {
  width: 68px; height: 68px; border-radius: 20px;
  display: grid; place-items: center; font-size: 34px; margin: 0 auto 16px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  backdrop-filter: blur(4px);
  animation: pop .5s ease both;
}
.hero h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: .2px; }
.hero p { font-size: 16px; margin: 0 auto; max-width: 560px; color: rgba(255,255,255,.92); }

/* Stepper */
.stepper {
  list-style: none; display: flex; justify-content: center; gap: 8px;
  padding: 0; margin: 26px auto 0; max-width: 520px;
}
.step { display: flex; align-items: center; gap: 10px; flex: 1; color: rgba(255,255,255,.8); }
.step .dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; flex: none;
  background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.5);
  transition: .25s;
}
.step .lbl { font-size: 13px; font-weight: 600; white-space: nowrap; }
.step:not(:last-child)::after {
  content: ""; height: 2px; flex: 1; background: rgba(255,255,255,.28); border-radius: 2px;
}
.step.active .dot, .step.done .dot {
  background: #fff; color: var(--brand); border-color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.step.active { color: #fff; }

/* ---------- Content ---------- */
.content { max-width: 760px; margin: -60px auto 0; padding: 0 18px 70px; position: relative; z-index: 2; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  margin-bottom: 20px;
  animation: rise .5s ease both;
}
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }

.chip-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.step-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  color: var(--brand); background: #efeaff; padding: 5px 12px; border-radius: 999px;
}
.read-time { font-size: 12.5px; color: var(--muted); }

.card-title { font-size: 20px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.card-title .ic { font-size: 22px; }
.card-sub { color: var(--muted); margin: 0 0 14px; font-size: 14.5px; }

/* Terms */
.terms { max-height: 340px; overflow-y: auto; padding: 4px 14px 4px 4px; margin-top: 6px;
  border-top: 1px dashed var(--line); }
.terms::-webkit-scrollbar { width: 10px; }
.terms::-webkit-scrollbar-thumb { background: #d9ddec; border-radius: 999px; border: 3px solid #fff; }
.terms h2 {
  font-size: 15.5px; margin: 20px 0 8px; padding-left: 12px;
  border-left: 4px solid var(--brand); color: var(--ink);
}
.terms h2:first-child { margin-top: 10px; }
.terms p { margin: 0 0 10px; text-align: justify; color: #38415a; font-size: 14.5px; }
.scroll-hint { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* Fields */
.field { margin-bottom: 16px; }
label { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.req { color: var(--err); }
.optional { color: var(--muted); font-weight: 500; font-size: 12.5px; }
input[type=text], input[type=password] {
  width: 100%; padding: 13px 14px; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fbfbfe; color: var(--ink);
  transition: .18s;
}
input::placeholder { color: #aab1c4; }
input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: var(--focus); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

/* Signature tabs */
.tabs { display: inline-flex; gap: 6px; background: #f1f2f9; padding: 5px; border-radius: 999px; margin-bottom: 12px; }
.tab {
  padding: 8px 18px; border: none; background: transparent; cursor: pointer;
  border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); font-family: inherit;
  transition: .18s;
}
.tab.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

.sigwrap {
  border: 2px dashed #cdd2e6; border-radius: 16px;
  background: linear-gradient(180deg, #fcfcff, #f7f8ff); padding: 12px;
}
canvas#pad { width: 100%; height: 180px; touch-action: none; display: block; border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Ccircle cx='1' cy='1' r='.5' fill='%23e9ebf5'/%3E%3C/svg%3E"); }
.sigbar { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.linkbtn { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; padding: 4px 8px; border-radius: 8px; }
.linkbtn:hover { background: #f1eeff; }

/* Agree box */
.agree {
  display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 6px;
  background: #f4fbf6; border: 1.5px solid #cdeed6; border-radius: 14px; padding: 14px 16px;
}
.agree input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--ok); flex: none; cursor: pointer; }
.agree label { margin: 0; font-weight: 500; font-size: 14px; line-height: 1.5; cursor: pointer; }

/* Button */
.btn {
  appearance: none; border: none; cursor: pointer; font-family: inherit;
  color: #fff; padding: 15px 22px; font-size: 16px; font-weight: 700; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 26px rgba(109,94,252,.34); transition: transform .12s, box-shadow .2s, opacity .2s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(109,94,252,.42); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn-row { margin-top: 20px; }

.msg { margin-top: 14px; font-size: 14px; padding: 12px 14px; border-radius: 12px; display: none; }
.msg.show { display: block; animation: shake .35s; }
.msg.err { background: #fdeded; color: var(--err); border: 1px solid #f7c9c9; }

/* Success */
#success-view { animation: rise .5s ease both; }
.success-box { text-align: center; padding: 44px 22px; }
.success-box .check {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px;
  background: linear-gradient(135deg, #12a150, #34d17e); color: #fff;
  display: grid; place-items: center; font-size: 44px;
  box-shadow: 0 12px 30px rgba(18,161,80,.4); animation: pop .5s .05s both;
}
.success-box h1 { font-size: 26px; margin: 0 0 8px; }
.success-box .sub { color: var(--muted); font-size: 15.5px; margin: 0 0 18px; }
.ref-pill {
  display: inline-block; font-size: 13px; color: var(--brand);
  background: #efeaff; padding: 8px 16px; border-radius: 999px; font-weight: 600;
}
.confetti { font-size: 30px; letter-spacing: 6px; margin-bottom: 6px; animation: pop .5s both; }

.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 20px 34px; }

/* Animations */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

@media (max-width: 560px) {
  .hero h1 { font-size: 24px; }
  .hero { padding: 36px 16px 84px; }
  .step .lbl { display: none; }
  .card { padding: 20px; }
  .card-title { font-size: 18px; }
}
