:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #647087;
  --line: #dce2ec;
  --paper: #ffffff;
  --wash: #f4f7fb;
  --blue: #1466d8;
  --blue-dark: #0b4da8;
  --green: #15845a;
  --danger: #b23a3a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 82% 10%, #e6f0ff 0, transparent 30rem), var(--wash); }
button, a { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.brand { height: 84px; display: flex; align-items: center; gap: 18px; color: #48546a; font-size: 14px; font-weight: 650; letter-spacing: .02em; }
.wordmark { color: var(--ink); font-size: 18px; font-weight: 850; letter-spacing: .18em; text-decoration: none; }
.divider { width: 1px; height: 24px; background: #bdc6d5; }
.header-nav { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.header-nav a { padding: 8px 11px; border-radius: 8px; color: #566177; font-size: 12px; font-weight: 750; text-decoration: none; }
.header-nav a:hover, .header-nav a[aria-current="page"] { color: var(--ink); background: #e9eef6; }
.hero { flex: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: clamp(48px, 8vw, 112px); align-items: center; padding: 52px 0 80px; }
.eyebrow, .step { margin: 0 0 18px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 720px; margin: 0; font-size: clamp(44px, 6.1vw, 78px); line-height: .98; letter-spacing: -.055em; }
.lede { max-width: 620px; margin: 28px 0 30px; color: var(--muted); font-size: clamp(18px, 2vw, 21px); line-height: 1.65; }
.trust-list { display: grid; gap: 12px; color: #445067; font-size: 14px; }
.trust-list p { margin: 0; display: flex; align-items: center; gap: 11px; }
.check { width: 22px; height: 22px; display: inline-grid; place-items: center; flex: 0 0 auto; color: var(--green); background: #def4ea; border-radius: 50%; font-size: 12px; font-weight: 900; }
.panel { min-height: 480px; display: grid; place-items: center; padding: clamp(30px, 5vw, 54px); border: 1px solid rgba(207, 216, 230, .9); border-radius: 26px; background: rgba(255,255,255,.94); box-shadow: 0 28px 80px rgba(42, 61, 92, .13); }
.state { width: 100%; text-align: center; }
.state[hidden] { display: none; }
.state h2 { margin: 18px 0 10px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; }
.state > p:not(.step):not(.status):not(.fineprint):not(.account-email) { max-width: 390px; margin: 0 auto 26px; color: var(--muted); line-height: 1.6; }
.product-mark { width: 58px; height: 58px; margin: 0 auto 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; transform: rotate(2deg); }
.product-mark i { display: block; border-radius: 4px; }
.product-mark i:nth-child(1) { background: #f25022; }.product-mark i:nth-child(2) { background: #7fba00; }.product-mark i:nth-child(3) { background: #00a4ef; }.product-mark i:nth-child(4) { background: #ffb900; }
.primary, .secondary, .copy { border: 0; border-radius: 10px; font-weight: 750; transition: transform .16s ease, background .16s ease; }
.primary { width: 100%; min-height: 52px; padding: 14px 22px; color: white; background: var(--blue); }
.primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.secondary { min-height: 46px; padding: 12px 24px; color: var(--ink); background: #edf1f7; }
.link-button { display: grid; place-items: center; text-decoration: none; }
.fineprint { margin: 18px 0 0; color: #7a8496; font-size: 12px; line-height: 1.55; }
.code-row { display: flex; align-items: stretch; justify-content: center; gap: 10px; margin-bottom: 26px; }
.device-code { min-width: 220px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fc; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: clamp(24px, 4vw, 34px); letter-spacing: .12em; }
.copy { padding: 0 18px; color: var(--blue); background: #eaf2ff; }
ol { margin: 0 0 26px; padding-left: 24px; text-align: left; color: #4f5b71; line-height: 1.8; }
.status { min-height: 22px; margin: 18px 0 4px; color: var(--green); font-size: 13px; font-weight: 700; }
.text-button { border: 0; padding: 8px; color: var(--muted); background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.avatar { width: 76px; height: 76px; margin: 0 auto 28px; display: grid; place-items: center; border-radius: 22px; color: white; background: linear-gradient(145deg, #2275df, #6f50d8); font-size: 32px; font-weight: 800; box-shadow: 0 14px 30px rgba(36, 100, 207, .25); }
.account-email { margin: 0 0 26px; color: var(--muted); }
.connected-badge { width: fit-content; margin: 0 auto 30px; padding: 9px 13px; border-radius: 999px; color: var(--green); background: #e7f6ef; font-size: 12px; font-weight: 750; }
.connected-badge span { width: 7px; height: 7px; display: inline-block; margin-right: 7px; border-radius: 50%; background: var(--green); }
.error-icon { width: 52px; height: 52px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--danger); background: #fbe8e8; font-size: 24px; font-weight: 900; }
.spinner { width: 38px; height: 38px; display: inline-block; border: 3px solid #d9e4f4; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.portal { flex: 1; display: grid; align-content: center; padding: 70px 0 100px; }
.portal-copy { max-width: 760px; }
.portal h1 { max-width: 760px; }
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 46px; }
.portal-card { min-height: 240px; display: flex; flex-direction: column; padding: 30px; border: 1px solid rgba(207, 216, 230, .95); border-radius: 22px; color: var(--ink); background: rgba(255,255,255,.93); box-shadow: 0 18px 52px rgba(42,61,92,.08); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.portal-card:hover { transform: translateY(-3px); border-color: #b7c8e2; box-shadow: 0 24px 62px rgba(42,61,92,.13); }
.portal-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--blue); background: #eaf2ff; font-size: 20px; font-weight: 850; }
.portal-card h2 { margin: 38px 0 10px; font-size: 26px; letter-spacing: -.035em; }
.portal-card p { max-width: 420px; margin: 0; color: var(--muted); line-height: 1.65; }
.portal-arrow { margin-top: auto; padding-top: 24px; color: var(--blue); font-size: 13px; font-weight: 800; }
.admin-layout { flex: 1; padding: 62px 0 90px; }
.admin-heading { max-width: 680px; }
.admin-heading h1 { font-size: clamp(42px, 6vw, 68px); }
.status-panel { margin-top: 44px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 22px 60px rgba(42,61,92,.09); }
.status-row { display: grid; grid-template-columns: minmax(150px,.7fr) minmax(0,1.3fr); gap: 24px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.status-row:last-child { border-bottom: 0; }
.status-label { color: var(--muted); font-size: 13px; }
.status-value { font-weight: 750; overflow-wrap: anywhere; }
.status-value.good { color: var(--green); }
.status-note { max-width: 720px; margin: 22px 2px 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.entra-setup { margin-top: 48px; padding: clamp(26px, 4vw, 42px); border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 22px 60px rgba(42,61,92,.09); }
.setup-heading { max-width: 720px; }
.setup-heading .eyebrow { margin-bottom: 12px; }
.setup-heading h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.setup-heading > p:last-child { margin: 14px 0 0; color: var(--muted); line-height: 1.65; }
.setup-form { max-width: 760px; margin-top: 32px; }
.setup-grid { display: grid; grid-template-columns: minmax(160px,.46fr) minmax(0,1fr); gap: 12px 24px; align-items: center; }
.setup-grid label { color: #445067; font-size: 13px; font-weight: 750; }
.setup-grid input, .setup-grid select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #cbd4e2; border-radius: 10px; color: var(--ink); background: #fbfcfe; font: inherit; }
.setup-grid input:focus, .setup-grid select:focus { outline: 3px solid rgba(20,102,216,.15); border-color: var(--blue); }
.setup-actions { display: grid; grid-template-columns: minmax(220px,320px) 1fr; gap: 18px; align-items: center; margin-top: 24px; }
.setup-message { min-height: 22px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.setup-message.good { color: var(--green); }
.setup-message.error { color: var(--danger); }
.setup-complete { display: flex; align-items: flex-start; gap: 14px; max-width: 760px; margin-top: 30px; padding: 20px; border: 1px solid #bee5d3; border-radius: 14px; background: #effaf5; }
.setup-complete[hidden], .setup-form[hidden] { display: none; }
.setup-complete strong { display: block; }
.setup-complete p { margin: 5px 0 0; color: #486459; font-size: 13px; }
.setup-guide { max-width: 760px; margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }
.setup-guide > a { color: var(--blue); font-weight: 800; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.setup-guide ol { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.primary:disabled { cursor: not-allowed; opacity: .58; transform: none; }
footer { min-height: 80px; display: flex; justify-content: space-between; gap: 20px; align-items: center; border-top: 1px solid #dbe1eb; color: #7a8496; font-size: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 820px) {
  .shell { width: min(100% - 28px, 620px); }
  .hero { grid-template-columns: 1fr; gap: 44px; padding: 36px 0 64px; }
  .portal-grid { grid-template-columns: 1fr; }
  h1 { font-size: clamp(42px, 13vw, 64px); }
  .panel { min-height: 440px; }
}
@media (max-width: 480px) {
  .brand { height: 70px; }
  .brand > span:not(.divider), .divider { display: none; }
  .header-nav { gap: 2px; }
  .hero { padding-top: 24px; }
  .panel { padding: 28px 20px; border-radius: 20px; }
  .code-row { flex-direction: column; }
  .copy { min-height: 42px; }
  .portal { padding: 45px 0 70px; }
  .portal-grid { margin-top: 32px; }
  .portal-card { min-height: 220px; padding: 24px; }
  .status-row { grid-template-columns: 1fr; gap: 7px; padding: 19px 20px; }
  .entra-setup { padding: 24px 20px; }
  .setup-grid, .setup-actions { grid-template-columns: 1fr; }
  .setup-grid { gap: 8px; }
  .setup-grid input, .setup-grid select { margin-bottom: 8px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
