/* ==========================================================================
   stickytape-id -- base stylesheet for every sign-in / account page.
   Themes (themes/<name>/theme.css) set the --st-* tokens below and may add a
   few extras; this file turns the tokens into the page. One card width, one
   input and button style, on every step.
   ========================================================================== */

:root {
  --st-font:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --st-heading-font: var(--st-font);
  --st-page-bg: #f4f4f5;
  --st-card-bg: #ffffff;
  --st-card-border: rgba(0, 0, 0, 0.08);
  --st-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.08);
  --st-card-blur: none;
  --st-card-width: 440px;
  --st-radius: 10px;
  --st-radius-lg: 18px;
  --st-text: #18181b;
  --st-muted: #71717a;
  --st-input-bg: #ffffff;
  --st-input-border: #d4d4d8;
  --st-accent: #2563eb;
  --st-accent-hover: #1d4ed8;
  --st-accent-contrast: #ffffff;
  --st-link: var(--st-accent);
  --st-focus-ring: rgba(37, 99, 235, 0.25);
  --st-footer-text: rgba(0, 0, 0, 0.55);
  --st-logo-height: 48px;
  --st-ok: #15803d;
  --st-bad: #b91c1c;
  --st-meter-0: #dc2626;
  --st-meter-1: #ea580c;
  --st-meter-2: #d97706;
  --st-meter-3: #16a34a;
  --st-meter-4: #15803d;
  --st-icon-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  --st-icon-eye-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 5.1A10.9 10.9 0 0 1 12 5c6.4 0 10 7 10 7a17.6 17.6 0 0 1-3.2 4.1M6.6 6.6C3.8 8.4 2 12 2 12s3.6 7 10 7a10.5 10.5 0 0 0 5.4-1.5'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable both-edges; /* taller steps don't shift the card sideways */
  /* Painted on the root so the reserved scrollbar gutters show the theme too. */
  background: var(--st-page-bg);
  background-attachment: fixed;
  min-height: 100%;
}

body.st-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 16px 32px;
  background: transparent;
  color: var(--st-text);
  font: 16px/1.5 var(--st-font);
  -webkit-font-smoothing: antialiased;
}

/* ---- card ---------------------------------------------------------------- */

.st-card {
  position: relative;
  width: min(var(--st-card-width), 100%);
  padding: 40px 44px 36px;
  background: var(--st-card-bg);
  border: 1px solid var(--st-card-border);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-card-shadow);
  backdrop-filter: var(--st-card-blur);
  -webkit-backdrop-filter: var(--st-card-blur);
}
.st-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.st-logo img {
  display: block;
  height: var(--st-logo-height);
  max-width: 100%;
}
.st-title {
  margin: 0 0 20px;
  font: 650 1.6rem/1.25 var(--st-heading-font);
  letter-spacing: -0.015em;
  color: var(--st-text);
}
.st-lead {
  margin: -8px 0 20px;
  color: var(--st-muted);
}
.st-card p {
  margin: 0 0 16px;
}
.st-card a,
.st-link {
  color: var(--st-link);
  text-decoration: none;
}
.st-card a:hover,
.st-link:hover {
  text-decoration: underline;
}

/* ---- forms ---------------------------------------------------------------- */

.st-form {
  display: grid;
  gap: 18px;
}
.st-field {
  display: grid;
  gap: 6px;
}
.st-label {
  font-size: 0.875rem;
  font-weight: 600;
}
.st-help {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--st-muted);
}
.st-input-wrap {
  position: relative;
}
.st-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--st-input-border);
  border-radius: var(--st-radius);
  background: var(--st-input-bg);
  color: var(--st-text);
  font: inherit;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}
.st-input-wrap > .st-input {
  padding-right: 48px;
}
.st-input::placeholder {
  color: var(--st-muted);
}
.st-input:focus,
.st-input:focus-visible {
  outline: none;
  border-color: var(--st-accent);
  box-shadow: 0 0 0 3px var(--st-focus-ring);
}
.st-input:-webkit-autofill {
  box-shadow: 0 0 0 1000px var(--st-input-bg) inset;
  -webkit-text-fill-color: var(--st-text);
  caret-color: var(--st-text);
}
.st-input:-webkit-autofill:focus {
  box-shadow:
    0 0 0 1000px var(--st-input-bg) inset,
    0 0 0 3px var(--st-focus-ring);
}
.st-input[aria-invalid='true'] {
  border-color: var(--st-bad);
}

/* show/hide password -- same inset eye on every password field */
.st-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--st-muted);
  cursor: pointer;
}
.st-toggle::before {
  content: '';
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--st-icon-eye) center / contain no-repeat;
  mask: var(--st-icon-eye) center / contain no-repeat;
}
.st-toggle[aria-pressed='true']::before {
  -webkit-mask-image: var(--st-icon-eye-off);
  mask-image: var(--st-icon-eye-off);
}
.st-toggle:hover {
  color: var(--st-text);
  background: color-mix(in srgb, currentColor 8%, transparent);
}
.st-toggle:focus-visible {
  outline: 2px solid var(--st-accent);
  outline-offset: 1px;
}

/* ---- buttons ---------------------------------------------------------------- */

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--st-radius);
  font: 600 1rem/1 var(--st-font);
  cursor: pointer;
  transition:
    background 120ms ease,
    transform 80ms ease;
}
.st-btn:active {
  transform: translateY(1px);
}
.st-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--st-focus-ring);
}
.st-btn-primary {
  background: var(--st-accent);
  color: var(--st-accent-contrast);
}
.st-btn-primary:hover {
  background: var(--st-accent-hover);
}
.st-btn-secondary {
  background: transparent;
  color: var(--st-text);
  border-color: var(--st-input-border);
}
.st-btn-secondary:hover {
  background: color-mix(in srgb, var(--st-text) 5%, transparent);
}
/* Links styled as buttons keep the button's colours, not the link colour. */
.st-card a.st-btn {
  text-decoration: none;
}
.st-card a.st-btn-primary {
  color: var(--st-accent-contrast);
}
.st-card a.st-btn-secondary {
  color: var(--st-text);
}
.st-btn-link {
  width: auto;
  min-height: 0;
  padding: 0;
  background: none;
  color: var(--st-link);
  font-weight: 500;
}
.st-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

/* ---- alerts ---------------------------------------------------------------- */

.st-alert {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: var(--st-radius);
  border-left: 3px solid currentColor;
  font-size: 0.9375rem;
}
.st-alert-error {
  color: var(--st-bad);
  background: color-mix(in srgb, var(--st-bad) 8%, transparent);
}
.st-alert-info {
  color: var(--st-text);
  border-left-color: var(--st-accent);
  background: color-mix(in srgb, var(--st-accent) 8%, transparent);
}
.st-alert ul {
  margin: 0;
  padding-left: 18px;
}

/* ---- who is signing in ------------------------------------------------------- */

.st-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 20px;
}
.st-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--st-accent) 18%, var(--st-card-bg));
  color: var(--st-text);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
}
.st-user-name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- password meter (password.js) ---------------------------------------------- */

.st-meter {
  margin-top: 4px;
  font-size: 0.875rem;
}
.st-meter[hidden] {
  display: none;
}
.st-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.st-bars i {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: var(--st-input-border);
  transition: background 160ms ease;
}
.st-meter-status {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  min-height: 1.3em;
}
.st-meter-label {
  font-weight: 600;
}
.st-meter-time,
.st-meter-hint {
  color: var(--st-muted);
}
.st-meter-hint {
  margin: 4px 0 0;
}
.st-meter-hint:empty {
  display: none;
}
.st-rules {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.st-rules li,
.st-match {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--st-muted);
}
.st-rules li::before,
.st-match::before {
  content: '';
  flex: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  transform: translateY(2px);
  border: 1.5px solid var(--st-muted);
  font:
    700 10px/12px system-ui,
    sans-serif;
  text-align: center;
  color: #fff;
}
.st-rules li[data-state='ok'],
.st-match[data-state='ok'] {
  color: var(--st-ok);
}
.st-rules li[data-state='ok']::before,
.st-match[data-state='ok']::before {
  content: '\2713';
  background: var(--st-ok);
  border-color: var(--st-ok);
}
.st-rules li[data-state='bad'],
.st-match[data-state='bad'] {
  color: var(--st-bad);
}
.st-rules li[data-state='bad']::before,
.st-match[data-state='bad']::before {
  content: '\2715';
  background: var(--st-bad);
  border-color: var(--st-bad);
}
.st-rules li[data-state='checking']::before {
  border-style: dashed;
  animation: st-spin 1s linear infinite;
}
@keyframes st-spin {
  to {
    transform: translateY(2px) rotate(360deg);
  }
}
.st-match {
  margin-top: 8px;
  font-size: 0.875rem;
}
.st-match:not([data-state]) {
  display: none;
}

/* ---- dashboard layout (account page and app launcher) ---------------------------- */

/* No mirrored gutter on the left here: the top bar runs edge to edge. */
html:has(body.st-dash) {
  scrollbar-gutter: stable;
}
body.st-page.st-dash {
  display: block;
  padding: 0;
}
.st-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(24px, calc((100vw - 1120px) / 2));
  background: color-mix(in srgb, var(--st-card-bg) 82%, transparent);
  border-bottom: 1px solid var(--st-card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.st-topbar-brand img {
  display: block;
  height: calc(var(--st-logo-height) * 0.7);
  max-width: 220px;
}
.st-topbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
}
.st-topbar-name {
  font-weight: 600;
  font-size: 0.9375rem;
}
.st-btn.st-btn-sm {
  width: auto;
  min-height: 34px;
  padding: 6px 14px;
  font-size: 0.875rem;
}
.st-dash-main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.st-dash-title {
  margin: 0 0 6px;
  font: 700 clamp(1.6rem, 3vw, 2.1rem) / 1.2 var(--st-heading-font);
  letter-spacing: -0.02em;
}
.st-dash-main > .st-lead {
  margin: 0 0 28px;
  font-size: 1.0625rem;
}
.st-dash-section {
  margin-top: 32px;
}
.st-dash-section > .st-section {
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.st-section-note {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* App launcher: big, scannable tiles. */
.st-launcher {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.st-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 16px;
  background: var(--st-card-bg);
  border: 1px solid var(--st-card-border);
  border-radius: var(--st-radius-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color: var(--st-text);
  text-decoration: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.st-tile:hover {
  border-color: color-mix(in srgb, var(--st-accent) 60%, var(--st-card-border));
  box-shadow: var(--st-card-shadow);
  transform: translateY(-2px);
}
.st-tile:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--st-focus-ring);
}
.st-tile-icon {
  --st-hue: var(--st-accent);
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--st-hue) 16%, var(--st-card-bg));
  color: var(--st-hue);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.st-hue-0 {
  --st-hue: #d97706;
}
.st-hue-1 {
  --st-hue: #0d9488;
}
.st-hue-2 {
  --st-hue: #2563eb;
}
.st-hue-3 {
  --st-hue: #7c3aed;
}
.st-hue-4 {
  --st-hue: #db2777;
}
.st-hue-5 {
  --st-hue: #0891b2;
}
.st-hue-6 {
  --st-hue: #65a30d;
}
.st-hue-7 {
  --st-hue: #dc2626;
}
.st-tile-text {
  display: grid;
  min-width: 0;
}
.st-tile-name {
  font-weight: 650;
  line-height: 1.3;
}
.st-tile-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  color: var(--st-muted);
}

/* Security settings: a grid of compact panels. */
.st-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.st-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  background: var(--st-card-bg);
  border: 1px solid var(--st-card-border);
  border-radius: var(--st-radius-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.st-panel > * {
  max-width: 100%;
}
.st-panel > .st-list {
  align-self: stretch;
}
/* The panel's action sits at the bottom, so buttons line up across a row of panels. */
.st-panel > :last-child {
  margin-top: auto;
}
.st-panel .st-list li {
  flex-wrap: wrap;
}
.st-panel .st-list li > span {
  flex: 1 1 170px;
  min-width: 0;
}
.st-panel-wide {
  grid-column: 1 / -1;
}
.st-panel h3 {
  margin: 0;
  font: 650 1.0625rem / 1.3 var(--st-heading-font);
}
.st-panel .st-list {
  margin: 0;
}
.st-panel .st-btn:not(.st-btn-link) {
  width: auto;
  min-height: 38px;
  padding: 8px 16px;
  font-size: 0.9375rem;
}
.st-panel a.st-btn-secondary {
  color: var(--st-text);
  text-decoration: none;
}
.st-panel p {
  margin: 0;
}
.st-item-name {
  display: block;
  font-weight: 600;
}
.st-empty {
  color: var(--st-muted);
  font-size: 0.875rem;
}
.st-stat {
  color: var(--st-muted);
}
.st-stat-value {
  font: 750 2rem / 1 var(--st-heading-font);
  color: var(--st-text);
  margin-right: 4px;
}
.st-dash .st-alert {
  margin: 0 0 8px;
}
.st-dash .st-footer {
  justify-content: center;
  padding-bottom: 24px;
}
@media (max-width: 640px) {
  .st-topbar {
    padding: 10px 16px;
  }
  .st-topbar-name {
    display: none;
  }
  .st-dash-main {
    padding: 24px 16px 48px;
  }
  .st-launcher {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ---- lists (account page) ------------------------------------------------------ */

.st-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  border: 1px solid var(--st-card-border);
  border-radius: var(--st-radius);
}
.st-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}
.st-list li + li {
  border-top: 1px solid var(--st-card-border);
}
.st-section {
  margin: 24px 0 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted);
}

.st-signout {
  margin-top: 24px;
}

/* ---- service accounts you own (account page) --------------------------------------- */

.st-sa-intro {
  margin: -4px 0 12px;
}
.st-sa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  align-self: stretch;
}
.st-tag {
  flex: none;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 650;
}
.st-tag-ok {
  color: var(--st-ok);
  background: color-mix(in srgb, var(--st-ok) 12%, transparent);
}
.st-tag-bad {
  color: var(--st-bad);
  background: color-mix(in srgb, var(--st-bad) 12%, transparent);
}
.st-grants {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.st-grants li {
  padding: 2px 10px;
  border: 1px solid var(--st-card-border);
  border-radius: 99px;
  font-size: 0.8125rem;
}
.st-grants li.st-empty {
  border: 0;
  padding: 0;
}
select.st-input {
  cursor: pointer;
}
.st-secret-box {
  display: block;
  padding: 10px 14px;
  border: 1px dashed var(--st-input-border);
  border-radius: var(--st-radius);
  word-break: break-all;
  user-select: all;
}

/* ---- MFA set-up ----------------------------------------------------------------- */

.st-qr {
  display: flex;
  justify-content: center;
  margin: 4px 0 16px;
}
.st-qr svg {
  flex: none; /* never shrink below a scannable size */
  width: 200px;
  height: 200px;
  padding: 8px;
  background: #fff; /* scanners need contrast whatever the theme */
  border-radius: var(--st-radius);
}
.st-secret,
.st-codes code {
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 0.95em;
  letter-spacing: 0.04em;
}
.st-codes {
  list-style: none;
  margin: 0 0 20px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  border: 1px dashed var(--st-input-border);
  border-radius: var(--st-radius);
}

/* ---- footer ---------------------------------------------------------------- */

.st-footer {
  margin-top: 28px;
  display: flex;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--st-footer-text);
}
.st-footer a {
  color: inherit;
}

@media (max-width: 520px) {
  body.st-page {
    padding: 24px 12px;
  }
  .st-card {
    padding: 32px 22px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-rules li[data-state='checking']::before {
    animation: none;
  }
  .st-btn:active {
    transform: none;
  }
}

.st-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
