/* Jamming.Live Auth / MFA pages: dark charcoal interface, restrained red accents. */
:root {
  --bg: #050507;
  --panel: #0d0d11;
  --panel-2: #14141a;
  --line: #2a2a33;
  --ink: #f4f1ec;
  --ink-soft: rgba(244, 241, 236, 0.74);
  --ink-faint: rgba(244, 241, 236, 0.52);
  --accent: #d0161c;
  --accent-bright: #ff2a2a;
  --accent-ink: #ff6b6b;
  --ok: #4fd18b;
  --radius: 12px;
  --focus: #ffd24a;
}

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

html { color-scheme: dark; }

body.jl-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: #fff; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: #fff; color: #000; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* Header and footer */
.site-header {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 14px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 7, 0.96);
}
.site-header .logo img { display: block; height: 44px; width: auto; }
.site-nav { display: flex; gap: clamp(14px, 2.2vw, 30px); margin-left: auto; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.98rem; padding: 6px 2px; }
.site-nav a:hover { color: var(--accent-ink); }
.header-actions { display: flex; gap: 12px; align-items: center; }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .js .nav-toggle { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px; margin-left: auto; border: 1px solid #8a8a96; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
  .js .nav-toggle + .site-nav { display: none; order: 5; width: 100%; margin-left: 0; flex-direction: column; gap: 0; border-top: 1px solid var(--line); padding-top: 6px; }
  .js .nav-toggle + .site-nav.is-open { display: flex; }
  .js .nav-toggle + .site-nav a { padding: 12px 4px; }
}
.header-actions .link { color: var(--ink); text-decoration: none; padding: 8px 6px; }
.onboarding-header .header-actions { margin-left: auto; }

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 22px clamp(16px, 4vw, 56px);
  display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center;
  color: var(--ink-faint); font-size: 0.9rem;
}
.site-footer nav { display: flex; gap: 22px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

/* Page stage */
.stage {
  flex: 1;
  display: flex; justify-content: center; align-items: flex-start;
  gap: 28px; flex-wrap: wrap;
  padding: clamp(24px, 5vw, 64px) clamp(16px, 4vw, 56px);
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(208, 22, 28, 0.32), transparent 70%),
    radial-gradient(700px 380px at 92% 4%, rgba(120, 140, 255, 0.16), transparent 70%),
    radial-gradient(800px 500px at 50% 110%, rgba(208, 22, 28, 0.18), transparent 70%),
    var(--bg);
}

.card {
  width: 100%; max-width: 560px;
  background: rgba(13, 13, 17, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 40px);
}
.card.wide { max-width: 640px; }
.side-panel {
  width: 100%; max-width: 420px;
  background: rgba(13, 13, 17, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 32px);
}
.side-panel h2 { margin-top: 0; font-size: 1.35rem; }
.side-panel ul { list-style: none; padding: 0; margin: 18px 0 0; }
.side-panel li { padding: 10px 0 10px 34px; position: relative; border-top: 1px solid var(--line); }
.side-panel li::before { content: "✓"; position: absolute; left: 4px; color: var(--accent-bright); font-weight: 700; }
.side-panel .tagline { margin-top: 22px; color: var(--ink-soft); font-style: italic; }

h1 { font-size: clamp(1.8rem, 4.5vw, 2.5rem); line-height: 1.12; margin: 0 0 10px; letter-spacing: -0.01em; }
.lede { color: var(--ink-soft); margin: 0 0 22px; }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px; }
.steps { display: flex; gap: 8px; margin: 0 0 22px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--accent); }

/* Forms */
.field { margin: 0 0 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.req { color: var(--accent-bright); }
.hint { color: var(--ink-faint); font-size: 0.86rem; margin: 6px 0 0; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select {
  width: 100%; min-height: 48px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid #3a3a45; border-radius: 8px;
  padding: 11px 14px; font: inherit;
}
input::placeholder { color: var(--ink-faint); }
input[aria-invalid="true"] { border-color: var(--accent-bright); }
.input-wrap { position: relative; }
.input-wrap.has-toggle input { padding-right: 76px; }
.toggle-password {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--ink-soft);
  font: inherit; font-size: 0.85rem; padding: 10px; cursor: pointer; border-radius: 6px;
}
.toggle-password:hover { color: #fff; }

.code-input {
  text-align: center; letter-spacing: 0.5em; font-size: 1.7rem; font-family: ui-monospace, Menlo, Consolas, monospace;
  padding-left: 0.5em !important;
}

.check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check small { display: block; color: var(--ink-faint); }

.field-error { color: var(--accent-ink); font-size: 0.9rem; margin: 6px 0 0; }
.pw-hint.ok { color: var(--ok); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 24px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn-primary { background: linear-gradient(180deg, var(--accent-bright), var(--accent)); color: #fff; width: 100%; }
.btn-primary:hover { filter: brightness(1.1); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: #8a8a96; }
.btn-outline:hover { border-color: #fff; color: #fff; }
.btn-join { background: var(--accent); color: #fff; min-height: 42px; padding: 8px 24px; }
.btn-join:hover { background: var(--accent-bright); color: #fff; }
.btn-link { background: none; border: 0; color: var(--accent-ink); text-decoration: underline; cursor: pointer; font: inherit; padding: 8px 4px; }
.btn[disabled], .btn-link[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 18px; }

.divider { display: flex; align-items: center; gap: 14px; color: var(--ink-soft); margin: 22px 0 14px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.center { text-align: center; }
.links { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.inline-form { display: inline; }
.stack > * + * { margin-top: 14px; }

.alert { border-radius: 8px; padding: 12px 16px; margin: 0 0 20px; border: 1px solid; }
.alert-ok { background: rgba(79, 209, 139, 0.1); border-color: rgba(79, 209, 139, 0.5); }
.alert-error { background: rgba(255, 42, 42, 0.1); border-color: rgba(255, 42, 42, 0.55); }
.alert-info { background: rgba(255, 255, 255, 0.05); border-color: var(--line); }

/* Recovery codes */
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
@media (max-width: 460px) { .codes { grid-template-columns: 1fr; } }
.code-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--panel-2); border: 1px solid #3a3a45; border-radius: 8px; padding: 10px 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.08em; font-size: 1.02rem;
}
.code-chip button { background: none; border: 0; color: var(--ink-soft); cursor: pointer; font: inherit; font-size: 0.8rem; padding: 6px; }
.code-chip button:hover { color: #fff; }

/* Dialog */
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); max-width: 520px; width: calc(100% - 32px); padding: 28px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
dialog h2 { margin-top: 0; }

.mask { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.04em; }

@media print {
  body.jl-body > header, body.jl-body > footer, .no-print, .side-panel { display: none !important; }
  body.jl-body, .stage, .card { background: #fff !important; color: #000 !important; border: 0 !important; }
  .code-chip { background: #fff; color: #000; border-color: #000; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* Account Settings */
.site-nav a[aria-current="page"] { color: var(--accent-ink); }
.settings-wrap { width: 100%; max-width: 1050px; }
.settings-wrap .lede { margin-bottom: 20px; }
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: 16px; display: flex; flex-direction: column; padding: 10px; background: rgba(13, 13, 17, 0.94); border: 1px solid var(--line); border-radius: var(--radius); }
.settings-nav a { color: var(--ink-soft); text-decoration: none; padding: 10px; border-radius: 8px; }
.settings-nav a:hover, .settings-nav a:focus-visible { background: var(--panel-2); color: #fff; }
.panel { background: rgba(13, 13, 17, 0.94); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); margin-bottom: 18px; scroll-margin-top: 16px; }
.panel h2 { margin: 0 0 8px; font-size: 1.35rem; }
.panel h3 { margin: 22px 0 4px; font-size: 1rem; color: var(--ink-soft); }
.setting-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-of-type { border-bottom: 0; }
.setting-label { font-weight: 600; }
.setting-body p { margin: 6px 0 0; }
.muted { color: var(--ink-soft); }
.badge { display: inline-block; font-size: 0.78rem; border: 1px solid #555c65; border-radius: 12px; padding: 2px 9px; color: var(--ink); }
.btn-small { min-height: 42px; padding: 8px 16px; background: var(--panel-2); border-color: #4d535b; color: var(--ink); font-size: 0.95rem; white-space: nowrap; }
.btn-small:hover { border-color: #fff; color: #fff; }
.btn-primary-small { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger:hover { background: var(--accent-bright); color: #fff; }
.warn { padding: 12px 14px; border-left: 4px solid #d99a3a; background: #241d12; border-radius: 6px; line-height: 1.45; }
.danger-zone { margin-top: 22px; }
.inline-edit { margin-top: 8px; }
.inline-edit summary { cursor: pointer; color: var(--accent-ink); text-decoration: underline; width: max-content; padding: 4px 0; }
.inline-edit form { margin-top: 12px; }
@media (max-width: 760px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; }
  .settings-nav a { white-space: nowrap; }
  .setting-row { grid-template-columns: 1fr; }
  .setting-row .btn, .setting-row form .btn { width: 100%; }
  .setting-row form { display: block; }
}

/* Signed-in account menu */
.account-menu-wrap { margin-left: auto; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; min-height: 42px; padding: 8px 20px; border: 1px solid #8a8a96; border-radius: 8px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary::after { content: "\25BE"; }
.account-menu summary:hover { border-color: #fff; }
.account-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px; margin: 0; padding: 6px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.account-menu-list a, .account-menu-list button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; }
.account-menu-list a:hover, .account-menu-list button:hover, .account-menu-list a:focus-visible, .account-menu-list button:focus-visible { background: var(--panel-2); color: #fff; }
.account-menu-list a[aria-current="page"] { color: var(--accent-ink); }

/* My Profiles */
.profiles-wrap { width: 100%; max-width: 860px; }
.profiles-wrap .lede { margin-bottom: 20px; }
.profile-section .empty { color: var(--ink-soft); margin: 12px 0; }
.profile-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-head h2 { margin: 0; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.profile-card { display: flex; align-items: center; justify-content: space-between; gap: 14px 18px; flex-wrap: wrap; padding: 16px; margin-top: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.profile-card-main { min-width: 0; flex: 1 1 260px; }
.profile-card h3 { margin: 0 0 6px; font-size: 1.1rem; color: var(--ink); overflow-wrap: anywhere; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.profile-card .profile-meta { margin: 0; }
.profile-card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-ok { border-color: #386c48; color: #b9f0c9; }
.badge-owner { border-color: var(--accent); color: var(--accent-ink); font-weight: 700; letter-spacing: 0.06em; }
.badge-manager { border-color: #8a8a96; font-weight: 700; letter-spacing: 0.06em; }
.badge-status-draft { border-color: #71552b; color: #ffdca1; }
.badge-status-published { border-color: #386c48; color: #b9f0c9; }
.badge-status-unpublished { border-color: #555c65; color: var(--ink-soft); }
.limit-note { margin: 14px 0 0; padding: 12px 14px; border-left: 4px solid #d99a3a; background: #241d12; border-radius: 6px; line-height: 1.45; }
.small { font-size: 0.88rem; }
@media (max-width: 560px) {
  .profile-card-actions, .profile-card-actions .btn, .profile-actions .btn { width: 100%; }
}
