/*
Kerix VTU - sign in / create account
Color  #12142B ink · #FFFFFF surface · #F1F3F8 wash · #D9DDE8 line · #FFB020 marigold (focus, progress) · #0E7C5A jade · #C23B2B red
Type   Bricolage Grotesque (titles) / Instrument Sans (everything else), self-hosted
Shape  inputs and buttons 12px · segmented control 14px · nothing else is a card
Motion only where something changes: tab pill slide, step slide, field focus, error shake, verified tick, strength meter, one looping feed.
*/
html:has(.kx-auth), body:has(.kx-auth) { background: #fff; }
.kx-auth {
	--a-ink: #12142B; --a-text2: #454A66; --a-muted: #6B7089; --a-line: #D9DDE8; --a-wash: #F1F3F8;
	--a-gold: #FFB020; --a-jade: #0E7C5A; --a-red: #C23B2B; --a-red-tint: #FCEDEA;
	--a-ease: cubic-bezier(.22, .8, .24, 1);
	min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: #fff; color: var(--a-ink);
}
@media (min-width: 960px) { .kx-auth { grid-template-columns: minmax(480px, 1fr) minmax(0, 1fr); } }

.kxa-main { display: flex; justify-content: center; padding: 0 22px; }
.kxa-wrap { width: 100%; max-width: 420px; padding: 28px 0 56px; }
@media (min-width: 960px) { .kxa-main { align-items: center; } .kxa-wrap { padding: 48px 0; } }

.kxa-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.kxa-brand .kx-mark { width: 36px; height: 36px; border-radius: 10px; font-family: var(--kx-display); font-size: 19px; font-weight: 700; }
.kxa-brand-name { font-family: var(--kx-display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; }

/* ---- segmented control ---- */
.kxa-seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 30px; background: var(--a-wash); border-radius: 14px; }
.kxa-seg-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(18,20,43,.08), 0 2px 8px rgba(18,20,43,.06); transition: transform .28s var(--a-ease); }
.kxa-seg[data-active="register"] .kxa-seg-pill { transform: translateX(100%); }
.kxa-seg-btn { position: relative; z-index: 1; height: 42px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--a-muted); transition: color .2s ease; }
.kxa-seg-btn.is-active { color: var(--a-ink); }
.kxa-seg-btn:hover { color: var(--a-ink); }

/* ---- headings (the shared reset in app.css sets font-family/letter-spacing on h1 and p, so these need the extra class to win) ---- */
.kx-auth .kxa-title, .kx-auth .kxa-side-title { font-family: var(--kx-display); }
.kx-auth .kxa-title { letter-spacing: -.025em; }
.kx-auth .kxa-side-title { letter-spacing: -.03em; }
.kxa-title { font-family: var(--kx-display); font-weight: 700; font-size: 30px; line-height: 1.12; letter-spacing: -.025em; margin-bottom: 8px; }
.kxa-sub { color: var(--a-muted); font-size: 15px; line-height: 1.5; margin-bottom: 26px; max-width: 38ch; }

.kxa-panel:not([hidden]) { animation: kxa-rise .32s var(--a-ease) both; }
@keyframes kxa-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- form ---- */
.kxa-form { display: flex; flex-direction: column; gap: 18px; }
.kxa-step { display: flex; flex-direction: column; gap: 18px; }
.kxa-step:not([hidden]).from-right { animation: kxa-in-r .3s var(--a-ease) both; }
.kxa-step:not([hidden]).from-left { animation: kxa-in-l .3s var(--a-ease) both; }
@keyframes kxa-in-r { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes kxa-in-l { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }

.kxa-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.kxa-field label, .kxa-field > label { font-size: 13.5px; font-weight: 600; color: var(--a-text2); }
.kxa-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.kxa-hint-inline { display: block; margin-top: 2px; font-weight: 500; font-size: 12.5px; color: var(--a-muted); }
.kxa-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 340px) { .kxa-row { grid-template-columns: 1fr; } }
.kxa-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.kx-auth .kxa-field input:not([type="hidden"]), .kx-auth .kxa-field select {
	width: 100%; height: 50px; padding: 0 14px; font: inherit; font-size: 16px; font-weight: 500; color: var(--a-ink);
	background-color: #fff; border: 1.5px solid var(--a-line); border-radius: 12px;
	-webkit-appearance: none; appearance: none; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.kx-auth .kxa-field input::placeholder { color: #9AA0B7; font-weight: 400; }
.kx-auth .kxa-field input:hover:not(:focus):not([readonly]), .kx-auth .kxa-field select:hover:not(:focus) { border-color: #BFC5D6; }
.kx-auth .kxa-field input:focus, .kx-auth .kxa-field select:focus { outline: none; border-color: var(--a-ink); box-shadow: 0 0 0 4px rgba(255,176,32,.32); }
.kx-auth .kxa-field input[readonly] { background: var(--a-wash); color: var(--a-text2); }
.kx-auth .kxa-field.is-bad input:not([type="hidden"]) { border-color: var(--a-red); }
.kx-auth .kxa-field select { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7089' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.kx-auth .kxa-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; -webkit-text-fill-color: var(--a-ink); }

.kxa-msg { min-height: 0; font-size: 12.5px; font-weight: 500; line-height: 1.4; color: var(--a-muted); }
.kxa-msg:empty { display: none; }
.kxa-msg.is-ok { color: var(--a-jade); }
.kxa-msg.is-bad { color: var(--a-red); }

/* password + affixed inputs */
.kxa-pw, .kxa-affix { position: relative; }
.kx-auth .kxa-pw input, .kx-auth .kxa-affix input { padding-right: 46px; }
.kxa-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 9px; background: transparent; color: #7C829B; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: color .15s ease, background .15s ease; }
.kxa-eye:hover { color: var(--a-ink); background: var(--a-wash); }
.kxa-eye .off, .kxa-eye[aria-pressed="true"] .on { display: none; }
.kxa-eye[aria-pressed="true"] .off { display: block; }
.kxa-affix-ic { position: absolute; right: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; pointer-events: none; }
.kxa-affix-ic.is-wait::before { content: ""; display: block; width: 16px; height: 16px; margin: 2px; border: 2px solid var(--a-line); border-top-color: var(--a-ink); border-radius: 50%; animation: kxa-spin .7s linear infinite; }
.kxa-affix-ic.is-ok { color: var(--a-jade); animation: kxa-pop .3s var(--a-ease); }
.kxa-affix-ic.is-bad { color: var(--a-red); animation: kxa-pop .3s var(--a-ease); }
.kxa-affix-ic.is-ok::before { content: ""; display: block; width: 20px; height: 20px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; }
.kxa-affix-ic.is-bad::before { content: ""; display: block; width: 20px; height: 20px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center/contain no-repeat; }
@keyframes kxa-spin { to { transform: rotate(360deg); } }
@keyframes kxa-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

.kxa-inline { display: flex; gap: 10px; }
.kxa-inline input { flex: 1; min-width: 0; }

/* ---- buttons ---- */
.kxa-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 12px; border: 1.5px solid transparent; font: inherit; font-size: 15.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform .12s ease, background .15s ease, border-color .15s ease, opacity .15s ease, box-shadow .15s ease; }
.kxa-btn:active:not(:disabled) { transform: scale(.98); }
.kxa-btn:disabled { cursor: not-allowed; }
.kxa-btn-primary { background: var(--a-ink); color: #fff; box-shadow: 0 10px 20px -12px rgba(18,20,43,.7); }
.kxa-btn-primary:hover:not(:disabled) { background: #1E2250; }
.kxa-btn-primary:disabled { background: #C9CDDA; box-shadow: none; }
.kxa-btn-ghost { background: #fff; color: var(--a-ink); border-color: var(--a-line); font-size: 14.5px; }
.kxa-btn-ghost:hover:not(:disabled) { border-color: var(--a-ink); }
.kxa-btn-ghost:disabled { color: var(--a-muted); background: var(--a-wash); }
.kxa-btn-quiet { background: transparent; color: var(--a-text2); padding: 0 16px; }
.kxa-btn-quiet:hover { background: var(--a-wash); }
.kxa-actions { display: flex; gap: 10px; }
.kxa-actions .kxa-btn-primary { flex: 1; }
.kxa-btn-spin { display: none; width: 18px; height: 18px; border: 2.4px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: kxa-spin .7s linear infinite; }
.kxa-btn-ghost .kxa-btn-spin { border-color: var(--a-line); border-top-color: var(--a-ink); }
.kxa-btn.is-loading .kxa-btn-spin { display: inline-block; }
.kxa-btn.is-loading { pointer-events: none; }
.kxa-btn.is-done { background: var(--a-jade); }

.kxa-link { background: none; border: 0; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--a-ink); text-decoration: underline; text-decoration-color: rgba(18,20,43,.28); text-underline-offset: 3px; cursor: pointer; transition: text-decoration-color .15s ease; }
.kxa-link:hover { text-decoration-color: var(--a-gold); }
.kxa-switch { margin-top: 24px; font-size: 14px; color: var(--a-muted); }
.kxa-switch .kxa-link { font-size: 14px; }

/* ---- alert ---- */
.kxa-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--a-red-tint); color: #8E2A1D; font-size: 14px; line-height: 1.45; border-left: 3px solid var(--a-red); }
.kxa-alert svg { flex: none; margin-top: 1px; }
.kxa-alert.is-shake { animation: kxa-shake .36s ease; }
@keyframes kxa-shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* ---- stepper ---- */
.kxa-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 24px; padding: 0; }
.kxa-steps li { display: flex; flex-direction: column; gap: 8px; }
.kxa-steps-bar { position: relative; height: 4px; border-radius: 4px; background: var(--a-wash); overflow: hidden; }
.kxa-steps-bar::after { content: ""; position: absolute; inset: 0; background: var(--a-gold); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--a-ease); }
.kxa-steps li.is-done .kxa-steps-bar::after, .kxa-steps li.is-current .kxa-steps-bar::after { transform: scaleX(1); }
.kxa-steps li.is-done .kxa-steps-bar::after { background: var(--a-ink); }
.kxa-steps-name { font-size: 12.5px; font-weight: 500; color: var(--a-muted); transition: color .2s ease; }
.kxa-steps li.is-current .kxa-steps-name { color: var(--a-ink); font-weight: 700; }

/* ---- digit boxes (PIN and email code) ---- */
.kxa-digits { display: flex; gap: 8px; }
.kx-auth .kxa-digits input { flex: 1; min-width: 0; max-width: 64px; height: 54px; padding: 0; text-align: center; font: inherit; font-size: 22px; font-weight: 700; color: var(--a-ink); background: #fff; border: 1.5px solid var(--a-line); border-radius: 12px; -webkit-appearance: none; appearance: none; transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease; }
.kx-auth .kxa-digits input:focus { outline: none; border-color: var(--a-ink); box-shadow: 0 0 0 4px rgba(255,176,32,.32); }
.kx-auth .kxa-digits input.has-value { border-color: #9AA0B7; }
.kxa-digits.is-bad input { border-color: var(--a-red); }
.kxa-digits.is-shake { animation: kxa-shake .36s ease; }
.kxa-code:not([hidden]) { animation: kxa-rise .3s var(--a-ease) both; }

.kxa-verified { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 12px; background: #E6F4EE; color: var(--a-jade); font-size: 14.5px; font-weight: 600; }
.kxa-verified span { flex: 1; }
.kxa-verified:not([hidden]) { animation: kxa-rise .3s var(--a-ease) both; }
.kxa-verified .kxa-tick { stroke-dasharray: 20; stroke-dashoffset: 20; animation: kxa-draw .4s .1s var(--a-ease) forwards; }
@keyframes kxa-draw { to { stroke-dashoffset: 0; } }
.kxa-verified .kxa-link { color: var(--a-jade); }

/* ---- password strength ---- */
.kxa-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.kxa-meter i { height: 4px; border-radius: 4px; background: var(--a-wash); transition: background .25s ease; }
.kxa-meter[data-level="1"] i:nth-child(-n+1) { background: var(--a-red); }
.kxa-meter[data-level="2"] i:nth-child(-n+2) { background: #E08A00; }
.kxa-meter[data-level="3"] i:nth-child(-n+3) { background: #7FA22B; }
.kxa-meter[data-level="4"] i { background: var(--a-jade); }

/* ---- referral ---- */
.kxa-ref summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--a-text2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.kxa-ref summary::-webkit-details-marker { display: none; }
.kxa-ref summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s ease; }
.kxa-ref[open] summary::before { transform: rotate(45deg); }
.kxa-ref .kxa-field { margin-top: 12px; }

/* ---- right-hand panel (large screens) ---- */
.kxa-side { display: none; position: relative; overflow: hidden; background: var(--a-ink); color: #fff; }
@media (min-width: 960px) { .kxa-side { display: flex; align-items: center; justify-content: center; padding: 64px 56px; } }
.kxa-side::before { content: ""; position: absolute; inset: auto -20% -35% 10%; height: 70%; background: radial-gradient(closest-side, rgba(255,176,32,.22), transparent); }
.kxa-side-in { position: relative; width: 100%; max-width: 440px; }
.kxa-side-title { font-family: var(--kx-display); font-weight: 700; font-size: 44px; line-height: 1.05; letter-spacing: -.03em; margin-bottom: 16px; }
.kxa-side-copy { color: rgba(255,255,255,.72); font-size: 16px; line-height: 1.6; max-width: 40ch; margin-bottom: 34px; }
.kxa-feed { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.kxa-feed li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); animation: kxa-feed-in .6s calc(var(--i) * .12s + .15s) var(--a-ease) both; }
@keyframes kxa-feed-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.kxa-feed-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,176,32,.16); color: var(--a-gold); }
.kxa-feed-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kxa-feed-txt b { font-size: 15px; font-weight: 600; }
.kxa-feed-txt small { font-size: 13px; color: rgba(255,255,255,.55); }
.kxa-feed-state { position: relative; width: 84px; height: 24px; flex: none; }
.kxa-feed-state em { position: absolute; right: 0; top: 0; font-style: normal; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.kxa-feed-state .is-wait { background: rgba(255,255,255,.12); color: rgba(255,255,255,.75); animation: kxa-wait 9s calc(var(--i) * 1.6s + 1s) infinite; }
.kxa-feed-state .is-ok { background: rgba(14,124,90,.9); color: #fff; opacity: 0; animation: kxa-ok 9s calc(var(--i) * 1.6s + 1s) infinite; }
.kxa-feed li { --d: 0s; }
.kxa-feed-state .is-wait, .kxa-feed-state .is-ok { animation-delay: calc(var(--i) * 1.6s + 1s); }
@keyframes kxa-wait { 0%, 18% { opacity: 1; } 24%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes kxa-ok { 0%, 20% { opacity: 0; transform: scale(.9); } 28%, 88% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
	.kx-auth *, .kx-auth *::before, .kx-auth *::after { animation: none !important; transition: none !important; }
	.kxa-feed-state .is-wait { opacity: 0; }
	.kxa-feed-state .is-ok { opacity: 1; }
	.kxa-verified .kxa-tick { stroke-dashoffset: 0; }
}
