/* Villife — sign in / sign up / QR confirmation */
@font-face { font-family: "VLF Montserrat"; font-weight: 600; font-display: swap; src: url("/lp/fonts/Montserrat-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "VLF Montserrat"; font-weight: 800; font-display: swap; src: url("/lp/fonts/Montserrat-ExtraBold.ttf") format("truetype"); }

.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth { position: relative; z-index: 1; flex: 1; display: grid; place-items: start center; padding: clamp(28px, 8vh, 88px) 20px 72px; }
.auth-wrap { width: min(440px, 100%); }

.auth-card { position: relative; padding: 28px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(130%); -webkit-backdrop-filter: blur(22px) saturate(130%); animation: auth-rise .6s var(--ease) both; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* tabs */
.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 28px; padding: 4px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.auth-tabs[hidden] { display: none; }
.auth-tabs a { position: relative; z-index: 1; padding: 10px 0; border-radius: 11px; color: var(--muted); font: 600 13.5px/1 var(--sans); text-align: center; transition: color .2s var(--ease); }
.auth-tabs a[aria-selected="true"] { color: var(--ink); }
.auth-tabs .thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 11px; background: var(--solid); box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .4s var(--ease); }
.auth-card[data-mode="signup"] .auth-tabs .thumb { transform: translateX(100%); }

/* views */
.auth-views { position: relative; }
.auth-views.animating { overflow: hidden; }
.auth-view[hidden] { display: none; }
.auth h1 { margin: 0 0 8px; font: 800 28px/1.12 "VLF Montserrat", var(--display); letter-spacing: -.035em; text-wrap: balance; }
.auth .sub { margin: 0 0 24px; color: var(--muted); font-size: 14.5px; line-height: 1.5; text-wrap: pretty; }
.auth .sub b { color: var(--ink); font-weight: 600; word-break: break-all; }

.auth-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 18px -4px; padding: 6px 10px 6px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 500 13.5px/1 var(--sans); cursor: pointer; transition: color .2s var(--ease), background-color .2s var(--ease); }
.auth-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .auth-back:hover { color: var(--ink); background: var(--surface-2); } }

/* fields */
.auth-field { display: block; margin: 0 0 14px; }
.auth-field[hidden] { display: none; }
.auth-field > span { display: block; margin: 0 0 7px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.auth-field > span em { color: var(--muted); font-style: normal; font-weight: 400; }
.auth-input { width: 100%; height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--ink); font: 400 15px/1 var(--sans); transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease); }
.auth-input::placeholder { color: var(--muted); }
.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent); }
.auth-input[aria-invalid="true"] { border-color: var(--danger); }
.pw-wrap { position: relative; }
.pw-wrap .auth-input { padding-right: 52px; }
.pw-eye { position: absolute; top: 0; right: 0; display: grid; width: 50px; height: 50px; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .pw-eye:hover { color: var(--ink); } }

/* buttons */
.auth-btn { display: flex; width: 100%; height: 50px; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 14px; font: 600 14.5px/1 var(--sans); cursor: pointer; transition: transform .12s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease); }
.auth-btn:active { transform: scale(.98); }
.auth-btn:disabled { opacity: .55; cursor: default; pointer-events: none; }
.auth-btn.primary { background: var(--ink); color: var(--on-ink); }
.auth-btn.quiet { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
.auth-btn svg { width: 20px; height: 20px; flex: none; }
.auth-btn svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-btn .spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: auth-spin .7s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (hover: hover) {
  .auth-btn.primary:hover { background: var(--accent); color: var(--on-accent); }
  .auth-btn.quiet:hover { border-color: color-mix(in srgb, var(--ink) 40%, transparent); background: var(--surface); }
}
.auth-link { display: block; margin: 14px auto 0; padding: 4px 6px; border: 0; background: transparent; color: var(--muted); font: 500 13.5px/1.3 var(--sans); cursor: pointer; transition: color .2s var(--ease); }
@media (hover: hover) { .auth-link:hover { color: var(--ink); } }
.auth-link:disabled { cursor: default; opacity: .7; }

.auth-sep { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; color: var(--muted); font-size: 12.5px; }
.auth-sep::before, .auth-sep::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.auth-methods { display: grid; gap: 10px; }

.auth-error { min-height: 0; margin: 0; color: var(--danger); font-size: 13px; line-height: 1.4; }
.auth-error:not(:empty) { margin: 12px 0 0; }
.auth-status { margin: 14px 0 0; color: var(--muted); font-size: 13.5px; text-align: center; line-height: 1.45; }
.auth-status.ok { color: var(--ok); }
.auth-status.err { color: var(--danger); }

/* code boxes */
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 0 0 16px; }
.code-boxes input { width: 100%; height: 58px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--ink); font: 700 24px/1 "VLF Montserrat", var(--sans); text-align: center; caret-color: var(--accent); transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.code-boxes input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent); }
.code-boxes input.filled { border-color: color-mix(in srgb, var(--ink) 38%, transparent); }
.code-boxes.bad input { border-color: var(--danger); animation: auth-shake .38s var(--ease); }
@keyframes auth-shake { 20% { transform: translateX(-5px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }

/* QR */
.qr-stage { position: relative; display: grid; width: 236px; height: 236px; margin: 4px auto 16px; place-items: center; border-radius: 22px; background: #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow); overflow: hidden; }
.qr-stage svg.qr { display: block; width: 100%; height: 100%; padding: 10px; }
.qr-stage .qr-skeleton { width: 44px; height: 44px; border: 3px solid #d5d8de; border-right-color: #12151b; border-radius: 50%; animation: auth-spin .8s linear infinite; }
.qr-cover { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; background: rgb(255 255 255 / .92); backdrop-filter: blur(4px); color: #12151b; text-align: center; font-size: 14px; font-weight: 500; }
.qr-cover.show { display: flex; }
.qr-cover button { height: 40px; padding: 0 18px; border: 0; border-radius: 12px; background: #12151b; color: #fff; font: 600 13.5px/1 var(--sans); cursor: pointer; }
.qr-cover .tick { width: 54px; height: 54px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; }
.qr-cover .tick svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.qr-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.qr-steps li { position: relative; padding-left: 36px; color: var(--ink-2); font-size: 14px; line-height: 1.45; counter-increment: step; }
.qr-steps li::before { content: counter(step); position: absolute; left: 0; top: -1px; display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 600; }

/* done */
.auth-done { text-align: center; }
.auth-done .avatar { margin-bottom: 16px; }
.auth-done h1 { margin-bottom: 6px; }
.auth-done .sub { margin-bottom: 24px; }
.auth-done .auth-btn + .auth-btn { margin-top: 10px; }

.auth-legal { margin: 18px 12px 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; text-align: center; text-wrap: balance; }
.auth-legal a { color: var(--ink-2); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); text-underline-offset: 3px; }
@media (hover: hover) { .auth-legal a:hover { color: var(--ink); } }

/* confirmation page (phone) */
.confirm-device { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); text-align: left; }
.confirm-device .ico { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border-radius: 12px; background: var(--solid); border: 1px solid var(--line); }
.confirm-device .ico svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.confirm-device strong { display: block; font-size: 15px; font-weight: 600; }
.confirm-device small { color: var(--muted); font-size: 12.5px; }
.confirm-warn { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-badge { display: grid; width: 64px; height: 64px; margin: 0 auto 18px; place-items: center; border-radius: 50%; }
.result-badge svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.result-badge.ok { background: var(--ok); }
.result-badge.no { background: var(--danger); }
.result-badge.wait { background: var(--surface-2); border: 1px solid var(--line); }
.result-badge.wait svg { stroke: var(--ink); }

@media (max-width: 480px) { .auth-card { padding: 22px 18px 24px; border-radius: 22px; } .auth h1 { font-size: 25px; } .code-boxes { gap: 6px; } .code-boxes input { height: 54px; font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .auth-card, .code-boxes.bad input { animation: none; } .auth-tabs .thumb { transition: none; } }
