/* register.itguru.lk: same look as itguru.lk (ink background, cyan accent, yellow highlight). */
@font-face { font-family: 'Plex'; src: url('fonts/plex-sans-var.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Schibsted'; src: url('fonts/schibsted-var.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('fonts/plex-mono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --ink-0: #0a0d12;
  --ink-1: #0e1218;
  --ink-2: #141922;
  --ink-3: #1a202b;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #eef2f6;
  --text-2: #a9b2bf;
  --text-3: #727d8c;
  --accent: #3ebbfe;
  --accent-2: #8fd6ff;
  --accent-soft: rgba(62, 187, 254, 0.12);
  --accent-ink: #03131d;
  --marker: #ffd54a;
  --good: #3ddc97;
  --bad: #ff8a7a;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: 'Plex', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Sinhala', 'Noto Sans Tamil', 'Nirmala UI', sans-serif;
  --head: 'Schibsted', 'Plex', -apple-system, 'Segoe UI', 'Noto Sans Sinhala', 'Noto Sans Tamil', 'Nirmala UI', sans-serif;
  --mono: 'Plex Mono', 'Noto Sans Sinhala', 'Noto Sans Tamil', 'Nirmala UI', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(62, 187, 254, 0.1), transparent 60%),
    var(--ink-0);
}
[lang="si"] body, [lang="ta"] body { line-height: 1.7; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: 12px; top: -60px; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; font-weight: 700; z-index: 10; }
.skip:focus { top: 12px; }

/* ---------- Top bar ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 16px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-family: var(--head); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand b { color: var(--accent); }
.lang { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--ink-1); }
.lang button { min-height: 36px; padding: 0 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--text-2); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- Layout ---------- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 48px;
  align-items: start;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}
.intro { position: sticky; top: 24px; padding-top: 16px; }
.teran {
  width: 210px;
  height: auto;
  margin-bottom: 18px;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
  mask-image: linear-gradient(180deg, #000 70%, transparent);
}
.eyebrow { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.intro h2 { margin: 8px 0 16px; font-family: var(--head); font-size: 2rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; }
.facts { list-style: none; display: grid; gap: 10px; }
.facts li { position: relative; padding-left: 26px; color: var(--text-2); }
.facts li::before { content: ''; position: absolute; left: 0; top: 0.45em; width: 14px; height: 8px; border-left: 2.5px solid var(--good); border-bottom: 2.5px solid var(--good); transform: rotate(-45deg); }

/* ---------- Card ---------- */
.card {
  position: relative;
  padding: 28px 28px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--ink-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  outline: none;
}
.progress { position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 20px 20px 0 0; background: var(--ink-3); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.5s var(--ease); }
.stepcount { min-height: 1.3em; margin-bottom: 6px; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--text-3); }

.screen { transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.screen.enter-f { opacity: 0; transform: translateX(24px); transition: none; }
.screen.enter-b { opacity: 0; transform: translateX(-24px); transition: none; }

h1:focus { outline: none; }
h1 { font-family: var(--head); font-size: clamp(1.6rem, 4.2vw, 2.1rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; outline: none; }
[lang="si"] h1, [lang="ta"] h1, [lang="si"] .intro h2, [lang="ta"] .intro h2 { letter-spacing: 0; line-height: 1.35; }
.lead { margin-top: 10px; color: var(--text-2); font-size: 1.05rem; }
.muted { color: var(--text-3); }
.small { font-size: 0.88rem; }

/* ---------- Buttons ---------- */
.actions { margin-top: 26px; }
.actions.stack { display: grid; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background-color 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn.big { width: 100%; min-height: 58px; font-size: 1.08rem; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { border: 1.5px solid var(--line-2); color: var(--text); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 0.9rem; border-radius: 10px; background: var(--marker); color: #1b1500; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.busy { opacity: 0.8; }
.link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link.center { display: flex; justify-content: center; width: 100%; margin-top: 14px; text-align: center; }
.link.small { min-height: 36px; font-size: 0.9rem; }
.link.back { margin: -6px 0 6px -4px; padding: 0 4px; color: var(--text-2); text-decoration: none; font-weight: 500; }

/* ---------- Welcome / steps list ---------- */
.howto { list-style: none; display: grid; gap: 12px; margin-top: 22px; counter-reset: s; }
.howto li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--ink-3); }
.howto span { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* ---------- Choices (big tap cards) ---------- */
.choices { display: grid; gap: 12px; margin-top: 22px; }
.choices.years { grid-template-columns: 1fr 1fr; }
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  border: 1.5px solid var(--line-2);
  border-radius: 16px;
  background: var(--ink-1);
  text-align: left;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s var(--ease);
}
.choice:hover { border-color: var(--accent); }
.choice:active { transform: scale(0.98); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.year { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 96px; }
.year strong { font-family: var(--head); font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.year span { font-size: 0.88rem; color: var(--text-2); }
.year em { order: -1; margin-bottom: 4px; padding: 2px 8px; border-radius: 6px; background: var(--marker); color: #1b1500; font-style: normal; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.slot-icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.slot-body { flex: 1; display: grid; gap: 1px; min-width: 0; }
.slot-body small { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.slot-body strong { font-size: 1.08rem; }
.when { font-size: 0.95rem; color: var(--text-2); }
.tag { justify-self: start; margin-top: 4px; padding: 1px 8px; border-radius: 6px; background: rgba(61, 220, 151, 0.12); color: var(--good); font-size: 0.8rem; }
.fee { flex: none; display: grid; text-align: right; }
.fee b { font-size: 0.98rem; }
.fee small { font-size: 0.75rem; color: var(--text-3); }

/* ---------- Form fields ---------- */
form { margin-top: 18px; }
.field { margin-top: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 700; }
.field label small { font-weight: 400; color: var(--text-3); }
.field input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1.5px solid var(--line-2);
  border-radius: 14px;
  background: var(--ink-1);
  font-size: 1.1rem; /* 16px+ stops iPhones zooming in */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field input::placeholder { color: var(--text-3); }
.hint { margin-top: 6px; font-size: 0.88rem; color: var(--text-3); }
.hint:empty { display: none; }
.err { margin-top: 6px; color: var(--bad); font-size: 0.92rem; font-weight: 600; }
.err:empty { display: none; }
.err.big { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 138, 122, 0.1); }
.typo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 213, 74, 0.1); border: 1px solid rgba(255, 213, 74, 0.3); }
.typo[hidden] { display: none; }

/* ---------- Review ---------- */
.review { margin-top: 20px; border-top: 1px solid var(--line); }
.review .row { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 4px 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.review dt { color: var(--text-3); font-size: 0.9rem; padding-top: 2px; }
.review dd { word-break: break-word; }
.note { margin-top: 18px; padding: 12px 14px; border-left: 3px solid var(--marker); border-radius: 10px; background: rgba(255, 213, 74, 0.06); color: var(--text-2); font-size: 0.95rem; }

/* ---------- Sent / exists ---------- */
.hero-icon { display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 18px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); animation: pop 0.6s var(--ease) both; }
.hero-icon svg { width: 40px; height: 40px; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.status { margin-top: 14px; color: var(--good); font-weight: 600; }
.status:empty { display: none; }
.next { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.next h2 { font-size: 1rem; font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); }
.next .howto { margin-top: 12px; }
.next p { margin-top: 14px; }

/* ---------- Footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); color: var(--text-3); font-size: 0.92rem; }
.foot a { color: var(--text-2); }

/* ---------- Phones ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 4px; }
  .intro { display: none; }
  .card { padding: 22px 18px 26px; border-radius: 18px; }
  /* main button stays in thumb reach while typing */
  .actions.sticky {
    position: sticky;
    bottom: 0;
    margin: 22px -18px -26px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    border-radius: 0 0 18px 18px;
    background: linear-gradient(180deg, rgba(20, 25, 34, 0), var(--ink-2) 30%);
  }
}
@media (max-width: 400px) {
  .lang button { padding: 0 9px; font-size: 0.8rem; }
}
/* logo + Help + three language buttons need the room: drop the word mark on phones */
@media (max-width: 430px) {
  .brand span { display: none; }
  .top { gap: 8px; padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 400px) {
  .choices.years { grid-template-columns: 1fr 1fr; gap: 10px; }
  .review .row { grid-template-columns: 1fr auto; }
  .review dt { grid-column: 1 / -1; }
  .fee b { font-size: 0.9rem; }
}

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

/* ---------- Verification page ---------- */
.layout.single { grid-template-columns: minmax(0, 560px); justify-content: center; }
.hero-icon.good { background: rgba(61, 220, 151, 0.14); color: var(--good); }
.hero-icon.warn { background: rgba(255, 213, 74, 0.12); color: var(--marker); }
.eyebrow + h1 { margin-top: 6px; }
.muted.center { margin-top: 18px; text-align: center; }
.howto li > p { flex: 1; }

/* ---------- Bot protection ---------- */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ts { display: flex; justify-content: center; margin-top: 14px; color: var(--bad); font-size: 0.9rem; }
.ts:empty { display: none; }

/* ========== GuruBot helper (assets/guruhelp.js) ========== */
.gbbot { width: 100%; height: 100%; overflow: visible; }
.bot-body { animation: botFloat 3.2s ease-in-out infinite; transform-origin: 32px 40px; }
.bot-eyes { animation: botBlink 4.5s infinite; transform-origin: 32px 30px; }
@keyframes botFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes botBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }

/* strip at the end of each step */
.gbh-strip {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 26px;
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(62, 187, 254, 0.45);
  background: linear-gradient(135deg, rgba(62, 187, 254, 0.09), rgba(62, 187, 254, 0.02));
  animation: stripIn 0.6s var(--ease) 0.25s both;
}
@keyframes stripIn { from { opacity: 0; transform: translateY(10px); } }
.gbh-avatar { position: relative; flex: none; width: 56px; height: 56px; padding: 2px; border-radius: 18px; background: var(--ink-1); border: 1.5px solid rgba(62, 187, 254, 0.4); transition: transform 0.2s var(--ease); }
.gbh-avatar:active { transform: scale(0.94); }
.gbh-copy { flex: 1; min-width: 0; }
.gbh-title { font-weight: 700; }
.gbh-sub { margin-top: 2px; font-size: 0.88rem; color: var(--text-2); }
.gbh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gbh-chip {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(62, 187, 254, 0.35);
  background: var(--ink-1);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  line-height: 1.3;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s var(--ease);
}
.gbh-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.gbh-chip:active { transform: scale(0.97); }
.gbh-chip.own { border-style: dashed; color: var(--accent-2); }
.gbh-nudge {
  position: absolute;
  left: 46px;
  bottom: 50px;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 12px 12px 12px 2px;
  background: var(--marker);
  color: #1b1500;
  font-size: 0.8rem;
  font-weight: 700;
  animation: nudgeIn 0.5s var(--ease) both;
  pointer-events: none;
}
.gbh-nudge[hidden] { display: none; }
@keyframes nudgeIn { from { opacity: 0; transform: translateY(6px) scale(0.9); } }
.nudging .gbh-avatar { animation: wiggle 0.9s ease-in-out 2; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* header button */
.gbh-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  margin-left: auto;
  margin-right: 8px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(62, 187, 254, 0.4);
  background: rgba(62, 187, 254, 0.08);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.gbh-head .gbbot { width: 30px; height: 30px; }
@media (max-width: 400px) { .gbh-head span { display: none; } .gbh-head { padding: 0 6px; margin-right: 6px; } }

/* desktop intro card */
.gbh-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 28px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(62, 187, 254, 0.3);
  background: var(--ink-2);
}
.gbh-card > .gbbot { flex: none; width: 64px; height: 64px; }
.gbh-cta { margin-top: 10px; min-height: 42px; padding: 0 16px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.gbh-cta:hover { background: var(--accent-2); }

/* chat panel */
.gbh-panel { position: fixed; inset: 0; z-index: 50; visibility: hidden; }
.gbh-panel.open { visibility: visible; }
.gbh-backdrop { position: absolute; inset: 0; background: rgba(4, 6, 10, 0.6); opacity: 0; transition: opacity 0.3s ease; }
.gbh-panel.open .gbh-backdrop { opacity: 1; }
.gbh-sheet {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  background: var(--ink-1);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.38s var(--ease);
}
.gbh-panel.open .gbh-sheet { transform: none; }
.gbh-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.gbh-face { width: 46px; height: 46px; flex: none; }
.gbh-top p { font-family: var(--head); font-weight: 800; font-size: 1.15rem; }
.gbh-top small { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-2); }
.gbh-top small i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.2); }
.gbh-x { margin-left: auto; width: 44px; height: 44px; border-radius: 12px; font-size: 1.7rem; line-height: 1; color: var(--text-2); }
.gbh-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.gbh-msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 0.97rem; line-height: 1.5; animation: msgIn 0.35s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.gbh-msg.bot { align-self: flex-start; background: var(--ink-3); border-bottom-left-radius: 4px; }
.gbh-msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); font-weight: 600; border-bottom-right-radius: 4px; }
.gbh-msg a { color: var(--accent-2); }
.gbh-msg.typing { display: flex; gap: 4px; padding: 14px; }
.gbh-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: dot 1s infinite; }
.gbh-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.gbh-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.gbh-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.gbh-quick:empty { display: none; }
.gbh-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.gbh-form input { flex: 1; min-height: 50px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--ink-2); font-size: 1.05rem; }
.gbh-form input:focus { outline: none; border-color: var(--accent); }
.gbh-form button { width: 50px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.gbh-backlink { padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); color: var(--text-2); font-size: 0.9rem; font-weight: 600; text-align: center; }
html.gbh-lock { overflow: hidden; }

@media (max-width: 860px) {
  .gbh-sheet {
    top: auto;
    left: 0;
    width: 100%;
    height: min(86svh, 680px);
    border-left: 0;
    border-top: 1px solid var(--line-2);
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }
  .gbh-sheet::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
  .gbh-top { padding-top: 20px; }
}
@media (max-width: 400px) {
  .gbh-strip { padding: 14px 12px; gap: 10px; }
  .gbh-avatar { width: 48px; height: 48px; }
}
