/* Demo portal — same tokens as linshare.app (src/app/globals.css). */
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* neutral-500 is darker than linshare.app (#6b7f96, 4.1:1 on white): small text needs 4.5:1 */
:root {
  --primary-50: #f0f4ff; --primary-100: #dbe4ff; --primary-200: #b4c6ff; --primary-300: #7da3ff;
  --primary-500: #1f5bff; --primary-600: #1a4edb; --primary-700: #152d8a; --primary-900: #0e1a2e;
  --accent-400: #00d4ff; --accent-500: #00b8d9; --accent-700: #007a91;
  --neutral-50: #f7fafd; --neutral-100: #eef3f8; --neutral-200: #dce4ed; --neutral-300: #b8c5d4;
  --neutral-400: #8a9bb2; --neutral-500: #52657a; --neutral-600: #3d5068; --neutral-700: #2a3a50;
  --surface-dark: #060d1b;
  --shadow-sm: 0 1px 3px rgba(6, 13, 27, 0.06);
  --shadow-md: 0 4px 16px rgba(6, 13, 27, 0.08);
  --shadow-lg: 0 12px 40px rgba(6, 13, 27, 0.12);
  --shadow-xl: 0 24px 64px rgba(6, 13, 27, 0.16);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: "Satoshi", system-ui, sans-serif; color: var(--primary-900); background: #fff;
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(31, 91, 255, 0.15); color: var(--primary-900); }
a { color: var(--primary-600); }
a:hover { color: var(--primary-700); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
code, .mono { font-family: var(--mono); }
img { max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 12px 18px; border-radius: 0 0 12px 12px; background: var(--primary-600); color: #fff; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 0; color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bg-grid {
  background-image: linear-gradient(to right, rgba(31, 91, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31, 91, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(24px); border-bottom: 1px solid rgba(238, 243, 248, 0.8); }
.site-header .container { min-height: 72px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; }
.logo img { height: 32px; width: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { padding: 8px 14px; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--neutral-600); text-decoration: none; }
.nav a:hover { color: var(--primary-700); background: var(--primary-50); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 10px; border: 0; background: transparent; color: var(--primary-900); cursor: pointer; align-items: center; justify-content: center; }
.menu-btn:hover { background: var(--primary-50); }
.nav-compact { display: none; }
/* Below 900px: logo, call to action and a menu button on one row; the links open below */
@media (max-width: 899px) {
  .site-header .container { position: relative; min-height: 64px; flex-wrap: nowrap; }
  .menu-btn { display: inline-flex; }
  .header-actions .btn-ghost { display: none; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; padding: 8px 16px 16px; background: #fff; border-bottom: 1px solid var(--neutral-100); box-shadow: var(--shadow-md); }
  .site-header.open .nav { display: flex; }
  .nav a { padding: 12px 14px; }
  .nav .nav-compact { display: block; }
  .header-actions .btn { white-space: nowrap; }
  .tiles { max-width: none; }
}
@media (max-width: 420px) {
  .logo img { height: 28px; }
  .header-actions .btn-sm { padding: 8px 12px; }
}

/* Buttons (linshare.app Button.tsx) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 0; transition: all 0.2s; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-md { padding: 12px 24px; font-size: 16px; }
.btn-lg { padding: 16px 32px; font-size: 18px; }
.btn-primary { background: var(--primary-600); color: #fff; box-shadow: 0 10px 15px -3px rgba(26, 78, 219, 0.2); }
.btn-primary:hover { background: var(--primary-700); color: #fff; }
.btn-secondary { background: #fff; color: var(--primary-900); border: 1px solid var(--neutral-200); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--primary-300); background: var(--primary-50); color: var(--primary-900); }
.btn-ghost { background: transparent; color: var(--primary-600); }
.btn-ghost:hover { background: var(--primary-50); }
.btn-accent { background: var(--accent-400); color: var(--primary-900); }
.btn-accent:hover { background: #33dfff; color: var(--primary-900); }
.btn-glass { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.btn[disabled] { background: var(--neutral-200); color: var(--neutral-500); box-shadow: none; cursor: not-allowed; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.025em; text-transform: uppercase; }
.badge-accent { background: rgba(0, 184, 217, 0.1); color: var(--accent-700); border: 1px solid rgba(0, 184, 217, 0.2); }
.badge-primary { background: var(--primary-50); color: var(--primary-700); border: 1px solid var(--primary-100); }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: linear-gradient(180deg, var(--neutral-50) 0%, var(--primary-50) 50%, rgba(0, 212, 255, 0.03) 100%); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.eyebrow { margin: 0 0 12px; font-size: 14px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary-500); }
.section-head h2 { margin: 0; font-weight: 700; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.15; letter-spacing: -0.025em; }
.section-head p { margin: 16px 0 0; color: var(--neutral-600); }

/* Hero */
/* The hero fills the first screen, below the 73px header: the next section starts after a scroll */
.hero { position: relative; overflow: hidden; padding: 32px 0 48px; display: flex; align-items: center; min-height: calc(100vh - 73px); min-height: calc(100svh - 73px); }
.hero > .container { width: 100%; }
.ways { flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.way { position: relative; overflow: hidden; display: flex; gap: 18px; padding: 24px 28px; border-radius: 16px; }
.way h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.hero .way p { margin: 6px 0 12px; font-size: 15px; line-height: 1.55; }
.way-tag { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
/* Shared demo: light, cyan accent */
.way-shared { background: linear-gradient(135deg, rgba(0, 212, 255, 0.10), rgba(255, 255, 255, 0.9) 60%); border: 1px solid rgba(0, 184, 217, 0.28); }
.way-shared .icon-box { background: rgba(0, 184, 217, 0.14); color: var(--accent-700); }
.way-shared .way-tag { background: rgba(0, 184, 217, 0.14); color: var(--accent-700); }
.way-shared .text-link { color: var(--accent-700); }
/* Trial tenant: the brand blue of the call-to-action band */
.way-tenant { background: linear-gradient(135deg, var(--primary-600), var(--primary-700)); color: #fff; box-shadow: 0 16px 32px -12px rgba(26, 78, 219, 0.45); }
.way-tenant::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 212, 255, 0.35), transparent 70%); pointer-events: none; }
.way-tenant .icon-box { background: rgba(255, 255, 255, 0.14); color: #fff; }
.way-tenant .way-tag { background: rgba(255, 255, 255, 0.16); color: #fff; }
.way-tenant h2 { color: #fff; }
.hero .way-tenant p { color: var(--primary-100); }
.way-tenant .text-link { color: #fff; }
.way-tenant .text-link:hover { color: var(--accent-400); }
.text-link svg { vertical-align: -3px; }
.scroll-hint { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--neutral-500); text-decoration: none; white-space: nowrap; }
.scroll-hint svg { transform: rotate(90deg); }
.scroll-hint:hover { color: var(--primary-600); }
@media (max-width: 640px), (max-height: 800px) { .scroll-hint { display: none; } }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom right, var(--primary-50), #fff, rgba(0, 184, 217, 0.05)); }
.hero .glow { position: absolute; border-radius: 50%; filter: blur(64px); }
.hero .container { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 56px 48px; }
.hero-text { flex: 1 1 460px; min-width: 0; }
.hero h1 { margin: 20px 0 0; font-weight: 800; font-size: clamp(40px, 4.6vw, 58px); line-height: 1.05; letter-spacing: -0.025em; }
.hero p { margin: 20px 0 0; font-size: 19px; color: var(--neutral-600); }
.hero .actions { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
/* Short reassurances under the call to action */
.hero-trust { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; font-weight: 500; color: var(--neutral-600); }
.hero-trust li { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust svg { flex: none; color: #15803d; }
/* Direct access to the demo applications, beside the title */
.tiles { flex: 1 1 520px; min-width: 0; max-width: 620px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.tile { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 12px; padding: 20px 22px; border-radius: 16px; border: 1px solid rgba(220, 228, 237, 0.8); background: #fff; color: var(--primary-900); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { color: var(--primary-900); border-color: var(--primary-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tile .icon-box { width: 40px; height: 40px; border-radius: 10px; }
.tile .icon-box svg { width: 20px; height: 20px; }
/* icon and title on one row, description and address below at full width */
.tile-body { display: contents; }
.tile-line, .tile-host { grid-column: 1 / -1; }
/* One light hue per application, set by --tile (r, g, b) */
.tile { --tile: 26, 78, 219; background: linear-gradient(160deg, rgba(var(--tile), 0.14), rgba(var(--tile), 0.03) 80%), #fff; border-color: rgba(var(--tile), 0.35); }
.tile .icon-box { background: rgba(var(--tile), 0.18); color: rgb(var(--tile)); }
.tile:hover { border-color: rgba(var(--tile), 0.65); box-shadow: 0 12px 24px -12px rgba(var(--tile), 0.35); }
.tile:hover .icon-box { background: rgb(var(--tile)); color: #fff; }
.tile:hover .tile-go { color: rgb(var(--tile)); }
.tile-admin { --tile: 109, 40, 217; }
.tile-webmail { --tile: 0, 122, 145; }
.tile-upload { --tile: 180, 83, 9; }
.tile-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 17px; white-space: nowrap; }
.tile-go { color: var(--neutral-300); }
.tile-line { font-size: 15px; line-height: 1.45; color: var(--neutral-600); }
.tile-host { margin-top: -4px; font-family: var(--mono); font-size: 13px; color: var(--neutral-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Phones: a compact 2 x 2 grid, icon above the title, without the address */
@media (max-width: 640px) {
  .tiles { gap: 12px; }
  .tile { grid-template-columns: 1fr; align-content: start; gap: 8px; padding: 14px; }
  .tile-title { white-space: normal; font-size: 15px; line-height: 1.3; }
  .tile-line { font-size: 13px; }
  .tile-host, .tile-go { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tile, .tile:hover { transition: none; transform: none; } }
.text-link { font-size: 15px; font-weight: 500; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* Cards */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { position: relative; overflow: hidden; padding: 28px; border-radius: 16px; border: 1px solid rgba(220, 228, 237, 0.8); background: #fff; }
.card.highlight { border-color: var(--primary-200); box-shadow: var(--shadow-md); }
.card .bar { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--neutral-200); }
.card.highlight .bar { background: linear-gradient(to right, var(--primary-500), var(--accent-500)); }
.card h3 { margin: 0 0 8px; font-weight: 600; font-size: 18px; }
.card p { margin: 0; font-size: 14px; color: var(--neutral-600); }
.icon-box { width: 48px; height: 48px; border-radius: 12px; background: var(--primary-50); color: var(--primary-500); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-box.solid { background: var(--primary-600); color: #fff; box-shadow: 0 10px 15px -3px rgba(26, 78, 219, 0.2); }
.icon-box svg { width: 24px; height: 24px; }
.checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--neutral-700); }
.checks li { display: flex; gap: 10px; }
.checks svg { flex-shrink: 0; margin-top: 3px; color: var(--accent-500); }
.checks li.off { color: var(--neutral-500); }
.checks li.off svg { color: var(--neutral-300); }
.choice { display: flex; flex-direction: column; gap: 20px; padding: 32px; }
.choice h3 { font-size: 22px; font-weight: 700; margin: 0; }
.choice .btn { margin-top: auto; align-self: flex-start; }

/* Credentials */
.cred { display: flex; flex-direction: column; gap: 10px; }
.field-box { border-radius: 12px; background: var(--neutral-50); border: 1px solid var(--neutral-100); padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-box .label { display: block; font-size: 11px; font-weight: 600; color: var(--neutral-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.field-box code { display: block; font-size: 14px; color: var(--primary-700); overflow-wrap: anywhere; }
.copy { flex-shrink: 0; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--neutral-200); background: #fff; color: var(--primary-600); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.copy:hover { border-color: var(--primary-300); }
.person { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.person h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.person span { font-size: 12px; color: var(--neutral-500); }
.note { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border-radius: 12px; font-size: 14px; }
.note svg { flex-shrink: 0; margin-top: 2px; }
.note p { margin: 0; }
.note-amber { background: #fffbeb; border: 1px solid rgba(253, 230, 138, 0.7); color: #92400e; }
.note-amber svg { color: #f59e0b; }
.note-cyan { background: rgba(0, 184, 217, 0.06); border: 1px solid rgba(0, 184, 217, 0.2); color: var(--accent-700); }
.list-accounts { margin: 0; padding: 0; list-style: none; }
.list-accounts li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--neutral-100); font-family: var(--mono); font-size: 14px; }
.list-accounts li:last-child { border-bottom: 0; }
.list-accounts code:first-child { color: var(--primary-700); }
.list-accounts code:last-child { color: var(--neutral-500); }

/* Steps & roles */
.step-num { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-50); color: var(--primary-600); display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 20px; }
.role { display: flex; flex-direction: column; gap: 16px; }
.role-head { display: flex; align-items: center; gap: 12px; }
.role-head h3 { margin: 0; font-size: 19px; }
.role-head a, .role-head div > span { font-family: var(--mono); font-size: 13px; text-decoration: none; }
.role-head div > span { color: var(--neutral-500); }
.role ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.role li { display: flex; gap: 12px; font-size: 14px; color: var(--neutral-700); counter-increment: s; }
.role li::before { content: counter(s); width: 24px; height: 24px; flex-shrink: 0; border-radius: 8px; background: var(--primary-50); color: var(--primary-600); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.config-card { display: flex; gap: 16px; align-items: flex-start; padding: 24px; transition: all 0.3s; }
.config-card:hover { border-color: var(--primary-200); box-shadow: var(--shadow-lg); }
.config-card .icon-box { width: 44px; height: 44px; }
.config-card .icon-box svg { width: 22px; height: 22px; }
.test-card .icon-box { margin-bottom: 20px; }
.more-btn { display: none; }
/* Phones: shorter sections, long lists folded after three cards */
@media (max-width: 640px) {
  .section { padding: 48px 0; }
  .section-head { margin-bottom: 28px; }
  .card { padding: 20px; }
  .hero { min-height: 0; padding: 28px 0 40px; }
  .hero .container { gap: 32px; }
  .hero p { font-size: 17px; }
  .step-card, .test-card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: start; }
  .step-card > :not(:first-child), .test-card > :not(:first-child) { grid-column: 2; }
  .step-card .step-num, .test-card .icon-box { grid-row: 1 / span 3; margin: 0; width: 40px; height: 40px; }
  .test-card .icon-box svg { width: 20px; height: 20px; }
  .step-card h3, .test-card h3 { font-size: 17px; }
  .collapsible:not(.open) > :nth-child(n+4), .collapsible.show-1:not(.open) > :nth-child(n+2),
  .collapsible.show-0:not(.open) { display: none; }
  .hero .way p { display: none; }
  .hero .way h2 { margin-bottom: 8px; font-size: 17px; }
  .way { padding: 18px 20px; }
  .more-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-top: 16px; border-radius: 12px; border: 1px solid var(--neutral-200); background: #fff; color: var(--primary-600); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
  .more-btn:hover { border-color: var(--primary-300); background: var(--primary-50); }
  .cta { padding: 64px 0; }
}
.who { margin-top: 14px !important; font-size: 13px !important; font-weight: 600; color: var(--primary-600) !important; }

/* CTA */
.cta { position: relative; overflow: hidden; padding: 112px 0; text-align: center; color: #fff; }
.cta::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom right, var(--primary-600), var(--primary-700), var(--primary-900)); }
.cta .container { position: relative; }
.cta h2 { margin: 0; font-weight: 700; font-size: clamp(30px, 3.4vw, 48px); letter-spacing: -0.025em; }
.cta p { margin: 20px auto 0; max-width: 576px; font-size: 18px; color: var(--primary-100); }
.cta .actions { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.trust { margin-top: 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; font-size: 14px; color: var(--primary-200); }
.trust span { display: flex; align-items: center; gap: 8px; }
.trust svg { color: var(--accent-400); }

/* Footer */
.site-footer { background: var(--surface-dark); color: var(--neutral-400); font-size: 14px; }
.site-footer .container { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-footer p { margin: 0; }
.site-footer p:first-child { flex: 999 1 480px; }
.site-footer a { color: var(--neutral-200); }

/* Wizard */
.wizard-page { position: relative; min-height: 100vh; overflow: hidden; }
.wizard-page::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(ellipse 80% 60% at 20% 80%, rgba(31, 91, 255, 0.12) 0%, transparent 60%),
  radial-gradient(ellipse 60% 50% at 80% 20%, rgba(0, 212, 255, 0.08) 0%, transparent 60%),
  linear-gradient(170deg, #fff 0%, var(--neutral-50) 40%, #e8f0fe 100%); }
.wizard-page > * { position: relative; }
.wizard { max-width: 1080px; margin: 0 auto; padding: 48px 32px 96px; }
.wizard-title { text-align: center; max-width: 640px; margin: 0 auto; }
.wizard-title h1 { margin: 16px 0 0; font-weight: 800; font-size: clamp(32px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -0.025em; }
.stepper { margin: 36px auto 0; padding: 0; list-style: none; max-width: 760px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 0; }
.stepper li { display: flex; align-items: center; }
.stepper .s { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-size: 14px; font-weight: 500; color: var(--neutral-500); }
.stepper .dot { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: #fff; color: var(--neutral-500); border: 1px solid var(--neutral-200); }
.stepper li.current .s { color: var(--primary-900); font-weight: 700; }
.stepper li.current .dot { color: var(--primary-600); border: 2px solid var(--primary-600); box-shadow: 0 0 0 4px rgba(31, 91, 255, 0.12); }
.stepper li.done .dot { background: var(--primary-600); color: #fff; border-color: var(--primary-600); }
.stepper .line { display: inline-block; width: 32px; height: 2px; border-radius: 1px; background: var(--neutral-200); }
.stepper li.done .line { background: var(--primary-600); }
.wizard-body { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; justify-content: center; }
.wizard-card { flex: 999 1 560px; min-width: 0; max-width: 680px; position: relative; overflow: hidden; border-radius: 16px; border: 1px solid rgba(220, 228, 237, 0.8); background: #fff; box-shadow: 0 24px 64px rgba(6, 13, 27, 0.1); }
.wizard-card .bar { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(to right, var(--primary-500), var(--accent-500)); }
.wizard-card form, .wizard-card .panel { padding: 36px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 640px) { .wizard { padding: 32px 16px 64px; } .wizard-card form, .wizard-card .panel { padding: 24px; } }
.wizard-card h2, .confirm-title { margin: 0; font-weight: 700; font-size: 24px; letter-spacing: -0.02em; }
/* Page of the link an external contact receives: one card */
.confirm-page { max-width: 680px; }
.confirm-page p { margin: 0; }
.confirm-title:focus { outline: none; }
.wizard-card .lead { margin: 6px 0 0; font-size: 15px; color: var(--neutral-600); }
.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--neutral-700); }
.field { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--neutral-200); background: #fff; font: inherit; font-size: 16px; font-weight: 500; color: var(--primary-900); transition: all 0.2s; width: 100%; }
.field:focus { outline: none; border-color: #4a7dff; box-shadow: 0 0 0 4px rgba(31, 91, 255, 0.12); }
.field::placeholder, .ext-input input::placeholder { color: var(--neutral-500); opacity: 1; }
/* Errors next to their field */
.field[aria-invalid="true"], .ext-input:has([aria-invalid="true"]) { border-color: #dc2626; }
.field[aria-invalid="true"]:focus, .ext-input:has([aria-invalid="true"]):focus-within { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15); }
.consent:has([aria-invalid="true"]) { border-color: #fca5a5; background: #fef2f2; }
.field-error { margin: -10px 0 0; font-size: 14px; font-weight: 500; color: #b91c1c; }
.account-row .field-error, .ext-row .field-error { margin: 8px 0 0; flex-basis: 100%; }
.lbl .field-error { display: block; margin: 0; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--primary-600); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn[disabled] { color: var(--neutral-500); cursor: default; text-decoration: none; }
.code-field { width: 220px; max-width: 100%; min-height: 60px; font-family: var(--mono); font-size: 26px; letter-spacing: 0.35em; text-align: center; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--neutral-50); border: 1px solid var(--neutral-100); font-size: 14px; color: var(--neutral-700); }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--primary-600); }
.actions-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.actions-row.end { justify-content: flex-end; }
.error { display: none; padding: 12px 14px; border-radius: 12px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-size: 14px; }
.error.show { display: block; }
.address-choice { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.address-choice legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; color: var(--neutral-700); }
.address-opt { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px solid var(--neutral-200); background: #fff; cursor: pointer; }
.address-opt:has(input:checked) { border-color: var(--primary-500); background: var(--primary-50); }
.address-opt input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary-600); flex-shrink: 0; }
.address-opt strong { display: block; font-size: 15px; color: var(--primary-900); }
.address-opt span span { display: block; margin-top: 2px; font-size: 13px; color: var(--neutral-600); }
.account-row .ext-input { margin-top: 10px; }
.account-row { padding: 14px; border-radius: 12px; background: var(--neutral-50); border: 1px solid var(--neutral-100); }
.creator-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 14px; border-radius: 12px; background: var(--primary-50); border: 1px solid var(--primary-200); }
.creator-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.creator-who code { font-size: 13px; color: var(--primary-700); overflow-wrap: anywhere; }
.hint-text { margin: 0; font-size: 14px; color: var(--neutral-600); }
.account-row .address-kind { font-size: 13px; color: var(--neutral-500); }
.account-row .inputs { display: flex; flex-wrap: wrap; gap: 10px; }
.account-row .inputs .field { flex: 1 1 140px; min-width: 0; width: auto; }
.account-row .meta { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.account-row .meta code { font-size: 13px; color: var(--primary-700); }
.radio { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; font-weight: 600; color: var(--neutral-700); cursor: pointer; }
.radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary-600); }
.icon-btn { width: 48px; height: 48px; border-radius: 12px; border: 0; background: transparent; color: var(--neutral-500); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--neutral-100); color: var(--primary-900); }
.add-btn { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 8px 14px; border-radius: 12px; border: 0; background: transparent; color: var(--primary-600); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.add-btn:hover { background: var(--primary-50); }
.ext-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--neutral-100); background: var(--neutral-50); }
.ext-input { flex: 1 1 240px; min-width: 0; display: flex; align-items: stretch; border-radius: 12px; border: 1px solid var(--neutral-200); background: #fff; overflow: hidden; }
.ext-input input { flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 0 12px; border: 0; font-family: var(--mono); font-size: 14px; color: var(--primary-900); }
.ext-input input:focus { outline: none; }
.ext-input:focus-within { border-color: #4a7dff; box-shadow: 0 0 0 4px rgba(31, 91, 255, 0.12); }
.ext-input span { display: flex; align-items: center; padding: 0 12px; border-left: 1px solid var(--neutral-100); font-family: var(--mono); font-size: 13px; color: var(--neutral-500); }
.wizard-meta { margin: 10px 0 0; font-size: 15px; color: var(--neutral-600); }
/* Creation in progress: one line per server step */
.progress-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.progress-steps li { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 15px; color: var(--neutral-500); }
.progress-steps li::before { content: ""; width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--neutral-200); box-sizing: border-box; }
.progress-steps li.active { color: var(--primary-900); font-weight: 600; }
.progress-steps li.active::before { border-color: var(--primary-100); border-top-color: var(--primary-600); animation: spin 0.8s linear infinite; }
.progress-steps li.done { color: var(--neutral-700); }
.progress-steps li.done::before { border: 0; background: var(--primary-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat; }
@media (prefers-reduced-motion: reduce) { .progress-steps li.active::before { animation-duration: 2s; } }
.summary-head { display: flex; align-items: center; gap: 12px; }
.summary-toggle { display: none; }
.summary { flex: 1 1 280px; min-width: 0; max-width: 340px; display: flex; flex-direction: column; gap: 16px; }
.summary .card { padding: 24px; background: rgba(255, 255, 255, 0.9); }
.summary dl { margin: 20px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; }
.summary dt { color: var(--neutral-500); }
.summary dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
/* Phones: the summary sits above the form as one line that unfolds, from the tenant step on */
@media (max-width: 640px) {
  .summary { order: -1; max-width: none; flex-basis: 100%; }
  .summary .card { padding: 14px 16px; }
  .summary .note, .summary:not(.open) dl { display: none; }
  .summary .icon-box { display: none !important; }
  .summary-head > div:nth-child(2) { flex: 1 1 auto; }
  .summary-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px 0 8px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--primary-600); cursor: pointer; white-space: nowrap; }
  .summary-toggle svg { transform: rotate(-90deg); transition: transform 0.2s; }
  .summary.open .summary-toggle svg { transform: rotate(90deg); }
  /* stepper on one row: numbers, and the name of the current step only */
  .stepper { flex-wrap: nowrap; }
  .stepper li:not(.current) .s { font-size: 0; gap: 0; }
  .stepper .dot { font-size: 14px; }
  .stepper .line { width: 14px; }
  .wizard-page[data-step="0"] .summary, .wizard-page[data-step="1"] .summary, .wizard-page[data-step="5"] .summary { display: none; }
}
.result-table { width: 100%; min-width: 500px; border-collapse: collapse; font-size: 14px; }
.result-table th { padding: 10px 14px; text-align: left; background: var(--neutral-50); font-size: 11px; font-weight: 600; color: var(--neutral-500); text-transform: uppercase; letter-spacing: 0.05em; }
.result-table td { padding: 12px 14px; border-top: 1px solid var(--neutral-100); }
.result-table td:first-child code { color: var(--primary-700); }
.result-table td:last-child { white-space: nowrap; }
.result-table td:last-child .copy { margin-left: 8px; }
.result-table td:nth-child(2) { white-space: nowrap; }
/* Done: the summary has nothing left to say, the credentials get the whole width */
.wizard-page[data-step="5"] .summary { display: none; }
.wizard-page[data-step="5"] .wizard-card { max-width: 960px; }
.status-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-badge.pending { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.status-badge.failed { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.status-badge.own { background: var(--neutral-50); color: var(--neutral-600); border: 1px solid var(--neutral-100); }
.save-row { display: flex; flex-wrap: wrap; gap: 10px; }
.save-row .btn { min-height: 44px; }
/* Phones: one card per account instead of a wide table */
@media (max-width: 640px) {
  .table-wrap { border: 0; overflow: visible; }
  .result-table { min-width: 0; }
  .result-table, .result-table tbody { display: block; }
  .result-table tr:last-child { margin-bottom: 0; }
  .result-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .result-table tr { display: block; margin-bottom: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--neutral-100); background: var(--neutral-50); }
  .result-table td { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 4px 0; border: 0; }
  .result-table td[data-label]::before { content: attr(data-label); min-width: 96px; font-size: 12px; font-weight: 600; color: var(--neutral-500); text-transform: uppercase; letter-spacing: 0.05em; }
  .result-table td:first-child code { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
  .result-table td:last-child { white-space: normal; }
  .result-table td:last-child .copy { margin-left: auto; }
}
.table-wrap { border-radius: 12px; border: 1px solid var(--neutral-100); overflow-x: auto; }
[hidden] { display: none !important; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .spinner { animation-duration: 2s; } }
/* The creator's page: their tenant, its accounts, a danger zone */
.manage-page { max-width: 880px; }
.manage-page .wizard-card { max-width: none; }
.manage-head { display: flex; align-items: flex-start; gap: 14px; }
.manage-head .lead { margin-top: 4px; overflow-wrap: anywhere; }
.manage-logout { margin-left: auto; flex-shrink: 0; min-height: 44px; }
.manage-section { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px; border-radius: 12px; border: 1px solid var(--neutral-100); background: var(--neutral-50); }
.manage-section.column { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
.manage-section h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 700; color: var(--primary-900); }
.manage-section h2 svg { color: var(--primary-600); flex-shrink: 0; }
.manage-section p { margin: 4px 0 0; font-size: 14px; color: var(--neutral-600); }
.manage-section .table-wrap { background: #fff; }
.manage-table .btn-sm { min-height: 44px; }
.manage-table .new-password { font-family: var(--mono); font-size: 15px; color: var(--primary-900); }
.manage-table td:nth-child(3) { white-space: normal; min-width: 150px; }
.manage-table td:nth-child(3) .copy { margin: 4px 0 0; }
.manage-table .new-password { display: inline-block; margin-right: 8px; }
.manage-table td:last-child { text-align: right; }
.manage-table td:last-child { white-space: normal; }
.manage-table td:first-child code { overflow-wrap: break-word; }
.manage-table th:not(:first-child), .manage-table td:not(:first-child) { width: 1%; }
.manage-table .remove-confirm { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.manage-section.column > * { min-width: 0; }
.add-account .ext-input { flex: 0 0 auto; }
.manage-table .btn-danger-ghost, .manage-table .btn-danger { min-height: 44px; }
.add-account { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--neutral-100); }
.add-account h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--primary-900); }
.add-account .hint { font-weight: 400; color: var(--neutral-500); }
.add-account [hidden], .add-account[hidden] { display: none; }
.manage-table tr.just-added td { background: var(--primary-50); }
.danger-zone { background: #fff; border-color: #fecaca; }
.danger-zone h2, .danger-zone h2 svg { color: #991b1b; }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; color: #fff; }
.btn-danger-ghost { align-self: flex-start; background: #fff; color: #b91c1c; border: 1px solid #fecaca; }
.btn-danger-ghost:hover { background: #fef2f2; color: #991b1b; }
.wizard-card #delete-form { display: flex; flex-direction: column; gap: 14px; padding: 0; }
.wizard-card #add-form { padding: 18px 0 0; }
#delete-form[hidden] { display: none; }
@media (max-width: 640px) {
  .manage-head { flex-wrap: wrap; }
  .manage-logout { margin-left: 0; }
  .manage-section { padding: 16px; }
  .manage-section > .btn { width: 100%; }
  .manage-table td:last-child { text-align: left; }
  .manage-table td:not(:first-child) { width: auto; min-width: 0; }
  .manage-table td:last-child:empty { display: none; }
}
