/* SEHL · SOL BODY FINAL — security, synchronization and governed-action layer */

body.auth-pending {
  overflow: hidden;
}

body.auth-pending .app-shell,
body.auth-pending .mobile-dock,
body.auth-pending .conversation-layer,
body.auth-pending .sheet-layer {
  filter: blur(18px) saturate(.65);
  transform: scale(1.012);
  pointer-events: none !important;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  visibility: hidden;
  opacity: 0;
  transition: opacity .35s ease, visibility .35s ease;
}

.auth-gate.visible,
body.auth-pending .auth-gate {
  visibility: visible;
  opacity: 1;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(199, 157, 78, .12), transparent 28%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .025), transparent 58%),
    linear-gradient(155deg, rgba(7, 8, 10, .98), rgba(15, 16, 18, .985));
}

.auth-backdrop::before,
.auth-backdrop::after {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(205, 169, 96, .09);
  border-radius: 42px;
  pointer-events: none;
}

.auth-backdrop::after {
  inset: 13%;
  border-radius: 50%;
  border-color: rgba(205, 169, 96, .035);
  animation: authOrbit 22s linear infinite;
}

@keyframes authOrbit { to { transform: rotate(360deg); } }

.auth-card {
  position: relative;
  width: min(460px, 100%);
  padding: 42px 40px 34px;
  overflow: hidden;
  border: 1px solid rgba(211, 177, 103, .24);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(34, 35, 37, .94), rgba(15, 16, 18, .97)),
    #111214;
  box-shadow: 0 45px 110px rgba(0, 0, 0, .58), inset 0 1px rgba(255, 255, 255, .035);
  text-align: center;
  backdrop-filter: blur(30px);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 12% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 199, 125, .82), transparent);
}

.auth-seal {
  position: relative;
  width: 86px;
  height: 86px;
  margin: 0 auto 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 181, 106, .4);
  border-radius: 50%;
  box-shadow: 0 0 45px rgba(193, 147, 57, .14), inset 0 0 28px rgba(219, 180, 95, .08);
}

.auth-seal span {
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(211, 172, 89, .3);
  border-radius: inherit;
  animation: authOrbit 18s linear infinite reverse;
}

.auth-seal b {
  font-family: var(--font-display, Georgia, serif);
  font-size: 32px;
  font-weight: 500;
  color: var(--gold-2, #d7b56c);
  text-shadow: 0 0 22px rgba(212, 173, 91, .28);
}

.auth-card h1 {
  margin: 10px 0 12px;
  font-family: var(--font-display, Georgia, serif);
  font-weight: 500;
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -.03em;
  color: #f0ede5;
}

.auth-card > p {
  min-height: 45px;
  margin: 0 auto 25px;
  color: rgba(238, 234, 224, .66);
  line-height: 1.55;
}

.auth-card form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.auth-card form[hidden],
.auth-setup[hidden] { display: none !important; }

.auth-card label {
  display: grid;
  gap: 9px;
  text-align: left;
  color: rgba(240, 236, 227, .72);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-card input {
  width: 100%;
  min-height: 54px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 15px;
  outline: none;
  background: rgba(4, 5, 7, .5);
  color: #f2eee4;
  font: inherit;
  font-size: 16px;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.auth-card input:focus {
  border-color: rgba(211, 174, 93, .58);
  box-shadow: 0 0 0 4px rgba(195, 148, 55, .09);
}

.auth-submit {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(237, 207, 138, .55);
  border-radius: 16px;
  background: linear-gradient(135deg, #b98a37, #e1c27c 55%, #b7852d);
  color: #15110a;
  font-weight: 750;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(154, 109, 28, .2);
}

.auth-submit:disabled { opacity: .5; cursor: wait; }
.auth-submit svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }

.auth-setup {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid rgba(211, 172, 88, .18);
  border-radius: 16px;
  background: rgba(205, 161, 68, .055);
  text-align: left;
}
.auth-setup strong { color: #e0c17d; }
.auth-setup p { margin: 8px 0 0; color: rgba(240, 235, 223, .66); line-height: 1.5; }
.auth-setup code { color: #e9cf93; }
.auth-card > small { display: block; margin-top: 22px; color: rgba(238, 234, 224, .38); line-height: 1.45; }

#syncHint {
  transition: color .2s ease, opacity .2s ease;
}
#syncHint.syncing { color: #dbc182; }
#syncHint.syncing svg { animation: syncSpin .9s linear infinite; }
#syncHint.synced { color: #9fc9a9; }
#syncHint.error { color: #e0a28e; }
@keyframes syncSpin { to { transform: rotate(360deg); } }

.audit-list {
  display: grid;
  gap: 9px;
  max-height: min(42vh, 430px);
  overflow: auto;
  padding-right: 3px;
}
.audit-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, .065);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
}
.audit-event span {
  color: #ddc481;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.audit-event strong { color: rgba(239, 235, 225, .52); font-size: 10px; font-weight: 500; }
.audit-event small { grid-column: 1 / -1; color: rgba(236, 232, 222, .43); line-height: 1.4; overflow-wrap: anywhere; }
.error-copy { color: #e5a18e !important; }
.danger-outline { border-color: rgba(210, 99, 77, .32) !important; color: #dda08e !important; }

.action-builder,
.action-review {
  width: min(760px, 100%);
  margin: 24px auto 0;
  text-align: left;
}
.action-builder {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(217, 181, 103, .14);
  border-radius: 20px;
  background: rgba(255, 255, 255, .025);
}
.action-builder textarea {
  min-height: 130px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}
.action-empty {
  margin: 2px 0 0;
  color: rgba(237, 232, 220, .46);
  font-size: 12px;
  line-height: 1.55;
}
.action-review[hidden], .action-builder[hidden] { display: none !important; }
.action-phrase-field { margin: 16px 0 10px; }
.action-phrase-field input { text-transform: uppercase; letter-spacing: .1em; }
#actionRiskLabel[data-risk="low"] { color: #9bc4a5; border-color: rgba(111, 177, 127, .3); }
#actionRiskLabel[data-risk="medium"] { color: #e0c37d; border-color: rgba(210, 171, 75, .34); }
#actionRiskLabel[data-risk="high"],
#actionRiskLabel[data-risk="critical"] { color: #e3947f; border-color: rgba(208, 94, 67, .38); }

.action-receipt-final {
  margin-top: 18px;
  padding: 17px;
  border: 1px solid rgba(126, 191, 140, .2);
  border-radius: 16px;
  background: rgba(73, 139, 86, .07);
  color: rgba(238, 234, 224, .7);
}
.action-receipt-final > div { display: flex; align-items: center; gap: 10px; color: #a8d0b0; }
.action-receipt-final svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.action-receipt-final p { line-height: 1.65; }
.action-receipt-final pre {
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .24);
  color: rgba(245, 241, 231, .66);
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-body > p,
.research-stream p {
  white-space: pre-wrap;
}

body.request-active #composerSendButton {
  border-color: rgba(215, 117, 91, .55);
}

@media (max-width: 720px) {
  .auth-card { padding: 34px 22px 28px; border-radius: 24px; }
  .auth-backdrop::before { inset: 3%; border-radius: 28px; }
  .action-builder { padding: 15px; }
  .audit-event { grid-template-columns: 1fr; }
  .audit-event small { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-backdrop::after,
  .auth-seal span,
  #syncHint.syncing svg { animation: none !important; }
}

/* Final account, artifact and installation refinements */
#accountButton.active,
#accountButton:hover {
  border-color: rgba(216, 181, 103, .34);
  color: #e0c27e;
}

.account-sheet .privacy-hero {
  margin-bottom: 16px;
}

.account-sheet .sensor-row {
  min-height: 48px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
}

.account-sheet .sensor-row:last-child {
  border-bottom: 0;
}

.account-sheet .sensor-row strong {
  max-width: 62%;
  color: #d9bf7d;
  font-size: 10px;
  letter-spacing: .07em;
  text-align: right;
  overflow-wrap: anywhere;
}

.artifact-download {
  width: 100%;
  min-height: 46px;
  margin: 12px 0 4px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(135, 196, 148, .28);
  border-radius: 13px;
  background: rgba(96, 161, 109, .08);
  color: #b8d9bf;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.artifact-download:hover {
  border-color: rgba(151, 212, 164, .48);
  background: rgba(96, 161, 109, .13);
}

.artifact-download svg {
  width: 17px;
  height: 17px;
}

.auth-gate[aria-hidden="true"] {
  pointer-events: none;
}

@media (max-width: 520px) {
  .account-sheet .sensor-row {
    align-items: flex-start;
    gap: 10px;
  }
  .account-sheet .sensor-row strong {
    max-width: 56%;
  }
}
