:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #061322;
  --muted: #5a6980;
  --line: #dce3ee;
  --blue: #1688ff;
  --violet: #6d5dfc;
  --gold: #ffc857;
  --green: #16a765;
  --red: #d83a52;
  --dark: #07111f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 244px; background: #07111f; color: white; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--blue), var(--violet)); font-size: 12px; }
.nav { display: grid; gap: 6px; }
.nav a, .nav-button { display: block; width: 100%; border: 0; border-radius: 8px; padding: 10px 12px; background: transparent; color: #c8d4e6; text-align: left; font: inherit; cursor: pointer; }
.nav a:hover, .nav-button:hover { background: rgba(255,255,255,.08); color: white; }
.main { flex: 1; padding: 28px; max-width: 1280px; margin: 0 auto; width: 100%; }
.main-public { display: grid; align-items: center; max-width: 760px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.eyebrow { color: var(--violet); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; font-size: 12px; }
h1 { margin: 6px 0 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.05; }
h2 { margin: 0 0 14px; font-size: 22px; }
p { color: var(--muted); line-height: 1.55; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: 0 18px 48px rgba(13, 35, 67, .07); }
.stat { font-size: 34px; font-weight: 900; margin-top: 6px; }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; background: #f9fbff; }
.table tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700; background: #edf4ff; color: #135fb8; }
.badge-green { background: #e8f8ef; color: #11784b; }
.badge-red { background: #fdebee; color: #b1223a; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
label { font-weight: 700; font-size: 14px; }
input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font: inherit; background: white; color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 8px; padding: 11px 14px; background: var(--gold); color: #04101f; font-weight: 900; cursor: pointer; }
.btn-secondary { background: #edf4ff; color: #124d91; }
.btn-danger { background: #ffe9ed; color: #a71f34; }
.flash { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; font-weight: 700; }
.flash-notice { background: #e8f8ef; color: #11784b; }
.flash-alert { background: #fdebee; color: #b1223a; }
.code-box { border: 1px solid var(--line); background: #f9fbff; border-radius: 8px; padding: 12px; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.detail-list { display: grid; gap: 10px; }
.detail-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.detail-row strong { color: var(--muted); }
@media (max-width: 900px) { .app-shell { display: block; } .sidebar { position: relative; width: auto; height: auto; } .grid-4, .grid-2 { grid-template-columns: 1fr; } .page-head { display: block; } .detail-row { grid-template-columns: 1fr; } }

.mfa-card { max-width: 900px; }
.mfa-setup-grid { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 22px; align-items: center; margin: 18px 0 18px; }
.qr-panel { display: grid; place-items: center; background: #ffffff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; box-shadow: inset 0 0 0 8px #f8fbff; overflow: visible; }
.qr-panel svg { width: min(100%, 300px); height: auto; display: block; flex: none; }
.mfa-steps { display: grid; gap: 14px; }
.mfa-steps ol { margin: 0; padding-left: 22px; color: var(--ink); line-height: 1.65; }
.mfa-steps li::marker { color: var(--violet); font-weight: 900; }
.manual-secret { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #f9fbff; }
.manual-secret summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.manual-secret p { margin: 10px 0 8px; }
@media (max-width: 720px) { .mfa-setup-grid { grid-template-columns: 1fr; } .qr-panel svg { width: min(100%, 280px); } }


.brand-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; box-shadow: 0 8px 22px rgba(22, 136, 255, .22); }
.login-card { overflow: hidden; }
.login-logo { display: block; width: min(300px, 78%); height: auto; margin: 0 auto 22px; border-radius: 8px; background: transparent; filter: drop-shadow(0 10px 18px rgba(7, 17, 31, .10)); }
.login-card .eyebrow,
.login-card h1,
.login-card > p,
.public-card .eyebrow,
.public-card h1,
.public-card > p,
.checkout-card .stat { text-align: center; }
.public-card .form { margin-top: 18px; }
.checkout-card .stat { margin-bottom: 10px; }
@media (max-width: 720px) { .login-logo { width: min(250px, 86%); } }

.table-tools { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin: 0 0 14px; flex-wrap: wrap; }
.table-search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.input, select.input { width: auto; min-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; background: #fff; color: var(--ink); }
.input-small { min-width: 90px; }
.pagination-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.compact-head { margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 14px; }
.auth-card { max-width: 760px; margin: 0 auto; }
@media (max-width: 720px) { .table-tools, .table-search, .actions { display: grid; width: 100%; } .input, select.input { width: 100%; min-width: 0; } }

.check-row { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; color: var(--ink); font-weight: 600; line-height: 1.5; }
.check-row input { width: 18px; height: 18px; margin-top: 3px; }
.check-row a { color: #145fc2; text-decoration: underline; text-underline-offset: 2px; }
.legal-page { max-width: 900px; margin: 0 auto; }
.legal-page ul { margin: 0 0 18px; padding-left: 22px; color: var(--muted); line-height: 1.7; }
.checklist { display: grid; gap: 12px; }
.check-item { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.check-item:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline-list { display: grid; gap: 12px; }
.timeline-item { display: grid; gap: 10px; border-left: 3px solid #c8d9f5; padding: 0 0 12px 14px; }
.timeline-item .code-box { margin: 0; white-space: pre-wrap; font-size: 12px; }

.version-list {
  display: grid;
  gap: 16px;
}

.version-card {
  border: 1px solid #d9e2ef;
  border-radius: 12px;
  padding: 18px;
  background: #fff;
}

.release-notes {
  margin-top: 14px;
  color: #334155;
  line-height: 1.65;
}

.small-code {
  font-size: 12px;
  word-break: break-all;
}

.form-grid .span-2,
.form-actions.span-2 {
  grid-column: 1 / -1;
}

.btn-ghost {
  background: #f8fbff;
  color: #31435d;
  border: 1px solid var(--line);
}

.portal-hero {
  animation: portal-rise .45s ease-out both;
}

.license-card {
  position: relative;
  overflow: hidden;
}

.license-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(22, 136, 255, .08), transparent 34%, rgba(255, 200, 87, .08));
  opacity: .55;
}

.license-card > * {
  position: relative;
}

.license-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .01em;
}

.license-actions {
  justify-content: flex-end;
}

.license-key-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(22, 136, 255, .22);
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
  border-radius: 12px;
  padding: 14px;
  margin: 14px 0 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8);
}

.license-key-panel.is-revealed {
  animation: license-reveal .34s ease-out both;
}

.license-key-label,
.license-copy-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.license-key-panel code {
  color: #05101f;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 900;
  word-break: break-all;
}

.btn.copied {
  animation: copied-pulse .75s ease-out;
}

.table-wrap {
  overflow-x: auto;
}

.mini-history {
  margin-top: 18px;
}

@keyframes portal-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes license-reveal {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes copied-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(22, 167, 101, .4);
  }
  55% {
    transform: scale(1.03);
    box-shadow: 0 0 0 10px rgba(22, 167, 101, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

@media (max-width: 720px) {
  .license-actions {
    justify-content: stretch;
  }

  .license-actions .btn,
  .license-actions form,
  .license-actions form .btn {
    width: 100%;
  }
}

.license-code-row {
  display: grid;
  gap: 6px;
}

.license-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 6px 4px 0;
  border-radius: 10px;
  transition: background .22s ease, color .22s ease, transform .22s ease;
}

.license-code span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.license-code.is-revealed {
  animation: license-inline-reveal .32s ease-out both;
  background: rgba(22, 136, 255, .08);
}

.license-copy-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(22, 136, 255, .22);
  border-radius: 9px;
  background: #eef6ff;
  color: #124d91;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.license-copy-icon:hover {
  transform: translateY(-1px);
  background: #ddecff;
}

.license-copy-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.license-copy-icon.copied {
  color: #0f7a4a;
  background: #e8f8ef;
  animation: copied-pulse .75s ease-out;
}

.license-copy-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sidebar-logo { display: block; width: 172px; max-width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 0 18px rgba(22, 136, 255, .28)); }
.sidebar .brand { min-height: 44px; }
@media (max-width: 900px) { .sidebar-logo { width: 164px; } }

@keyframes license-inline-reveal {
  from {
    opacity: .62;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ScreenDeck Pro client portal motion layer */
@media (prefers-reduced-motion: no-preference) {
  .sidebar {
    animation: sidebar-slide-in .42s cubic-bezier(.2, .8, .2, 1) both;
  }

  .brand-logo {
    animation: brand-glow-in .56s ease-out .08s both;
  }

  .main > .card {
    animation: portal-card-in .52s cubic-bezier(.2, .8, .2, 1) both;
    transform-origin: top center;
  }

  .main > .card:nth-of-type(1) { animation-delay: .03s; }
  .main > .card:nth-of-type(2) { animation-delay: .10s; }
  .main > .card:nth-of-type(3) { animation-delay: .17s; }
  .main > .card:nth-of-type(4) { animation-delay: .24s; }

  .version-card {
    animation: portal-card-in .46s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: .22s;
  }
}

.sidebar {
  box-shadow: 18px 0 48px rgba(7, 17, 31, .12);
}

.nav a,
.nav-button,
.btn,
.version-card,
.license-card,
.detail-row,
.license-copy-icon {
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    background-color .2s ease,
    border-color .2s ease,
    color .2s ease;
}

.nav a:hover,
.nav-button:hover {
  transform: translateX(3px);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(13, 35, 67, .10);
}

.btn:active,
.license-copy-icon:active {
  transform: translateY(0) scale(.98);
}

.card {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.license-card:hover,
.version-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 136, 255, .28);
  box-shadow: 0 24px 58px rgba(13, 35, 67, .10);
}

.license-card::before {
  background:
    linear-gradient(115deg, rgba(22, 136, 255, .10), transparent 34%, rgba(255, 200, 87, .10)),
    radial-gradient(circle at var(--shine-x, 18%) 0%, rgba(255,255,255,.55), transparent 14rem);
  opacity: .52;
  transition: opacity .22s ease;
}

.license-card:hover::before {
  opacity: .82;
}

.detail-row:hover {
  background: rgba(22, 136, 255, .035);
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
}

.license-code {
  position: relative;
}

.license-code.is-revealed {
  background: linear-gradient(135deg, rgba(22, 136, 255, .10), rgba(255, 200, 87, .12));
  box-shadow: inset 0 0 0 1px rgba(22, 136, 255, .16);
}

.license-code.is-revealed span {
  animation: key-text-pop .28s ease-out both;
}

.license-copy-icon {
  box-shadow: 0 8px 18px rgba(18, 77, 145, .08);
}

.license-copy-icon:hover {
  box-shadow: 0 12px 24px rgba(18, 77, 145, .14);
}

.license-copy-icon.copied svg {
  animation: copy-check-bounce .42s ease-out both;
}

.license-copy-state:not([hidden]) {
  animation: state-fade-in .22s ease-out both;
}

.version-card {
  overflow: hidden;
  position: relative;
}

.version-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0%, rgba(22, 136, 255, .08) 42%, transparent 72%);
  opacity: 0;
  transform: translateX(-28%);
  transition: opacity .25s ease, transform .35s ease;
}

.version-card:hover::after {
  opacity: 1;
  transform: translateX(18%);
}

@keyframes portal-card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.985);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes sidebar-slide-in {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes brand-glow-in {
  from {
    opacity: 0;
    transform: scale(.92);
    box-shadow: 0 0 0 rgba(22, 136, 255, 0);
  }
  to {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 8px 22px rgba(22, 136, 255, .22);
  }
}

@keyframes key-text-pop {
  from {
    opacity: .5;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes copy-check-bounce {
  0% { transform: scale(.82) rotate(-5deg); }
  55% { transform: scale(1.12) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes state-fade-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .brand-logo,
  .main > .card,
  .version-card,
  .license-code.is-revealed,
  .license-code.is-revealed span,
  .license-copy-icon.copied,
  .license-copy-icon.copied svg,
  .license-copy-state:not([hidden]) {
    animation: none !important;
  }

  .nav a:hover,
  .nav-button:hover,
  .btn:hover,
  .license-card:hover,
  .version-card:hover,
  .detail-row:hover {
    transform: none !important;
  }
}
/* ScreenDeck Pro transparent sidebar logo for dark backgrounds */
@media (prefers-reduced-motion: no-preference) {
  .sidebar-logo {
    animation: brand-glow-in .56s ease-out .08s both;
  }
}
