:root{
  --navy:#0f1b3d;
  --blue:#2b57e8;
  --blue-dark:#1e46d1;
  --blue-light:#e8edfd;
  --green:#1c9a6c;
  --green-light:#e5f6ef;
  --amber:#b5790a;
  --amber-light:#fdf1de;
  --red:#b3261e;
  --red-light:#fbeae8;
  --gray:#6b7280;
  --gray-light:#f4f5f7;
  --border:#e3e6ec;
  --text:#1b2436;
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--gray-light);
  color:var(--text);
}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px;}

/* ---------- topbar ---------- */
.topbar{
  background:var(--navy);color:#fff;padding:14px 28px;
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;
}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:16px;letter-spacing:.2px;}
.dot{width:9px;height:9px;border-radius:50%;background:var(--blue);display:inline-block;}
.env-switch{display:flex;gap:4px;background:rgba(255,255,255,.1);padding:4px;border-radius:22px;}
.env-btn{
  border:none;background:transparent;color:#c7cef0;font:inherit;font-size:12.5px;font-weight:700;
  letter-spacing:.2px;padding:7px 14px;border-radius:18px;cursor:pointer;
  transition:background .15s ease,color .15s ease;
}
.env-btn:hover:not(.active){color:#fff;}
.env-btn.active{background:rgba(255,255,255,.18);color:#fff;}

/* ---------- layout ---------- */
.layout{display:flex;max-width:1180px;margin:0 auto;gap:28px;padding:28px;align-items:flex-start;}
.sidebar{
  width:270px;flex-shrink:0;background:#fff;border:1px solid var(--border);
  border-radius:12px;padding:18px;position:sticky;top:20px;
}
.sidebar[hidden]{display:none;}
.sidebar-title{
  font-size:12px;text-transform:uppercase;letter-spacing:.6px;color:var(--gray);
  margin:0 0 14px 4px;font-weight:600;
}
.step-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;}
.step-btn{
  width:100%;display:flex;align-items:flex-start;gap:12px;padding:11px 10px;border-radius:9px;
  background:none;border:none;font:inherit;text-align:left;cursor:pointer;color:inherit;
  transition:background .15s ease;
}
.step-btn:hover:not(:disabled){background:var(--gray-light);}
.step-btn:disabled{cursor:not-allowed;opacity:.55;}
.step-btn.current{background:var(--blue-light);}
.badge{
  width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-size:12px;font-weight:700;flex-shrink:0;background:#eef0f4;color:var(--gray);
  border:1.5px solid var(--border);
}
.badge.complete{background:var(--green);color:#fff;border-color:var(--green);}
.badge.current-badge{background:var(--blue);color:#fff;border-color:var(--blue);}
.badge.skipped{background:var(--amber-light);color:var(--amber);border-color:var(--amber);}
.badge.locked-badge{background:#f0f1f4;color:#a7acb8;}
.step-text{display:flex;flex-direction:column;gap:2px;min-width:0;}
.step-text .title{font-size:13.5px;font-weight:600;}
.step-text .sub{font-size:11.5px;color:var(--gray);line-height:1.35;}
.sidebar-footer{margin-top:16px;padding-top:14px;border-top:1px solid var(--border);}

.main{flex:1;min-width:0;}
.card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:28px 30px;}
.card:focus{outline:none;}

/* ---------- typography ---------- */
.eyebrow{
  font-size:12px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;
  color:var(--blue);margin-bottom:6px;
}
.step-title{font-size:22px;margin:0 0 6px;}
.step-desc{color:var(--gray);font-size:14.5px;line-height:1.5;margin:0 0 22px;max-width:620px;}
.hint{font-size:12px;color:var(--gray);margin-top:5px;}
.hint a{color:var(--blue);}
.section-label{font-size:14px;font-weight:600;margin:0 0 12px;}

/* ---------- banners ---------- */
.banner{
  display:block;padding:14px 16px;border-radius:10px;margin-bottom:20px;
  font-size:13.5px;line-height:1.5;
}
.banner.warn{background:var(--amber-light);color:#7a5206;border:1px solid #f0dcae;}
.banner.info{background:var(--blue-light);color:#1c3a9e;border:1px solid #cfdbfb;}
.banner.success{background:var(--green-light);color:#0f6b48;border:1px solid #bfe7d5;}
.banner.error{background:var(--red-light);color:#8c1d18;border:1px solid #f2c9c5;}
.banner .btn-text{color:inherit;}
/* A banner answering the control above it needs air, not a hairline gap. */
.hint + .banner{margin-top:18px;}

/* ---------- fields ---------- */
.field-group{margin-bottom:18px;}
/* FIND-004/005 — this exists because a style attribute is an inline style and
   the CSP forbids one. There is no `style:` prop anywhere in app.js. */
.field-group.spaced{margin-top:22px;}
/* A dependent block revealed by a toggle above it — set in from the question
   it answers, so it reads as part of that answer rather than a new section. */
.subsection{
  margin:22px 0 4px;padding:18px 20px;
  border:1.5px solid var(--border);border-left:3px solid var(--blue);border-radius:10px;
  background:var(--gray-light);
}
.subsection .section-label{margin-bottom:14px;}
.subsection .field-group:last-child{margin-bottom:0;}
label{display:block;font-size:13px;font-weight:600;margin-bottom:6px;}
input[type=text],input[type=email],input[type=password]{
  width:100%;max-width:420px;padding:10px 12px;border:1.5px solid var(--border);
  border-radius:8px;font-size:13.5px;font-family:inherit;background:#fff;color:inherit;
}
input:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-light);}
input[aria-invalid="true"]{border-color:var(--red);}
input:disabled{background:var(--gray-light);color:var(--gray);}
.field-error{
  font-size:12.5px;color:var(--red);margin-top:6px;font-weight:500;min-height:0;
}
.field-error:empty{display:none;}

/* ---------- buttons ---------- */
.btn{
  border:none;padding:10px 18px;border-radius:8px;font-size:13.5px;font-weight:600;
  cursor:pointer;font-family:inherit;line-height:1.3;
}
.btn:disabled{cursor:not-allowed;}
.btn-primary{background:var(--blue);color:#fff;}
.btn-primary:hover:not(:disabled){background:var(--blue-dark);}
.btn-primary:disabled{background:#a9b8ec;}
.btn-ghost{background:#fff;color:var(--text);border:1.5px solid var(--border);}
.btn-ghost:hover:not(:disabled){border-color:var(--blue);color:var(--blue);}
.btn-ghost:disabled{opacity:.6;}
.btn-text{
  background:none;border:none;color:var(--gray);font-size:13px;font-family:inherit;
  cursor:pointer;text-decoration:underline;padding:0;font-weight:600;
}
.btn-block{width:100%;}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:10px 0 22px;}
.footer-actions .row{margin:0;}

/* ---------- credential chip ---------- */
.cred-chip{
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
  border:1.5px solid var(--green);background:var(--green-light);
  border-radius:10px;padding:14px 16px;margin-bottom:18px;
}
.cred-chip .k{font-size:11.5px;text-transform:uppercase;letter-spacing:.4px;color:#0f6b48;font-weight:700;}
.cred-chip .v{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13.5px;color:#0f6b48;}
.cred-chip .spacer{flex:1;}

/* ---------- toggles ---------- */
.toggle-row{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:16px 18px;border:1.5px solid var(--border);border-radius:10px;margin-bottom:12px;
}
.toggle-row .name{font-weight:600;font-size:14px;}
.toggle-row .desc{font-size:12.5px;color:var(--gray);margin-top:2px;}
.switch{
  position:relative;width:42px;height:24px;background:#d7dbe4;border-radius:20px;
  cursor:pointer;flex-shrink:0;border:none;padding:0;transition:background .15s ease;
}
.switch[aria-checked="true"]{background:var(--green);}
.switch .knob{
  position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;
  background:#fff;transition:left .15s ease;box-shadow:0 1px 3px rgba(0,0,0,.25);
}
.switch[aria-checked="true"] .knob{left:20px;}

/* ---------- repo cards ---------- */
.repo-card{
  display:flex;justify-content:space-between;align-items:center;gap:14px;
  border:1.5px solid var(--border);border-radius:10px;padding:16px 18px;margin-bottom:12px;
}
.repo-card .name{font-weight:600;font-size:14px;}
.repo-card .url{font-size:12px;color:var(--gray);margin-top:2px;word-break:break-all;}
.status-pill{font-size:11.5px;font-weight:700;padding:4px 10px;border-radius:20px;white-space:nowrap;}
.status-pill.granted{background:var(--green-light);color:var(--green);}
.status-pill.requested{background:var(--amber-light);color:var(--amber);}
.status-pill.none{background:#f0f1f4;color:var(--gray);}
.soon-badge{
  display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:.3px;text-transform:uppercase;
  background:#eef0fb;color:#4a4fb0;padding:3px 8px;border-radius:20px;margin-left:8px;vertical-align:middle;
}

/* ---------- summary ---------- */
.summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin:20px 0;}
.summary-item{border:1.5px solid var(--border);border-radius:10px;padding:14px 16px;}
.summary-item .k{font-size:11.5px;text-transform:uppercase;letter-spacing:.4px;color:var(--gray);font-weight:700;}
/* The review screen puts filed values in here — Merchant IDs, Apple merchant
   IDs, shop URLs — and those are long enough to reach the card edge. Wrap
   rather than overflow; there is nowhere to put an inline style (FIND-004). */
.summary-item .v{font-size:14.5px;font-weight:600;margin-top:4px;overflow-wrap:anywhere;}

.footer-actions{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  margin-top:26px;padding-top:20px;border-top:1px solid var(--border);
}
.checklist{margin:0 0 24px 22px;padding:0;font-size:13.5px;color:var(--gray);line-height:1.7;}

/* ---------- modals ---------- */
.modal-overlay{
  position:fixed;inset:0;background:rgba(15,20,35,.45);
  display:flex;align-items:center;justify-content:center;z-index:100;padding:20px;
}
.modal-overlay[hidden]{display:none;}
.modal{
  background:#fff;border-radius:12px;padding:26px 28px;max-width:440px;width:100%;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}
.modal h3{margin:0 0 10px;font-size:17px;}
.modal p{font-size:13.5px;color:var(--gray);line-height:1.5;margin:0 0 20px;}
.modal-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;}

/* ---------- misc ---------- */
.busy{opacity:.6;pointer-events:none;}
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0;
}
@media (max-width:820px){
  .layout{flex-direction:column;padding:18px;}
  .sidebar{width:100%;position:static;}
  .card{padding:22px 20px;}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none !important;animation:none !important;}
}

/* The JS-disabled fallback. Everything else on this page is drawn by app.js, so
   without it the layout below renders as an empty shell — this is the only
   content a merchant would otherwise see. Hidden whenever scripting is on,
   because <noscript> itself is only rendered when it is off. */
.noscript{max-width:46rem;margin:3rem auto;padding:1.5rem 1.75rem;background:#fff;
  border:1px solid var(--border);border-radius:12px;color:var(--text)}
.noscript h1{margin:0 0 .5rem;font-size:1.25rem;color:var(--navy)}
.noscript p{margin:0 0 .75rem;color:var(--gray);line-height:1.55}
.noscript a{color:var(--blue)}
