@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

:root {
  color-scheme: dark;
  --bg-1: #0a0e1a;
  --bg-2: #111827;
  --bg-3: #1a2235;
  --panel: rgba(17, 24, 39, 0.9);
  --panel-strong: rgba(17, 24, 39, 0.96);
  --line: rgba(42, 58, 92, 0.9);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --accent-2: #818cf8;
  --button-base-bg: rgba(15, 23, 42, 0.82);
  --button-base-border: rgba(71, 85, 105, 0.45);
  --button-active-border: rgba(249, 115, 22, 0.95);
  --button-active-bg: linear-gradient(135deg, rgba(249, 115, 22, 0.24), rgba(251, 146, 60, 0.16));
  --button-hover-border: rgba(59, 130, 246, 0.95);
  --button-hover-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(96, 165, 250, 0.16));
  --button-hover-text: #e2e8f0;
  --button-hover-glow-strong: rgba(59, 130, 246, 0.45);
  --button-hover-glow-soft: rgba(59, 130, 246, 0.18);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --ink: #e2e8f0;
  --shadow: 0 28px 60px rgba(2, 8, 23, 0.48);
  font-family: "Inter", "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 26%),
    radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.12), transparent 32%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
  color: var(--text);
}

a {
  color: inherit;
}

.shell {
  width: min(100%, 1220px);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 28px;
}

.card {
  width: min(100%, 470px);
  padding: 32px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.login-language-toolbar {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.login-language-group {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.28rem;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.36);
}

.wide-card {
  width: min(100%, 1160px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-tight {
  margin-bottom: 6px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.1rem);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 {
  font-size: 1.25rem;
}

.lead,
.note,
.muted,
.stage-summary,
.stage-meta,
.stage-body,
.qr-meta {
  color: var(--muted);
}

.lead {
  margin: 14px 0 0;
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.95rem;
  font-weight: 600;
}

.field input,
.textarea {
  width: 100%;
  border: 1px solid rgba(42, 58, 92, 0.9);
  border-radius: 16px;
  background: rgba(10, 14, 26, 0.96);
  padding: 14px 15px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field input:focus,
.textarea:focus {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12);
  transform: translateY(-1px);
}

.textarea {
  min-height: 240px;
  resize: vertical;
}

.button,
.nav-links a,
.language-switch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--button-base-border);
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 400;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  background: var(--button-base-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover,
.button:focus-visible,
.nav-links a:hover,
.nav-links a:focus-visible,
.language-switch-button:not(.active):hover,
.language-switch-button:not(.active):focus-visible {
  transform: translateY(-1px);
  color: var(--button-hover-text);
  background: var(--button-hover-bg);
  border-color: var(--button-hover-border);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.55),
    0 0 16px var(--button-hover-glow-strong),
    0 0 34px var(--button-hover-glow-soft),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.language-switch-button.active,
.button.is-active,
.nav-links a.active {
  color: var(--text);
  border-color: var(--button-active-border);
  background: var(--button-active-bg);
  box-shadow:
    0 0 0 1px rgba(249, 115, 22, 0.55),
    0 0 16px rgba(249, 115, 22, 0.45),
    0 0 34px rgba(249, 115, 22, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.button-secondary {
  background: var(--button-base-bg);
}

.button-ghost {
  color: var(--text);
  background: var(--button-base-bg);
}

.message {
  margin: 0 0 20px;
  border: 1px solid rgba(248, 113, 113, 0.24);
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(248, 113, 113, 0.08);
  color: var(--danger);
  line-height: 1.5;
}

.message.success {
  border-color: rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.08);
  color: var(--success);
}

.message.info {
  border-color: rgba(96, 165, 250, 0.22);
  background: rgba(96, 165, 250, 0.08);
  color: #bfdbfe;
}

.note {
  margin-top: 18px;
  font-size: 0.93rem;
  line-height: 1.6;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.topbar-line,
.topbar-actions,
.nav-links,
.action-row,
.qr-meta,
.meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.env-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(13, 91, 215, 0.1);
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links a {
  min-height: 40px;
  padding: 0 14px;
}

.identity-card {
  min-width: 190px;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 40, 0.08);
  background: rgba(255, 255, 255, 0.86);
  text-align: right;
}

.identity-name,
.identity-user {
  margin: 0;
  line-height: 1.35;
}

.identity-name {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
}

.identity-user {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.logout-form {
  margin: 0;
}

.login-grid,
.workspace-grid,
.preview-grid {
  display: grid;
  gap: 18px;
}

.login-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  align-items: start;
}

.preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subcard,
.editor-panel,
.preview-panel,
.asset-panel,
.qr-panel,
.stage-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
  box-shadow: 0 18px 36px rgba(9, 32, 75, 0.08);
}

.subcard,
.editor-panel,
.preview-panel,
.asset-panel {
  padding: 22px;
}

.asset-panel {
  margin-top: 20px;
}

.asset-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.button-link {
  text-decoration: none;
}

.frame-shell {
  border: 1px solid rgba(15, 23, 40, 0.08);
  border-radius: 20px;
  overflow: hidden;
  background: #08101f;
  min-height: 720px;
}

.development-frame {
  width: 100%;
  min-height: 720px;
  border: 0;
  background: #08101f;
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head-tight {
  margin-bottom: 16px;
}

.panel-head p,
.stage-summary,
.stage-meta,
.stage-body,
.qr-meta p {
  margin: 10px 0 0;
  line-height: 1.6;
}

.action-row {
  justify-content: space-between;
}

.action-row .button {
  flex: 1 1 220px;
}

.stage-card {
  padding: 20px;
}

.stage-card-expanded {
  min-height: 340px;
}

.stage-accent {
  background: linear-gradient(180deg, rgba(13, 91, 215, 0.08), rgba(255, 255, 255, 0.98));
}

.stage-production {
  background: linear-gradient(180deg, rgba(15, 122, 80, 0.08), rgba(255, 255, 255, 0.98));
}

.stage-label {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.stage-production .stage-label {
  color: var(--success);
}

.stage-body {
  white-space: normal;
}

.production-wrapper {
  margin-top: 26px;
}

.qr-panel {
  margin-top: 18px;
  padding: 18px;
}

.qr-visual {
  display: grid;
  place-items: center;
  margin-top: 14px;
  padding: 18px;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(15, 23, 40, 0.08);
}

.qr-visual svg {
  width: min(100%, 240px);
  height: auto;
}

.public-flow-card {
  margin-top: 24px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-row .button {
  flex: 1 1 220px;
}

.account-summary {
  margin-bottom: 8px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(96, 165, 250, 0.12);
  background: rgba(8, 15, 28, 0.72);
}

.account-summary-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.account-summary-user {
  margin: 6px 0 0;
  color: var(--muted);
  word-break: break-word;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 18px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: rgba(15, 23, 42, 0.62);
  color: var(--muted);
}

.wizard-step.active {
  border-color: var(--button-active-border);
  background: var(--button-active-bg);
  color: var(--text);
  box-shadow:
    0 0 0 1px rgba(249, 115, 22, 0.55),
    0 0 16px rgba(249, 115, 22, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.wizard-step.complete {
  border-color: rgba(59, 130, 246, 0.5);
  color: var(--text);
}

.wizard-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.8rem;
  font-weight: 700;
}

.guided-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.7;
}

.guided-list li + li {
  margin-top: 0.35rem;
}

.onboarding-copy {
  margin-bottom: 4px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 26px 0 22px;
}

.admin-toolbar-spacer {
  flex: 1 1 auto;
}

.admin-section {
  margin-top: 24px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(8, 15, 28, 0.72);
}

.admin-summary-grid,
.technical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.summary-card,
.technical-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(71, 85, 105, 0.32);
  background: rgba(15, 23, 42, 0.58);
  box-shadow: 0 18px 36px rgba(9, 32, 75, 0.08);
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1;
}

.summary-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.technical-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  word-break: break-word;
}

.technical-card p + p {
  margin-top: 10px;
}

.technical-card strong {
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.admin-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.admin-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-filter-field {
  min-width: 0;
}

.admin-checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(42, 58, 92, 0.9);
  background: rgba(10, 14, 26, 0.96);
}

.admin-checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #3b82f6;
}

.admin-checkbox-field span {
  font-size: 0.95rem;
  font-weight: 500;
}

.admin-select {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(42, 58, 92, 0.9);
  border-radius: 16px;
  background: rgba(10, 14, 26, 0.96);
  padding: 14px 15px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.admin-select:focus {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12);
  transform: translateY(-1px);
}

.admin-users-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-user-card {
  position: relative;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(71, 85, 105, 0.32);
  background: rgba(15, 23, 42, 0.58);
}

.admin-user-card[hidden] {
  display: none !important;
}

.admin-card-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-card-select input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #3b82f6;
}

.admin-user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-user-head h3 {
  margin: 0;
  font-size: 1.04rem;
}

.admin-user-head .muted {
  margin: 6px 0 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(30, 41, 59, 0.75);
  color: var(--text);
  font-size: 0.76rem;
  text-align: center;
}

.admin-user-meta {
  display: grid;
  gap: 8px;
  margin: 16px 0 18px;
  color: var(--muted);
}

.admin-user-meta p {
  margin: 0;
}

.risk-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.risk-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.22);
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
  font-size: 0.8rem;
}

.risk-chip-muted {
  border-color: rgba(96, 165, 250, 0.18);
  background: rgba(59, 130, 246, 0.08);
  color: #bfdbfe;
}

.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-action-button {
  min-height: 44px;
  padding: 12px 14px;
}

.admin-user-details {
  margin-top: 16px;
  border-top: 1px solid rgba(71, 85, 105, 0.24);
  padding-top: 16px;
}

.admin-user-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
}

.admin-user-details summary::-webkit-details-marker {
  display: none;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.admin-detail-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(71, 85, 105, 0.28);
  background: rgba(8, 15, 28, 0.55);
}

.admin-detail-card h4 {
  margin: 0 0 10px;
  font-size: 0.98rem;
}

.admin-detail-card .muted {
  margin: 0 0 12px;
}

.admin-detail-actions {
  display: grid;
  gap: 10px;
}

.admin-notes-area {
  min-height: 140px;
}

.admin-bulk-toolbar,
.admin-audit-filters {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: end;
}

.admin-bulk-field {
  min-width: 0;
}

.admin-bulk-selectall {
  min-height: 56px;
}

.admin-preview-card {
  border-color: rgba(249, 115, 22, 0.28);
}

.credential-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.credential-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(96, 165, 250, 0.14);
  background: rgba(15, 23, 42, 0.6);
}

.credential-card p {
  margin: 0 0 10px;
  color: var(--muted);
  word-break: break-word;
}

.credential-card p strong {
  color: var(--text);
}

.credential-textarea {
  min-height: 280px;
  margin-bottom: 12px;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-actions .button {
  flex: 1 1 180px;
}

.audit-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}

.audit-list li + li {
  margin-top: 12px;
}

.backup-list {
  padding-left: 1.1rem;
}

@media (max-width: 980px) {
  .login-grid,
  .workspace-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .identity-card {
    width: 100%;
    text-align: left;
  }

  .wizard-steps,
  .admin-users-grid,
  .credential-grid,
  .admin-filters,
  .admin-detail-grid,
  .admin-bulk-toolbar,
  .admin-audit-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-language-toolbar {
    top: max(0.85rem, env(safe-area-inset-top, 0px));
    right: max(0.85rem, env(safe-area-inset-right, 0px));
  }

  .shell {
    padding: 18px;
  }

  .card,
  .wide-card {
    width: 100%;
    padding: 24px;
    border-radius: 24px;
  }

  .subcard,
  .editor-panel,
  .preview-panel,
  .asset-panel,
  .stage-card,
  .qr-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .button,
  .nav-links a {
    width: 100%;
    justify-content: center;
  }

  .wizard-step,
  .status-pill {
    justify-content: flex-start;
  }

  .topbar-actions,
  .nav-links,
  .action-row {
    width: 100%;
  }

  .admin-actions-grid,
  .button-row {
    grid-template-columns: 1fr;
  }

  .button-row {
    display: grid;
  }
}
