/* Ahpu login page. Layout: the logo line runs across a dark stage, carrying an order from table to paid, beside one solid sign-in card. */
:root {
    --night: #0a0c16;
    --night-2: #12152a;
    --blue: #29abe2;
    --violet: #8e4a9e;
    --paper: #ffffff;
    --ink: #151827;
    --muted: #666c80;
    --line: #dfe2ec;
    --error: #c81e3a;
    --good: #34d399;
    --font-display: "Sora", "Poppins", "Segoe UI", system-ui, sans-serif;
    --font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--night); color: #fff; font-family: var(--font-body); -webkit-font-smoothing: antialiased; }

.page { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(380px, 1fr); }

/* Stage */
.stage { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: min(24px, 2.6vh); padding: min(clamp(24px, 3.4vw, 48px), 5vh) clamp(24px, 3.4vw, 48px); isolation: isolate; }
.stage::before, .stage::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(90px); opacity: .5; animation: drift 16s ease-in-out infinite alternate; }
.stage::before { width: 56%; aspect-ratio: 1; left: -12%; top: -14%; background: var(--blue); opacity: .3; }
.stage::after { width: 62%; aspect-ratio: 1; right: -14%; bottom: -24%; background: var(--violet); animation-delay: -6s; }
@keyframes drift { to { transform: translate(7%, 6%) scale(1.1); } }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(255,255,255,.07); font-size: 13px; font-weight: 600; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); }

.hero { display: grid; gap: min(14px, 1.6vh); }
.wordmark { width: min(clamp(210px, 29vw, 390px), 40vh); height: auto; display: block; overflow: visible; }
.wordmark .stroke { fill: none; stroke: url(#ahpu-gradient); stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: write .55s cubic-bezier(.6, 0, .3, 1) both; }
.wordmark .s2 { animation-delay: .4s; } .wordmark .s3 { animation-delay: .75s; } .wordmark .s4 { animation-delay: 1.05s; } .wordmark .s5 { animation-delay: 1.35s; }
.wordmark .dot { transform-box: fill-box; transform-origin: center; animation: pop .4s 1.75s cubic-bezier(.3, 1.8, .5, 1) both; }
.wordmark .dot-start { animation-delay: .05s; }
@keyframes write { 0% { opacity: 0; stroke-dashoffset: 1; } 1% { opacity: 1; } 100% { opacity: 1; stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

h1 { margin: 0; font: 800 min(clamp(30px, 3.5vw, 50px), 6vh)/1.08 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.lead { margin: 0; max-width: 46ch; font-size: clamp(15px, 1.2vw, 17px); line-height: 1.5; color: #c6cadb; }

/* The order's journey */
.flow-area { flex: 1 1 0; min-height: 0; display: flex; align-items: center; container-type: size; }
.flow { position: relative; width: 100%; max-width: 780px; width: min(100cqw, 780px, 248cqh); aspect-ratio: 720 / 290; }
.flow svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.flow .base { fill: none; stroke: url(#flow-gradient); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: write 1.3s .9s ease-out both; }
.flow .glow { fill: none; stroke: url(#flow-gradient); stroke-width: 12; opacity: .16; filter: blur(5px); }
.node { fill: var(--night); stroke: #fff; stroke-width: 2.5; }
.spark { fill: #fff; filter: drop-shadow(0 0 7px #fff); }

.step { position: absolute; width: 21%; min-width: 128px; transform: translateX(-50%); display: grid; gap: 1px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: rgba(23, 27, 52, .72); backdrop-filter: blur(10px); animation: lit 8s infinite; }
.step small { font-size: 11px; font-weight: 600; letter-spacing: .03em; color: #aeb4cc; }
.step b { font: 700 14px/1.25 var(--font-display); }
.step span { font-size: 12px; color: #c6cadb; font-variant-numeric: tabular-nums; }
.step-1 { left: 11%; top: 76%; animation-delay: 2.2s; }
.step-2 { left: 35%; top: 34%; animation-delay: 4.3s; }
.step-3 { left: 62.5%; top: 52%; animation-delay: 6.3s; }
.step-4 { left: 88%; top: 37%; animation-delay: 8.5s; }
.step-4 b::after { content: " ✓"; color: var(--good); }
@keyframes lit {
    0%, 30%, 100% { border-color: rgba(255,255,255,.16); box-shadow: none; transform: translateX(-50%); }
    5%, 22% { border-color: var(--blue); box-shadow: 0 8px 26px rgba(41,171,226,.4); transform: translateX(-50%) translateY(-3px); }
}

.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #aeb4cc; }
.foot .meta { color: #8f95ad; }

.flow-phone { display: none; }
.flow-phone text { fill: #d5d9e8; font: 600 10px var(--font-body); text-anchor: middle; }
.flow-phone .base { fill: none; stroke: url(#flow-gradient-phone); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: write 1.1s .9s ease-out both; }

/* Sign-in */
.panel { position: relative; z-index: 1; display: grid; place-items: center; padding: clamp(20px, 3vw, 40px); background: linear-gradient(180deg, var(--night-2), var(--night)); border-left: 1px solid rgba(255,255,255,.08); }
.card { width: 100%; max-width: 400px; display: grid; gap: 18px; padding: clamp(22px, 2.6vw, 34px); border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 70px rgba(0,0,0,.45); animation: rise .7s .2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { transform: translateY(18px); opacity: .4; } to { transform: none; opacity: 1; } }

.client { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.client-mark { flex: none; width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: 11px; background: var(--ink); color: #fff; font: 700 13px var(--font-display); }
.client-logo { flex: none; width: 38px; height: 38px; object-fit: contain; border-radius: 11px; }
.client small { display: block; font-size: 12px; color: var(--muted); }
.client strong { font-size: 14px; font-weight: 700; }
h2 { margin: 0 0 2px; font: 700 25px/1.2 var(--font-display); letter-spacing: -.02em; }
.sub { margin: 0; font-size: 14px; color: var(--muted); }

form { display: grid; gap: 13px; }
.field { position: relative; }
.field input { width: 100%; height: 56px; padding: 22px 46px 7px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); font: 500 15px var(--font-body); outline: none; transition: border-color .15s, box-shadow .15s; }
.field label { position: absolute; left: 15px; top: 18px; font-size: 15px; color: var(--muted); pointer-events: none; transition: all .14s ease; }
.field input:focus, .field input:not(:placeholder-shown) { padding-top: 22px; }
.field input:focus + label, .field input:not(:placeholder-shown) + label { top: 8px; font-size: 11.5px; font-weight: 600; }
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(41,171,226,.16); }
.field.bad input { border-color: var(--error); animation: shake .32s; }
.form-error { margin: 0; padding: 9px 11px; border-radius: 10px; background: #fdecef; color: var(--error); font-size: 13px; font-weight: 500; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-3px); } }
.eye { position: absolute; right: 7px; top: 9px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
.eye:hover { background: #f0f1f6; color: var(--ink); }
.eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msg { display: block; min-height: 0; margin: 4px 0 0 2px; font-size: 13px; font-weight: 500; color: var(--error); }
.msg:empty { display: none; }
.caps { color: #a15c00; }

.go { position: relative; overflow: hidden; height: 54px; border: 0; border-radius: 13px; background: linear-gradient(100deg, #0e7ac4 0%, #3f62d6 45%, #7a3fc0 78%, #9b3fa8 100%); background-size: 170% 100%; background-position: 0 0; color: #fff; font: 700 15.5px var(--font-display); letter-spacing: .01em; cursor: pointer; transition: transform .12s, box-shadow .2s, background-position .45s ease; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 8px 20px rgba(63,98,214,.32); }
.go::before { content: ""; position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: 150px; height: 150px; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(255,255,255,.2), transparent 65%); opacity: 0; transition: opacity .2s; }
.go:hover::before { opacity: 1; }
.go:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 12px 28px rgba(122,63,192,.42); }
.go:active { transform: none; }
.go[disabled] { cursor: progress; opacity: .85; }
.go span { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.go:hover svg { transform: translateX(3px); }
.go[disabled] svg { display: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.field input:focus-visible { outline: none; }

/* Desktop: the page always fits the screen and never scrolls */
@media (min-width: 821px) and (min-height: 460px) {
    html, body { overflow: hidden; }
    .page { height: 100%; }
    .panel { overflow: hidden; }
}
@media (min-width: 821px) and (max-height: 700px) {
    .lead { display: none; }
    .card { gap: 12px; padding: 20px 26px; }
    .client { padding-bottom: 10px; }
    form { gap: 9px; }
    .field input { height: 50px; padding-top: 19px; }
    .field input:focus, .field input:not(:placeholder-shown) { padding-top: 19px; }
    .field label { top: 15px; }
    .eye { top: 6px; }
    .go { height: 48px; }
    h2 { font-size: 21px; }
    .step { padding: 5px 8px; min-width: 104px; }
    .step b { font-size: 12px; } .step span, .step small { font-size: 10px; }
}
@media (min-width: 821px) and (max-height: 540px) {
    .flow-area { display: none; }
    .foot { margin-top: auto; }
}

/* Tablet */
@media (max-width: 1080px) {
    .page { grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr); }
    .step { min-width: 112px; padding: 6px 9px; }
    .step b { font-size: 12.5px; } .step span, .step small { font-size: 10.5px; }
}
/* Phone and portrait tablet: wordmark on top, sign-in as a bottom sheet */
@media (max-width: 820px) {
    .page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .stage { padding: 20px 20px 44px; gap: 12px; }
    .wordmark { width: 180px; }
    h1 { font-size: 27px; }
    .lead, .foot, .step { display: none; }
    .flow-area { display: none; }
    .flow-phone { display: block; width: 100%; height: auto; overflow: visible; }
    .panel { margin-top: -30px; padding: 0; border: 0; background: var(--paper); border-radius: 26px 26px 0 0; place-items: start center; }
    .card { box-shadow: none; max-width: 480px; background: transparent; padding: 24px 20px 26px; animation: none; }
    .field input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .wordmark .stroke, .flow .base { stroke-dashoffset: 0; }
    .spark { display: none; }
}
/* Touch tablets: keep the glow still, it is the heaviest part to paint */
@media (hover: none) {
    .stage::before, .stage::after { animation: none; }
}
/* Older tablets without container queries: drop the wide line rather than risk it overflowing */
@supports not (container-type: size) {
    .flow-area { display: none; }
}

