/* MailConnect — install wizard CSS.
   Ported from the Claude Design install.html prototype (lines 47–99)
   plus classes for error/missing/resume/non-admin blocks added during implementation. */

/* ─── WIZARD LAYOUT ──────────────────────────────────────────────────────── */

.inst {
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 52px;
  align-items: start;
  max-width: 1080px;
  margin: 0 auto;
}

/* ─── RAIL (left sidebar, desktop only) ────────────────────────────────── */

.rail {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
}

.node {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 26px;
  cursor: pointer;
}
.node:last-child { padding-bottom: 0; }

/* Connector line between nodes */
.node:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 34px;
  bottom: 2px;
  width: 2px;
  background: var(--line);
}
.node.is-done:not(:last-child)::after { background: #FBB6D9; }

/* Node dot */
.node .dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 14px 'Figtree';
  color: var(--muted);
  flex-shrink: 0;
  z-index: 1;
  transition: .2s;
}
.node .dot .ck { display: none; }

.node.is-active .dot {
  border-color: var(--pink);
  color: var(--deep);
  box-shadow: 0 0 0 4px #FFE6F2;
}
.node.is-done .dot {
  background: var(--pink);
  border-color: var(--pink);
}
.node.is-done .dot .nm { display: none; }
.node.is-done .dot .ck { display: block; }

/* Node text */
.node .nt {
  font: 600 14.5px 'Figtree';
  color: var(--ink);
  line-height: 1.25;
  margin-top: 6px;
}
.node .ns {
  font: 500 12px 'Figtree';
  color: var(--muted);
  margin-top: 2px;
}
.node.is-locked { cursor: default; }
.node.is-locked .nt { color: var(--muted); }
.node.is-active .nt { color: var(--deep); }

/* Rail progress bar */
.progtrack {
  height: 4px;
  background: #F0E8F0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}
.progtrack .fill {
  height: 100%;
  background: var(--pink);
  width: 0;
  border-radius: 999px;
  transition: width .45s cubic-bezier(.4,0,.2,1);
}

/* ─── STEP CARDS ─────────────────────────────────────────────────────────── */

.step {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 19px 22px;
  cursor: pointer;
}

/* Step number circle in card head */
.step-head .sn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 13px 'Figtree';
  color: var(--muted);
  flex-shrink: 0;
}
.step-head .sn .ck { display: none; }
.step.is-done  .step-head .sn { background: var(--pink); border-color: var(--pink); color: #fff; }
.step.is-done  .step-head .sn .nm { display: none; }
.step.is-done  .step-head .sn .ck { display: block; }
.step.is-active .step-head .sn { background: #FFE6F2; border-color: var(--pink); color: var(--deep); }

.step-head .sh-t {
  font: 600 17px 'Schibsted Grotesk';
  letter-spacing: -.01em;
  color: var(--ink);
}
.step-head .sh-s {
  margin-left: auto;
  font: 600 11.5px 'Figtree';
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: default;
}
.step.is-done .step-head .sh-s { color: var(--deep); }

/* Step body — hidden unless active */
.step-body { padding: 2px 22px 24px; display: none; }
.step.is-active .step-body { display: block; }

.step.is-active {
  box-shadow: 0 22px 50px -36px rgba(120,40,90,.45);
  border-color: #F2D4E5;
}
.step.is-locked { opacity: .55; }
.step.is-locked .step-head { cursor: default; }

/* ─── MOBILE STEP INDICATOR ─────────────────────────────────────────────── */

.mstep {
  display: none;
}

/* ─── PERMISSION ROWS ────────────────────────────────────────────────────── */

.perm {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 0;
  border-top: 1px solid var(--bg);
}
.perm code {
  font: 600 12.5px ui-monospace, Menlo, monospace;
  color: var(--deep);
  background: #FFF0F7;
  border: 1px solid #FBDCEC;
  border-radius: 7px;
  padding: 4px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}
.perm span { font: 400 14px/1.5 'Figtree'; color: var(--slate); }

/* ─── REASSURANCE BANNER ─────────────────────────────────────────────────── */

.reassure {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  background: #F4FBF6;
  border: 1px solid #CFEBD9;
  border-radius: 13px;
  padding: 15px 17px;
  margin: 18px 0;
}
.reassure .ttl { font: 600 14px 'Figtree'; color: #1F7A48; }
.reassure p    { font: 400 13.5px/1.5 'Figtree'; color: #3f7a59; margin-top: 3px; }

/* ─── PINKSKY NOTE ───────────────────────────────────────────────────────── */

.pinksky-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 11px;
  padding: 12px 14px;
  margin: 16px 0;
  font: 400 13.5px/1.5 'Figtree';
  color: #92400E;
}

/* ─── MICROSOFT SIGN-IN BUTTON ───────────────────────────────────────────── */

.msbtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 14.5px 'Figtree';
  color: #3a3845;
  background: #fff;
  border: 1px solid #d6d3dd;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: .12s;
}
.msbtn:hover { border-color: #b9b5c4; box-shadow: 0 6px 16px -10px rgba(0,0,0,.3); }

/* ─── STATIC OPTION CARDS ───────────────────────────────────────────────── */

.opt {
  border: 1.5px solid var(--line);
  border-radius: 13px;
  padding: 15px 16px;
}
.opt.rec { border-color: #F4C6DF; background: #FFF7FB; }
.opt .ot {
  font: 600 14.5px 'Figtree';
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.opt .od { font: 400 13px/1.5 'Figtree'; color: var(--slate); margin-top: 5px; }

.recbadge {
  font: 600 9.5px 'Figtree';
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--pink);
  border-radius: 999px;
  padding: 3px 8px;
}

/* ─── NUMBERED DEPLOY STEPS ─────────────────────────────────────────────── */

.numlist {
  counter-reset: s;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.numlist li {
  position: relative;
  padding-left: 34px;
  font: 400 14px/1.55 'Figtree';
  color: var(--slate);
  counter-increment: s;
}
.numlist li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: -1px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #FFE6F2;
  color: var(--deep);
  font: 600 12px 'Figtree';
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── CONSENT ERROR / MISSING STATES ────────────────────────────────────── */

.consent-result { display: none; }

.step[data-consent-state="error"]   .consent-result-error   { display: block; }
.step[data-consent-state="missing"] .consent-result-missing { display: block; }

.consent-result-error,
.consent-result-missing {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 13px;
  padding: 15px 17px;
  margin: 16px 0;
}
.consent-result-error .ttl,
.consent-result-missing .ttl {
  font: 600 14px 'Figtree';
  color: #B91C1C;
}
.consent-result-error p,
.consent-result-missing p {
  font: 400 13.5px/1.5 'Figtree';
  color: #7f1d1d;
  margin-top: 4px;
}

.consent-error-fields {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .25rem 1rem;
  margin: 10px 0;
  font-size: 13px;
}
.consent-error-fields dt { font-weight: 600; color: #B91C1C; }
.consent-error-fields dd { margin: 0; color: #7f1d1d; word-break: break-all; }

.consent-share-url {
  font: 400 12px ui-monospace, Menlo, monospace;
  color: #7f1d1d;
  word-break: break-all;
  user-select: all;
  background: #FEE2E2;
  border-radius: 6px;
  padding: 6px 8px;
  display: block;
  margin-top: 6px;
}

/* ─── NON-ADMIN SHARE SECTION ────────────────────────────────────────────── */

.nonadmin-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 13.5px 'Figtree';
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 18px;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.nonadmin-toggle:hover { color: var(--ink); }

.nonadmin-section {
  display: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-top: 14px;
}
.nonadmin-section.is-open { display: block; }

.nonadmin-section h4 {
  font: 600 15px 'Schibsted Grotesk';
  margin: 0 0 8px;
  color: var(--ink);
}
.nonadmin-section p { font-size: 13.5px; color: var(--slate); }

.nonadmin-link-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

.nonadmin-link-input {
  flex: 1;
  min-width: 0;
  font: 400 13px ui-monospace, Menlo, monospace;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nonadmin-fill-hint {
  font: 400 13px/1.5 'Figtree';
  color: var(--muted);
  font-style: italic;
  margin-top: 8px;
}

/* ─── RESUME BANNER ──────────────────────────────────────────────────────── */

.resume-banner {
  display: none;
  background: #FFF7FB;
  border: 1px solid #FBCFE5;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font: 500 13.5px 'Figtree';
  color: var(--deep);
}
.resume-banner.is-visible { display: block; }

/* ─── THANK-YOU / DONE STEP ─────────────────────────────────────────────── */

.done-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}
.done-info-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.done-info-card .dic-title {
  font: 600 15px 'Schibsted Grotesk';
  color: var(--ink);
}
.done-info-card p {
  font-size: 13.5px;
  color: var(--slate);
  margin-top: 6px;
}

.done-help-box {
  background: linear-gradient(135deg, #FFF4FA, #FBF1F8);
  border: 1px solid #F4E3EF;
  border-radius: 16px;
  padding: 20px 22px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.done-help-box .dhb-text { flex: 1; min-width: 220px; }
.done-help-box .dhb-text .dhb-title {
  font: 600 16px 'Schibsted Grotesk';
  color: var(--ink);
}
.done-help-box .dhb-text p {
  font-size: 13.5px;
  color: var(--slate);
  margin-top: 4px;
}

/* ─── FORM FIELDS ────────────────────────────────────────────────────────── */

.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-label {
  font: 600 13px 'Figtree';
  color: var(--ink);
  margin-bottom: 7px;
  display: block;
}
.field-label .opt-note {
  color: var(--muted);
  font-weight: 400;
}

.field-input {
  width: 100%;
  font: 400 15px 'Figtree';
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .12s;
}
.field-input:focus { border-color: var(--pink); }

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.field-checkbox {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--pink);
  flex-shrink: 0;
}
.field-check-label {
  font: 400 14px/1.55 'Figtree';
  color: var(--slate);
}
.field-check-label a {
  color: var(--pink);
  text-decoration: underline;
}

/* ─── RESPONSIVE: hide rail, show mobile stepper ────────────────────────── */

@media (max-width: 980px) {
  .inst { grid-template-columns: 1fr; gap: 0; }
  .rail { display: none; }
  .mstep {
    display: block;
    position: sticky;
    top: 62px;
    z-index: 30;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    padding: 14px 0;
    margin: 0 -22px 18px;
    border-bottom: 1px solid var(--line);
  }
  .mstep .in { padding: 0 22px; }
}

@media (max-width: 560px) {
  .field-grid-2 { grid-template-columns: 1fr; }
  .done-info-grid { grid-template-columns: 1fr; }
  .nonadmin-link-row { flex-direction: column; align-items: stretch; }
}
