/* ORA — sign-in */

html, body { height: 100%; }
body { overflow: hidden; }

.auth {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 560px);
  height: 100%;
  min-height: 600px;
}

/* --------------------------------------------------------------------------
   The view from orbit
   -------------------------------------------------------------------------- */
.visual { position: relative; overflow: hidden; background: #000; isolation: isolate; }
.visual__img {
  position: absolute; inset: -4%;
  background: url('../assets/video/poster.jpg') 72% 50% / cover no-repeat;
  transform: scale(1.14);
  opacity: 0;
  filter: saturate(0.92) contrast(1.04);
  transition: opacity 1.6s ease, transform 2.6s var(--ease);
  animation: drift 40s ease-in-out infinite alternate;
}
html.is-ready .visual__img { opacity: 1; transform: scale(1.04); }
@keyframes drift { from { translate: 0 0; } to { translate: -2.2% 1.2%; } }

.visual__orbits { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 2s ease 0.6s; }
html.is-ready .visual__orbits { opacity: 1; }
.visual__orbits ellipse { stroke: rgba(143, 211, 255, 0.2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.visual__orbits .o1 { stroke-dasharray: 2 7; }
.visual__orbits .o2 { stroke: rgba(242, 242, 240, 0.08); }
.visual__orbits .o3 { stroke: rgba(242, 242, 240, 0.05); stroke-dasharray: 1 10; }
.sat__dot { fill: #fff; }
.sat__halo { fill: rgba(143, 211, 255, 0.16); animation: halo 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { 50% { transform: scale(1.6); opacity: 0.3; } }

.visual__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 3, 5, 0.6) 0%, rgba(3, 3, 5, 0) 26%, rgba(3, 3, 5, 0) 52%, rgba(3, 3, 5, 0.9) 100%),
    linear-gradient(90deg, rgba(3, 3, 5, 0) 70%, rgba(3, 3, 5, 0.75) 100%);
}
.visual__top {
  position: absolute; left: 44px; right: 44px; top: 36px;
  display: flex; justify-content: space-between; align-items: center;
  opacity: 0; transform: translateY(-8px);
  transition: opacity 1s ease 0.5s, transform 1.2s var(--ease) 0.5s;
}
.visual__caption {
  position: absolute; left: 44px; bottom: 132px; right: 44px;
  opacity: 0; transform: translateY(18px);
  transition: opacity 1.2s ease 0.7s, transform 1.4s var(--ease) 0.7s;
}
.visual__caption .label { margin-bottom: 18px; }
.visual__caption h2 { font: 500 clamp(40px, 4.6vw, 68px)/0.98 var(--sans); letter-spacing: -0.05em; }
.visual__caption h2 span { color: rgba(242, 242, 240, 0.42); }
.visual__telemetry {
  position: absolute; left: 44px; right: 44px; bottom: 40px; margin: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px;
  padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0; transition: opacity 1.2s ease 0.9s;
}
.visual__telemetry dd { margin: 8px 0 0; font: 500 15px/1 var(--mono); color: var(--ink); letter-spacing: 0.02em; }
html.is-ready .visual__top,
html.is-ready .visual__caption,
html.is-ready .visual__telemetry { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Panel
   -------------------------------------------------------------------------- */
.panel {
  position: relative;
  display: grid; grid-template-rows: auto 1fr auto;
  min-height: 0;
  padding: 32px clamp(28px, 4vw, 56px);
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(143, 211, 255, 0.05), transparent 60%),
    linear-gradient(180deg, #060709, #040406);
  border-left: 1px solid var(--line);
  overflow: hidden auto;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.panel__head .logo svg { height: 21px; }
.panel__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  font: 400 12px/1.4 var(--sans); color: var(--ink-4);
}
.panel__foot a { color: var(--ink-3); text-decoration: none; transition: color 0.25s ease; }
.panel__foot a:hover { color: var(--ink); }
.panel__foot .status { margin-left: auto; color: var(--ink-3); }

.steps { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; padding: 40px 0; }
.step {
  grid-area: 1 / 1;
  width: 100%; max-width: 392px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 18px;
  visibility: hidden;
}
.step.is-active { visibility: visible; }
.step > * { opacity: 0; transform: translateY(14px); transition: opacity 0.35s ease, transform 0.45s var(--ease); }
.step.is-active > * { opacity: 1; transform: none; transition: opacity 0.8s ease calc(var(--k, 0) * 55ms + 120ms), transform 1s var(--ease) calc(var(--k, 0) * 55ms + 120ms); }
.step.is-leaving { visibility: visible; }
.step.is-leaving > * { opacity: 0; transform: translateY(-10px); transition: opacity 0.3s ease, transform 0.4s ease; }

.step__kicker { display: flex; align-items: center; gap: 10px; }
.step__title { font: 500 36px/1.06 var(--sans); letter-spacing: -0.04em; margin-top: 2px; }
.step__lead { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin-bottom: 8px; }
.step__lead b { color: var(--ink); font-weight: 500; }
.step__foot { font-size: 13px; color: var(--ink-3); line-height: 1.55; }
.step__foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-3); transition: border-color 0.25s ease; }
.step__foot a:hover { border-color: var(--ink); }
.step__foot .sep { margin: 0 10px; color: var(--ink-4); }

.input--xl { height: 54px; font-size: 16px; padding: 0 16px; border-radius: 12px; }
/* the password, with a button to show what was typed */
.field__pw { position: relative; }
.field__pw .input { width: 100%; padding-right: 56px; }
.pw-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.pw-eye svg { width: 19px; height: 19px; }
.pw-eye .eye-shut, .pw-eye[aria-pressed="true"] .eye-open { display: none; }
.pw-eye[aria-pressed="true"] .eye-shut { display: inline; }
.field__err { min-height: 18px; margin-top: -2px; font-size: 12.5px; color: #ff9b92; }
.field__err:empty { min-height: 0; margin: 0; }

.or { display: flex; align-items: center; gap: 14px; color: var(--ink-4); font: 500 10.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.textbtn { padding: 0; border: 0; background: none; color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line-3); }
.textbtn:disabled { color: var(--ink-4); border-color: transparent; cursor: default; }

.demo {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px;
  margin-top: 6px; padding: 8px 12px 8px 8px;
  border: 1px dashed var(--line-3); border-radius: 999px; background: none;
  color: var(--ink-2); font-size: 12.5px;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.demo:hover { border-color: var(--watch); color: var(--ink); }
.demo .label, .note .label { padding: 4px 7px; border-radius: 99px; background: rgba(143, 211, 255, 0.1); color: var(--watch); font-size: 9.5px; }
.note { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); }

/* Already signed in */
.signed { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(255, 255, 255, 0.025); }
.signed span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.signed b { font-weight: 500; font-size: 13.5px; }
.signed small { font-size: 12px; color: var(--ink-3); }
.signed[hidden] { display: none; }

/* Not invited */
.ring { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); margin-bottom: 6px; position: relative; }
.ring svg { width: 24px; height: 24px; }
.ring--warn { color: var(--repair); border-color: rgba(240, 196, 92, 0.32); background: radial-gradient(circle, rgba(240, 196, 92, 0.12), transparent 70%); }
.ring--warn::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 1px dashed rgba(240, 196, 92, 0.22); animation: spin 26s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* One-time code */
.otp { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; padding: 0; border: 0; min-width: 0; }
.otp input {
  flex: 1 1 0; min-width: 0; height: 64px; padding: 0;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center; font: 500 26px/1 var(--mono); color: var(--ink);
  caret-color: var(--watch); outline: none;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.35s var(--ease), transform 0.4s var(--spring);
}
.otp input:focus { border-color: rgba(143, 211, 255, 0.75); background: rgba(143, 211, 255, 0.05); box-shadow: 0 0 0 4px rgba(143, 211, 255, 0.1); }
.otp input.is-filled { border-color: var(--line-3); background: rgba(255, 255, 255, 0.045); animation: pop 0.35s var(--spring); }
.otp i { width: 10px; height: 1px; flex-shrink: 0; background: var(--line-3); }
.otp.is-bad input { border-color: rgba(255, 90, 78, 0.7); animation: shake 0.42s var(--ease-io); }
.otp.is-good input { border-color: rgba(143, 211, 255, 0.85); background: rgba(143, 211, 255, 0.08); color: var(--watch); }
@keyframes pop { 40% { transform: scale(1.06); } }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.shake { animation: shake 0.42s var(--ease-io); }

/* Signed in */
.step--done { align-items: center; text-align: center; }
.done-mark { width: 120px; height: 66px; margin-bottom: 10px; }
.done-mark svg { width: 100%; height: 100%; overflow: visible; }
.done-mark circle { fill: var(--ink); opacity: 0; transform: scale(0.2); transform-box: fill-box; transform-origin: center; }
.step--done.is-active .done-mark circle { animation: dot-in 0.7s var(--ease) forwards; animation-delay: calc(var(--i) * 45ms + 200ms); }
.step--done.is-active .mk-faint circle { animation-name: dot-in-faint; }
.step--done.is-active .mk-sat circle { fill: var(--watch); animation: dot-in 0.7s var(--ease) forwards, sat 1.6s ease-in-out 1.4s infinite; animation-delay: calc(var(--i) * 45ms + 200ms), 1.4s; }
@keyframes dot-in { to { opacity: 1; transform: none; } }
@keyframes dot-in-faint { to { opacity: 0.38; transform: none; } }
@keyframes sat { 50% { opacity: 0.35; } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50;
  max-width: min(92vw, 440px); padding: 12px 16px;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: rgba(14, 16, 21, 0.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  font-size: 13px; color: var(--ink-2);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease, transform 0.5s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Leaving for the workspace */
.curtain { position: fixed; inset: 0; z-index: 60; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity 0.9s ease; }
html.is-leaving .curtain { opacity: 1; }
html.is-leaving .visual__img { transform: scale(1.18); transition: transform 1.4s var(--ease-io); }

/* Load-in */
.panel__head, .panel__foot { opacity: 0; transition: opacity 1s ease 0.3s; }
html.is-ready .panel__head, html.is-ready .panel__foot { opacity: 1; }
html.is-loading .step.is-active > * { opacity: 0; transform: translateY(14px); }

/* --------------------------------------------------------------------------
   Small screens: the orbit view becomes a header band
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  body { overflow: auto; }
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; height: auto; min-height: 100%; }
  .visual { height: 34vh; min-height: 230px; }
  .visual__top { left: 22px; right: 22px; top: 20px; }
  .visual__caption { left: 22px; right: 22px; bottom: 26px; }
  .visual__caption .label { display: none; }
  .visual__caption h2 { font-size: 34px; }
  .visual__telemetry { display: none; }
  .panel { border-left: 0; border-top: 1px solid var(--line); padding: 22px 22px 26px; overflow: visible; }
  .steps { padding: 26px 0 34px; }
  .step__title { font-size: 30px; }
  .otp input { height: 56px; font-size: 22px; }
}
@media (max-width: 520px) {
  .signed { flex-wrap: wrap; }
  .signed .btn { width: 100%; }
  .visual__top .wide { display: none; } /* "ORA-3 · 550 km": whole, never cut off */
}
/* Phones: the orbit band shrinks with the screen, so the login, the password and Sign in all fit on the
   first screen, Safari's toolbar included. */
@media (max-width: 960px) and (max-height: 820px) {
  .visual { height: clamp(150px, 25vh, 230px); min-height: 0; }
  .visual__top { top: 16px; }
  .visual__caption { bottom: 18px; }
  .visual__caption h2 { font-size: clamp(26px, 7.4vw, 34px); }
  .panel { padding: 14px 22px 22px; }
  .steps { padding: 18px 0 26px; }
  .step { gap: 14px; }
  .step__title { font-size: 28px; }
}
@media (max-width: 960px) and (max-height: 600px) {
  .visual { height: 112px; }
  .visual__caption { bottom: 14px; }
  .visual__caption h2 { font-size: 24px; }
  .steps { padding: 14px 0 22px; }
  .step { gap: 12px; }
  .step__title { font-size: 26px; }
  .input--xl { height: 50px; }
}
