/* ==========================================================================
   CloakShield Pro — account pages
   Registration, the post-signup welcome, and the workspace preview.
   Loaded by register.html, welcome.html and dashboard.html only.
   ========================================================================== */

/* --- Shared shell --------------------------------------------------------- */

.appmain {
  position: relative;
  z-index: 1;
  padding-block: clamp(2rem, 5vw, 3.6rem);
}

/* --- Registration --------------------------------------------------------- */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: clamp(1.5rem, 4vw, 3.2rem);
  align-items: start;
}

/* The proof column tracks the form on a tall page rather than running out
   halfway down it. */
@media (min-width: 901px) {
  .auth__aside { position: sticky; top: calc(var(--nav-h) + 1.4rem); }
}

.auth__panel { padding: clamp(1.6rem, 3.4vw, 2.5rem); }

.auth__head { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1.5rem; }
.auth__title { font-family: var(--f-display); font-size: clamp(1.75rem, 3.4vw, 2.35rem); font-weight: 700; letter-spacing: -0.036em; line-height: 1.08; }
.auth__sub { color: var(--text-2); font-size: 0.945rem; max-width: 46ch; }

.authform { display: flex; flex-direction: column; gap: 1.05rem; }

.authform .input { padding: 0.85rem 0.95rem; font-size: 0.95rem; }
.authform .select { padding: 0.85rem 2rem 0.85rem 0.95rem; font-size: 0.95rem; }
.authform label,
.authform .field__label { font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); }

.authform fieldset { border: 0; padding: 0; margin: 0; }
.authform legend { padding: 0; margin-bottom: 0.45rem; }

.field__hint { font-size: 0.775rem; color: var(--faint); line-height: 1.5; }

/* Radio cards — one visible choice per account type, no dropdown to open. */
.choices { display: grid; gap: 0.5rem; }

.choice { position: relative; display: block; cursor: pointer; }
.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice__box {
  display: block;
  padding: 0.75rem 0.9rem 0.8rem 2.3rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

/* The dot is drawn on the box so the real input can stay invisible and still
   own focus, keyboard selection and the accessible name. */
.choice__box::before {
  content: "";
  position: absolute;
  left: 0.9rem;
  top: 1.02rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.choice__t { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.choice__d { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; }

.choice:hover .choice__box { border-color: var(--line); background: var(--surface-2); }

.choice input:checked ~ .choice__box {
  border-color: var(--accent-line);
  background: var(--accent-wash);
}

.choice input:checked ~ .choice__box::before {
  border-color: var(--accent-solid);
  box-shadow: inset 0 0 0 3.5px var(--accent-solid);
}

.choice input:focus-visible ~ .choice__box {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

/* Password field with an in-field reveal control */
.pw { position: relative; display: flex; }
.pw .input { padding-right: 3.9rem; }

.pw__see {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.34rem 0.55rem;
  border-radius: var(--r-sm);
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.pw__see:hover { color: var(--accent); background: var(--accent-wash); }

/* Strength meter — four segments, filled as the rules below are met. */
.pwbar { display: flex; gap: 4px; margin-top: 0.55rem; }
.pwbar i {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--line);
  transition: background-color 0.35s var(--ease);
  display: block;
}

.pwmeta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.4rem; }
.pwmeta__t { font-size: 0.76rem; color: var(--faint); }
.pwmeta__s { font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }

.pw-1 i:nth-child(-n + 1) { background: var(--red); }
.pw-2 i:nth-child(-n + 2) { background: var(--amber); }
.pw-3 i:nth-child(-n + 3) { background: var(--azure); }
.pw-4 i { background: var(--accent); }

.pw-1 .pwmeta__s { color: var(--red); }
.pw-2 .pwmeta__s { color: var(--amber); }
.pw-3 .pwmeta__s { color: var(--azure); }
.pw-4 .pwmeta__s { color: var(--accent); }

/* Inline validation */
.field.is-bad .input,
.field.is-bad .select { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-wash); }
.field.is-bad .choice__box { border-color: var(--red); }
.field__err { font-size: 0.78rem; color: var(--red); display: none; }
.field.is-bad .field__err { display: block; }
.field.is-bad .field__hint { display: none; }

.auth__alt { font-size: 0.85rem; color: var(--muted); text-align: center; }
.auth__alt a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.auth__legal { font-size: 0.775rem; color: var(--faint); line-height: 1.6; }
.auth__legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.auth__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.15rem;
  padding-top: 1.05rem;
  margin-top: 0.3rem;
  border-top: 1px solid var(--line-soft);
}

.auth__trust span { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.auth__trust svg { width: 13px; height: 13px; color: var(--accent); flex: none; }

/* Right-hand proof column */
.auth__aside { display: flex; flex-direction: column; gap: 1.15rem; }

.auth__order {
  border: 1px solid var(--accent-line);
  border-radius: var(--r);
  background: linear-gradient(160deg, var(--accent-wash), transparent 72%), var(--surface);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth__order-h { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.auth__order-h b { font-family: var(--f-display); font-size: 1.02rem; letter-spacing: -0.022em; }
.auth__order-l { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: var(--muted); }
.auth__order-l b { font-family: var(--f-mono); font-weight: 500; color: var(--text-2); }

.perks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.perks li { display: grid; grid-template-columns: 30px 1fr; gap: 0.75rem; align-items: start; }
.perks svg { width: 30px; height: 30px; padding: 7px; border-radius: 9px; background: var(--accent-wash); border: 1px solid var(--accent-line); color: var(--accent); }
.perks b { display: block; font-family: var(--f-display); font-size: 0.9rem; letter-spacing: -0.016em; }
.perks span { font-size: 0.83rem; color: var(--muted); }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__aside { order: -1; }
}

/* --- Welcome / onboarding -------------------------------------------------- */

.welcome { max-width: 780px; margin-inline: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.15rem; }

.welcome__seal {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  box-shadow: 0 0 0 10px var(--accent-wash);
  animation: seal-in 0.75s var(--ease-out) both;
}

.welcome__seal svg { width: 34px; height: 34px; }

@keyframes seal-in {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: none; }
}

.welcome__t { font-family: var(--f-display); font-size: clamp(1.85rem, 4vw, 2.75rem); font-weight: 700; letter-spacing: -0.036em; line-height: 1.08; }
.welcome__p { color: var(--text-2); max-width: 56ch; }
.welcome__mail { font-family: var(--f-mono); font-size: 0.85rem; color: var(--accent); word-break: break-all; }

.welcome .flowsteps { width: 100%; }

/* The seal turns green only once the address is actually confirmed — before
   that it is the neutral "mail is on its way" state. */
.welcome__seal--ok {
  background: var(--green-wash);
  border-color: var(--green-line);
  color: var(--green);
  box-shadow: 0 0 0 10px var(--green-wash);
}

.welcome .form__status { text-align: left; max-width: 60ch; }

.verify__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }
.btn.is-busy { pointer-events: none; opacity: 0.72; }

.checklist { display: flex; flex-direction: column; gap: 0.7rem; width: 100%; text-align: left; margin-top: 0.6rem; }

.chk {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.chk:hover { border-color: var(--accent-line); transform: translateX(3px); }

.chk__pip {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--faint);
}

.chk__pip svg { width: 16px; height: 16px; }
.chk.is-done .chk__pip { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent); }
.chk.is-next .chk__pip { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-solid); }

.chk__t { font-family: var(--f-display); font-size: 0.96rem; font-weight: 700; letter-spacing: -0.018em; }
.chk__d { font-size: 0.83rem; color: var(--muted); }
.chk__go { flex: none; }

@media (max-width: 620px) {
  .chk { grid-template-columns: 34px minmax(0, 1fr); }
  .chk__go { grid-column: 2; justify-self: start; }
}

/* --- Dashboard page -------------------------------------------------------- */

/* Subscription panel — the only route to the checkout, and the reason the
   pricing table on the marketing page links to registration instead. */
.subpanel {
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  background: linear-gradient(168deg, var(--accent-wash), transparent 58%), var(--surface);
  padding: clamp(1.15rem, 2.6vw, 1.7rem);
  margin-bottom: 1.5rem;
}

.subpanel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

.subpanel__head .eyebrow { display: block; margin-bottom: 0.3rem; }
.subpanel__head p { margin-top: 0.4rem; }

.subpanel__lock {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  margin-bottom: 1.15rem;
  border: 1px solid var(--amber);
  background: var(--amber-wash);
  border-radius: var(--r);
  font-size: 0.86rem;
  color: var(--text-2);
}

.subpanel__lock svg { width: 17px; height: 17px; color: var(--amber); flex: none; margin-top: 2px; }
.subpanel__lock b { color: var(--text); }
.subpanel__lock a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.subplans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }

.subplan {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.subplan:hover { border-color: var(--accent-line); }
.subplan[aria-checked="true"] { border-color: var(--accent-solid); background: var(--surface-2); }

.subplan__n { display: flex; align-items: center; gap: 0.5rem; font-family: var(--f-display); font-size: 0.95rem; font-weight: 700; letter-spacing: -0.018em; color: var(--text); }
.subplan__p { font-family: var(--f-mono); font-size: 1.25rem; color: var(--text); }
.subplan__p i { font-style: normal; font-size: 0.72rem; color: var(--faint); margin-left: 0.25rem; }
.subplan__d { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

.subpanel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.15rem;
  margin-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.subtotal { display: flex; flex-direction: column; gap: 0.1rem; }
.subtotal b { font-family: var(--f-display); font-size: 1.6rem; letter-spacing: -0.03em; }

/* An unconfirmed address keeps the button in place but visibly inert — it
   routes back to the verification step instead of the payment page. */
.btn.is-off { opacity: 0.6; }

@media (max-width: 780px) {
  .subplans { grid-template-columns: 1fr; }
  .subpanel__foot { flex-direction: column; align-items: stretch; }
  .subpanel__foot .btn { justify-content: center; }
}

.dashnote {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--amber);
  background: var(--amber-wash);
  border-radius: var(--r);
  font-size: 0.865rem;
  color: var(--text-2);
  margin-bottom: 1.3rem;
}

.dashnote svg { width: 17px; height: 17px; color: var(--amber); flex: none; }
.dashnote a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.dashnote b { color: var(--text); }

/* A payment in flight is information, not a warning — blue rather than amber,
   so the one genuinely amber notice on the page keeps its meaning. */
.dashnote--wait { border-color: var(--accent-line); background: var(--accent-wash); }
.dashnote--wait svg { color: var(--accent); }

/* --- Account strip ---------------------------------------------------------
   Four facts, in the order someone asks them when a tool is greyed out. */

.acctbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 1.3rem;
}

.acctbar__i {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  min-width: 0;
}

.acctbar__k {
  font-family: var(--f-mono);
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}

.acctbar__v {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acctbar__v.is-ok { color: var(--green); }
.acctbar__v.is-warn { color: var(--amber); }

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

/* --- Console lock ----------------------------------------------------------
   The console below it is real markup on the shared sample set. This ribbon
   is what stops those numbers being read as the visitor's own. */

.conwrap { position: relative; }

.conlock {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface-2);
}

.conlock__i { width: 20px; height: 20px; color: var(--muted); flex: none; }

.conlock__t { display: flex; flex-direction: column; gap: 0.16rem; min-width: 0; flex: 1 1 22ch; }
.conlock__t b { font-size: 0.9rem; color: var(--text); }
.conlock__t span { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }

.conlock:not([hidden]) + .appshot { border-top-left-radius: 0; border-top-right-radius: 0; }

/* The configure group is inert while the plan is not live, and saying so is
   better than leaving it looking clickable. */
[data-sub="none"] .appshot__side span.appshot__navi,
[data-sub="pending"] .appshot__side span.appshot__navi { opacity: 0.55; }

@media (max-width: 620px) {
  .conlock { flex-direction: column; align-items: stretch; }
  .conlock .btn { justify-content: center; }
  .conlock__i { display: none; }
}

/* --- Live plan summary ------------------------------------------------------ */

.subpanel--live { border-color: var(--green-line); background: linear-gradient(168deg, var(--green-wash), transparent 58%), var(--surface); }

.billing {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.billing div {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  min-width: 0;
}

.billing dt {
  font-family: var(--f-mono);
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}

.billing dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* --- Connected platforms ---------------------------------------------------
   One card per connector. The mark colour is the only thing that varies, so
   a row is recognisable before the name is read. */

.intgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 0.7rem;
}

.intg {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-areas:
    "mark id"
    "meta meta"
    "state state";
  gap: 0.55rem 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  transition: border-color 0.2s var(--ease);
}

.intg:hover { border-color: var(--accent-line); }

.intg__mark {
  grid-area: mark;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand-ch);
}

.intg__mark svg { width: 22px; height: 22px; }

.intg[data-brand="kt"] .intg__mark { color: var(--brand-kt); }
.intg[data-brand="vl"] .intg__mark { color: var(--brand-vl); }
.intg[data-brand="bn"] .intg__mark { color: var(--brand-bn); }
.intg[data-brand="rt"] .intg__mark { color: var(--brand-rt); }

.intg__id { grid-area: id; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; align-self: center; }
.intg__id b { font-family: var(--f-display); font-size: 0.95rem; letter-spacing: -0.018em; color: var(--text); }
.intg__id span { font-size: 0.76rem; color: var(--muted); }

.intg__meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin: 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line-soft);
}

.intg__meta div { display: flex; flex-direction: column; gap: 0.1rem; }
.intg__meta dt { font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.intg__meta dd { margin: 0; font-size: 0.82rem; color: var(--text-2); }

.intg__state {
  grid-area: state;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.intg__state--on { color: var(--green); }
.intg__state--work { color: var(--amber); }

/* --- Routing policy --------------------------------------------------------- */

.cfg { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }

.cfg__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-soft);
}

.cfg__row:last-child { border-bottom: 0; }

.cfg__t { display: flex; flex-direction: column; gap: 0.16rem; min-width: 0; }
.cfg__t b { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.cfg__t span { font-size: 0.79rem; color: var(--muted); line-height: 1.5; }
.cfg__t code { font-family: var(--f-mono); font-size: 0.94em; color: var(--text-2); }

.cfg__val {
  flex: none;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  white-space: nowrap;
}

.cfg__val--num { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }

@media (max-width: 620px) {
  /* One card per row rather than trusting auto-fill: inside the console the
     available width is the viewport minus the wrap, the shell border and the
     main padding, which lands a few pixels either side of the 268px track. */
  .intgrid { grid-template-columns: 1fr; }
  .cfg__row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}
