/* Geopolitiks sign-in. Depends only on the base.css tokens (the Electron gate carries a copy of this file). */
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --r { syntax: "<length>"; inherits: false; initial-value: 75vmax; }

.acct { --base: 1.9s; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: radial-gradient(1200px 800px at 50% 40%, #0b1119, var(--bg) 70%); position: relative; overflow-x: hidden; }
html.intro-done .acct { --base: 0s; }

/* ---------- backdrop layers ---------- */
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; animation: fxIn 2.4s ease .2s both; }
.fx-grid { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(217,179,108,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(217,179,108,.07) 1px, transparent 1px);
  background-size: 64px 64px; background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 10%, transparent 75%);
  animation: gridIn 2s var(--ease) .1s both; }
.fx-vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 85% 85% at 50% 48%, transparent 40%, rgba(2,3,5,.85) 100%); }

.fx-frame { position: fixed; inset: 14px; z-index: 1; pointer-events: none; }
.fx-frame i { position: absolute; background: rgba(217,179,108,.22); }
.fx-frame__t, .fx-frame__b { left: 0; right: 0; height: 1px; transform: scaleX(0); animation: lineX 1.5s var(--ease-io) .15s forwards; }
.fx-frame__l, .fx-frame__r { top: 0; bottom: 0; width: 1px; transform: scaleY(0); animation: lineY 1.5s var(--ease-io) .3s forwards; }
.fx-frame__t { top: 0; } .fx-frame__b { bottom: 0; } .fx-frame__l { left: 0; } .fx-frame__r { right: 0; }

/* ---------- header ---------- */
.acct__top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: var(--s5) calc(var(--gutter) + 8px); animation: fadeUp 1s var(--ease) .6s backwards; }
.acct__status { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-label); font-size: 12px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.acct__status i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 10px 2px rgba(243,209,154,.6); animation: blip 2.4s ease-in-out infinite; }
.acct__back, .acct__link { font-family: var(--f-label); font-size: 13px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); transition: color .25s; }
.acct__back { position: relative; padding: 6px 0; }
.acct__back::after, .acct__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold-hi); transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.acct__back:hover, .acct__link:hover, .acct__back:focus-visible, .acct__link:focus-visible { color: var(--gold-hi); }
.acct__back:hover::after, .acct__link:hover::after, .acct__back:focus-visible::after, .acct__link:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.acct__link { position: relative; justify-self: start; padding: 6px 0; cursor: pointer; }
.acct :focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

/* ---------- stage ---------- */
.acct__main { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s5); padding: 72px var(--gutter) var(--s6); }

.hero { text-align: center; display: grid; justify-items: center; gap: var(--s3); }
.hero__plate { font-family: var(--f-label); font-size: 12px; font-weight: 600; letter-spacing: .5em; text-transform: uppercase; color: var(--gold); animation: plateIn 1.6s var(--ease) .5s backwards; }
.wm { display: block; font-family: var(--f-display); font-weight: 700; font-size: clamp(22px, 7.2vw, 58px); line-height: 1.05; letter-spacing: .3em; margin-right: -.3em; color: var(--text); white-space: nowrap; }
.wm__l { display: inline-block; animation: letterIn 1.1s var(--ease) calc(.7s + var(--i) * .075s) backwards, glowWave 5s ease-in-out calc(2.6s + var(--i) * .16s) infinite; }
.hero__rule { width: min(360px, 70vw); height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); transform: scaleX(0); animation: lineX 1.4s var(--ease) 1.5s forwards; }

/* ---------- card ---------- */
.acct__card { position: relative; width: 100%; max-width: 460px; padding: 28px; border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(15,21,30,.78), rgba(7,10,15,.88));
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.9), inset 0 1px 0 rgba(243,209,154,.08);
  animation: unfold 1.2s var(--ease) 1.3s backwards; }
/* corner brackets */
.acct__card::before { content: ""; position: absolute; inset: -7px; pointer-events: none; opacity: .9;
  background:
    linear-gradient(var(--gold-hi), var(--gold-hi)) top left / 18px 1px no-repeat, linear-gradient(var(--gold-hi), var(--gold-hi)) top left / 1px 18px no-repeat,
    linear-gradient(var(--gold-hi), var(--gold-hi)) top right / 18px 1px no-repeat, linear-gradient(var(--gold-hi), var(--gold-hi)) top right / 1px 18px no-repeat,
    linear-gradient(var(--gold-hi), var(--gold-hi)) bottom left / 18px 1px no-repeat, linear-gradient(var(--gold-hi), var(--gold-hi)) bottom left / 1px 18px no-repeat,
    linear-gradient(var(--gold-hi), var(--gold-hi)) bottom right / 18px 1px no-repeat, linear-gradient(var(--gold-hi), var(--gold-hi)) bottom right / 1px 18px no-repeat;
  animation: bracketIn 1.2s var(--ease) 2.2s backwards; }
/* light running around the border */
.acct__card::after { content: ""; position: absolute; inset: -1px; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--a), transparent 0 72%, rgba(217,179,108,.2) 82%, var(--gold-hi) 94%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin 7s linear infinite, fadeOnly 1.5s ease 2.2s backwards; }
.acct__card.is-shake { animation: shake .55s cubic-bezier(.36,.07,.19,.97) both; }
.acct__card > section { position: relative; }

.acct .label { display: block; font-family: var(--f-label); font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.acct__h { font-family: var(--f-display); font-weight: 700; font-size: var(--t-h3); line-height: 1.1; margin: 6px 0 var(--s4); color: var(--text); }
.acct__h.is-swap { animation: swapIn .55s var(--ease) both; }
.acct section:not([hidden]) > .label, .acct section:not([hidden]) > .acct__h { animation: rise .8s var(--ease) calc(var(--base) + .05s) backwards; }
.acct section:not([hidden]) > .acct__h.is-swap { animation: swapIn .55s var(--ease) both; }

/* tabs */
.acct__tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: var(--s4); border-bottom: 1px solid var(--line-soft); animation: rise .8s var(--ease) calc(var(--base) + .12s) backwards; }
.acct__tab { font-family: var(--f-label); font-size: 13px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); padding: var(--s3) 0; text-align: center; cursor: pointer; transition: color .3s; }
.acct__tab:hover { color: var(--muted); }
.acct__tab[aria-selected="true"] { color: var(--gold-hi); }
.acct__tabs::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 50%; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); box-shadow: 0 0 14px rgba(217,179,108,.7); transition: transform .6s var(--ease); }
.acct__tabs[data-mode="up"]::after { transform: translateX(100%); }

/* form */
.acct__form { display: grid; gap: 14px; }
.acct__form > * { animation: rise .8s var(--ease) calc(var(--base) + .2s) backwards; }
.acct__form > :nth-child(2) { animation-delay: calc(var(--base) + .28s); }
.acct__form > :nth-child(3) { animation-delay: calc(var(--base) + .34s); }
.acct__form > :nth-child(4) { animation-delay: calc(var(--base) + .4s); }
.acct__form > :nth-child(5) { animation-delay: calc(var(--base) + .46s); }
.acct__form.is-swap > * { animation: swapIn .55s var(--ease) both; }
.acct__form.is-swap > :nth-child(2) { animation-delay: .05s; } .acct__form.is-swap > :nth-child(3) { animation-delay: .1s; } .acct__form.is-swap > :nth-child(4) { animation-delay: .15s; } .acct__form.is-swap > :nth-child(5) { animation-delay: .2s; }

.acct__field { position: relative; display: grid; gap: var(--s2); }
.acct__field span { font-family: var(--f-label); font-size: 12px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); transition: color .3s, letter-spacing .5s var(--ease); }
.acct__field input { background: rgba(16,21,29,.7); border: 1px solid var(--line); border-radius: 0; color: var(--text); font: inherit; font-size: 17px; letter-spacing: normal; padding: 10px 14px; min-height: 48px; transition: border-color .3s, background .3s, box-shadow .4s; -webkit-appearance: none; appearance: none; }
.acct__field input:hover { border-color: var(--line-strong); }
.acct__field input:focus { outline: none; border-color: rgba(243,209,154,.55); background: rgba(20,27,38,.85); box-shadow: 0 0 0 4px rgba(217,179,108,.08), 0 12px 30px -16px rgba(217,179,108,.5); }
.acct__field:focus-within span { color: var(--gold-hi); letter-spacing: .3em; }
.acct__field::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); box-shadow: 0 0 12px rgba(243,209,154,.8); transform: scaleX(0); transform-origin: right; transition: transform .55s var(--ease), background .3s; pointer-events: none; }
.acct__field:focus-within::after { transform: scaleX(1); transform-origin: left; }
.acct__form.is-err .acct__field::after { background: #e8836b; box-shadow: 0 0 12px rgba(232,131,107,.8); transform: scaleX(1); transform-origin: left; }
.acct__form.is-err .acct__field input { border-color: rgba(232,131,107,.55); }
.acct__hint { margin-top: calc(var(--s2) * -1); font-family: var(--f-label); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }

/* primary button */
.go { position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px; font-family: var(--f-label); font-size: 14px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: #0a0805; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border: 1px solid var(--gold-hi); cursor: pointer; transition: transform .3s var(--ease), box-shadow .4s, opacity .3s, letter-spacing .4s var(--ease); }
.go::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.6) 50%, transparent 62%); transform: translateX(-130%); }
.go:hover:not(:disabled)::before, .go:focus-visible::before { transform: translateX(130%); transition: transform .9s var(--ease); }
.go:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(243,209,154,.35), 0 14px 44px -10px rgba(217,179,108,.65); letter-spacing: .32em; }
.go:active:not(:disabled) { transform: translateY(1px); }
.go::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(5,7,10,.34); transform: scaleX(0); transform-origin: left; }
.go.is-busy { cursor: progress; }
.go.is-busy::after { animation: progress 1.3s var(--ease-io) infinite; }
.go:disabled:not(.is-busy) { opacity: .4; cursor: not-allowed; }
.go--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.go--ghost::before { background: linear-gradient(105deg, transparent 38%, rgba(243,209,154,.22) 50%, transparent 62%); }
.go--ghost:hover:not(:disabled) { border-color: var(--gold-hi); box-shadow: 0 0 30px -10px rgba(217,179,108,.5); }
.go--ghost::after { background: rgba(217,179,108,.16); }

/* messages */
.acct__msg { position: relative; min-height: 1.4em; font-size: 16px; line-height: 1.4; color: var(--muted); margin: var(--s2) 0 0; padding-top: var(--s2); }
.acct__msg.is-err, .acct__msg.is-ok { animation: msgIn .5s var(--ease) both; }
.acct__msg.is-err { color: #f0907a; }
.acct__msg.is-ok { color: var(--gold-hi); }
.acct__msg.is-err::before, .acct__msg.is-ok::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; transform-origin: left; animation: lineX .7s var(--ease) both; }
.acct__msg.is-err::before { background: #e8836b; box-shadow: 0 0 10px rgba(232,131,107,.8); }
.acct__msg.is-ok::before { background: var(--gold-hi); box-shadow: 0 0 10px rgba(243,209,154,.7); }

/* signed-in */
.acct__who { color: var(--muted); font-size: 17px; margin: 0 0 var(--s5); word-break: break-all; }
.acct__lib { list-style: none; margin: 0 0 var(--s5); padding: 0; border-top: 1px solid var(--line-soft); counter-reset: lib; }
.acct__lib li { counter-increment: lib; display: flex; align-items: baseline; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); font-size: 18px; animation: rise .7s var(--ease) both; }
.acct__lib li::before { content: "No. 0" counter(lib); font-family: var(--f-label); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.acct__lib li span { flex: 1; color: var(--text); }
.acct__lib li:nth-child(2) { animation-delay: .08s; } .acct__lib li:nth-child(3) { animation-delay: .16s; } .acct__lib li:nth-child(4) { animation-delay: .24s; }
.acct__lib small { color: var(--dim); font-family: var(--f-label); letter-spacing: .12em; text-transform: uppercase; }
.acct__empty { color: var(--muted); margin: 0 0 var(--s5); }
.acct__row { display: flex; gap: var(--s3); flex-wrap: wrap; }
.acct__row .go { flex: 1 1 140px; }
[hidden] { display: none !important; }

/* ---------- iris wipe ---------- */
.iris { position: fixed; inset: 0; z-index: 950; pointer-events: none; visibility: hidden; display: grid; place-items: center; --r: 75vmax;
  background: radial-gradient(circle at 50% 50%, transparent var(--r), var(--gold-hi) var(--r), var(--gold-hi) calc(var(--r) + 2px), var(--bg) calc(var(--r) + 2px)); }
.iris.is-closing { visibility: visible; animation: irisClose .78s var(--ease-io) forwards; }
.iris.is-closed { visibility: visible; background: var(--bg); }
.iris.is-opening { visibility: visible; animation: irisOpen .9s var(--ease-io) forwards; }
.iris.iris--fade { background: var(--bg); opacity: 0; transition: opacity .3s; }
.iris.iris--fade.is-in { visibility: visible; opacity: 1; }
.iris__t { font-family: var(--f-display); font-weight: 700; font-size: clamp(18px, 3vw, 30px); letter-spacing: .5em; margin-right: -.5em; color: var(--gold-hi); opacity: 0; transition: opacity .5s ease .1s; }
.iris--hold.is-closed .iris__t, .iris--hold.is-in .iris__t { opacity: 1; animation: blip 1.6s ease-in-out infinite; }

/* ---------- keyframes ---------- */
@keyframes fxIn { from { opacity: 0; } }
@keyframes fadeOnly { from { opacity: 0; } }
@keyframes gridIn { from { opacity: 0; transform: scale(1.12); } }
@keyframes lineX { to { transform: scaleX(1); } }
@keyframes lineY { to { transform: scaleY(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(-10px); } }
@keyframes plateIn { from { opacity: 0; letter-spacing: 1em; } }
@keyframes letterIn { from { opacity: 0; transform: translateY(.45em) scale(.9); filter: blur(10px); } }
@keyframes glowWave { 0%, 60%, 100% { text-shadow: 0 0 0 rgba(243,209,154,0); } 30% { text-shadow: 0 0 22px rgba(243,209,154,.55); } }
@keyframes unfold { 0% { opacity: 0; clip-path: inset(50% -40px 50% -40px); } 35% { opacity: 1; clip-path: inset(49.4% -40px 49.4% -40px); } 100% { opacity: 1; clip-path: inset(-40px -40px -40px -40px); } }
@keyframes bracketIn { from { opacity: 0; inset: 8px; } }
@keyframes spin { to { --a: 360deg; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes swapIn { from { opacity: 0; transform: translateX(14px); } }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(5px); } 30%, 50%, 70% { transform: translateX(-9px); } 40%, 60% { transform: translateX(9px); } }
@keyframes progress { 0% { transform: scaleX(0); transform-origin: left; } 50% { transform: scaleX(1); transform-origin: left; } 50.01% { transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }
@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes irisClose { from { --r: 75vmax; } to { --r: 0px; } }
@keyframes irisOpen { from { --r: 0px; } to { --r: 75vmax; } }

/* ---------- short windows ---------- */
@media (max-height: 780px) {
  .acct__main { gap: var(--s4); padding-top: 56px; padding-bottom: var(--s4); }
  .hero { gap: var(--s2); }
  .hero__plate { display: none; }
  .wm { font-size: clamp(22px, 7.2vw, 44px); }
  .acct__card { padding: 22px 26px; }
  .acct__h { font-size: 26px; margin-bottom: var(--s3); }
  .acct__tabs { margin-bottom: var(--s3); }
  .acct__tab { padding: 8px 0; }
  .acct__form { gap: 10px; }
  .acct__field { gap: 6px; }
  .acct__field input { min-height: 44px; }
  .go { min-height: 48px; }
  .acct__link { padding: 2px 0; }
}

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  .acct__top { padding: var(--s4) var(--gutter); }
  .acct__main { gap: var(--s5); padding-bottom: var(--s7); justify-content: flex-start; padding-top: 72px; }
  .acct__card { padding: var(--s5); }
  .hero__plate { letter-spacing: .32em; font-size: 11px; }
  .fx-frame { inset: 8px; }
}

/* ---------- reduced motion: fades only ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-canvas, .fx-grid, .acct__top, .hero__plate, .hero__rule, .acct__card, .acct__card::before, .acct__card::after,
  .acct section:not([hidden]) > .label, .acct section:not([hidden]) > .acct__h, .acct__tabs, .acct__form > *, .acct__lib li, .wm__l { animation: fadeOnly .5s ease both !important; }
  .fx-frame i, .hero__rule { animation: none !important; transform: none; }
  .acct__card::after { --a: 200deg; }
  .acct__status i, .go.is-busy::after { animation: none !important; }
  .go.is-busy::after { transform: scaleX(.5); }
  .acct__card.is-shake { animation: none !important; outline: 1px solid #e8836b; }
  .acct__tabs::after, .acct__field::after { transition: none; }
  .go, .acct__field input, .acct__field span { transition: none; }
  .go::before { display: none; }
}
