/* Shared face access / enroll ceremony (light theme) */

.face-ceremony {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}

.face-ceremony[hidden] {
  display: none !important;
}

.face-ceremony.is-open {
  display: grid;
}

.ceremony-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 50% 40%, rgba(17, 108, 181, 0.14), transparent 65%),
    rgba(244, 250, 249, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: faceCeremonyVeilIn 0.45s ease both;
}

.ceremony-card {
  position: relative;
  width: min(420px, 100%);
  padding: 36px 28px 28px;
  text-align: center;
  border-radius: 24px;
  border: 1px solid var(--line, rgba(34, 48, 59, 0.12));
  background: rgba(253, 254, 252, 0.94);
  color: var(--ink, #1a2a36);
  box-shadow: 0 24px 60px rgba(26, 42, 54, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: faceCeremonyCardRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ceremony-ring {
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
  position: relative;
}

.ring-orbit,
.ring-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.ring-orbit {
  border: 1px solid rgba(17, 108, 181, 0.28);
  border-top-color: var(--blue, #116cb5);
  animation: faceCeremonySpin 1.1s linear infinite;
}

.ring-core {
  inset: 18px;
  border: 1px solid rgba(17, 108, 181, 0.16);
  background: radial-gradient(circle at 40% 35%, rgba(17, 108, 181, 0.18), transparent 65%);
}

.face-ceremony.is-granted .ring-orbit {
  animation: none;
  border-color: var(--blue, #116cb5);
}

.face-ceremony.is-denied .ring-orbit {
  animation: none;
  border-color: var(--danger, #c24141);
}

.face-ceremony.is-denied .ring-core {
  background: radial-gradient(circle at 40% 35%, rgba(194, 65, 65, 0.2), transparent 65%);
}

.face-ceremony.is-denied .ceremony-kicker {
  color: var(--danger, #c24141);
}

.face-ceremony.is-denied .ceremony-steps li.is-active {
  border-color: rgba(194, 65, 65, 0.28);
  background: rgba(194, 65, 65, 0.08);
}

.face-ceremony.is-denied .ceremony-steps li.is-active::before {
  background: var(--danger, #c24141);
  box-shadow: 0 0 10px rgba(194, 65, 65, 0.35);
}

.ceremony-steps li.is-denied {
  color: var(--danger, #c24141);
}

.ceremony-steps li.is-denied::before {
  background: var(--danger, #c24141);
}

.ceremony-kicker {
  margin: 0 0 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--blue, #116cb5);
}

.ceremony-title {
  margin: 0;
  font-family: var(--display, "Hedvig Letters Serif", Georgia, serif);
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink, #1a2a36);
}

.ceremony-sub {
  margin: 8px 0 0;
  color: var(--muted, rgba(34, 48, 59, 0.62));
  font-size: 0.92rem;
}

.ceremony-steps {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
}

.ceremony-steps li {
  padding: 8px 10px 8px 28px;
  position: relative;
  font-size: 0.88rem;
  color: rgba(34, 48, 59, 0.45);
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.ceremony-steps li::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(34, 48, 59, 0.22);
}

.ceremony-steps li.is-active {
  color: var(--ink, #1a2a36);
  border-color: rgba(17, 108, 181, 0.22);
  background: rgba(17, 108, 181, 0.06);
}

.ceremony-steps li.is-active::before {
  background: var(--blue, #116cb5);
  box-shadow: 0 0 10px rgba(17, 108, 181, 0.35);
}

.ceremony-steps li.is-done {
  color: rgba(34, 48, 59, 0.72);
}

.ceremony-steps li.is-done::before {
  background: var(--blue, #116cb5);
}

.ceremony-stream {
  margin-top: 16px;
  min-height: 4.8em;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  line-height: 1.35;
  color: rgba(17, 108, 181, 0.55);
  white-space: pre-wrap;
  word-break: break-all;
  opacity: 0.95;
  letter-spacing: 0.02em;
  text-align: left;
  border-top: 1px solid rgba(34, 48, 59, 0.08);
  padding-top: 12px;
}

.ceremony-stream.is-streaming {
  color: rgba(17, 108, 181, 0.72);
  animation: faceCeremonyStreamPulse 1.1s ease-in-out infinite;
}

.ceremony-stream.is-settled {
  color: rgba(17, 108, 181, 0.85);
  animation: none;
}

.ceremony-stream.is-denied-code {
  color: rgba(194, 65, 65, 0.78);
  animation: none;
}

.face-ceremony.is-denied .ceremony-stream {
  color: rgba(194, 65, 65, 0.78);
}

.face-ceremony.is-blurring .ceremony-card,
.face-ceremony.is-blurring .ceremony-veil {
  animation: faceCeremonyBlurOut 0.7s ease forwards;
}

body.face-blur-out .login-stage,
body.face-blur-out .shell,
.modal.is-dimmed,
.login-panel.is-dimmed,
.account-card.is-dimmed {
  filter: blur(8px) brightness(0.92);
  transition: filter 0.4s ease;
}

body.face-blur-out .login-stage {
  filter: blur(14px);
  opacity: 0;
  transition: filter 0.7s ease, opacity 0.7s ease;
}

@keyframes faceCeremonyStreamPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

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

@keyframes faceCeremonyVeilIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes faceCeremonyCardRise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes faceCeremonyBlurOut {
  to { filter: blur(18px); opacity: 0; transform: scale(1.03); }
}

@media (max-width: 560px) {
  .face-ceremony {
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    align-items: end;
  }

  .ceremony-card {
    width: 100%;
    padding: 28px 20px 22px;
    border-radius: 22px;
  }

  .ceremony-title {
    font-size: 1.55rem;
  }

  .ceremony-sub {
    font-size: 0.88rem;
  }

  .ceremony-steps li {
    font-size: 0.82rem;
  }

  .ceremony-stream {
    font-size: 0.58rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring-orbit,
  .ceremony-card,
  .ceremony-veil,
  .ceremony-stream {
    animation: none;
  }
}
