/* ============================================
   Sign-in page (views/site/login.php)
   Split screen: animated backdrop + intro on the left, floating card on the right.
   ============================================ */

:root {
    --login-accent: #ff6b35;
    --login-accent-light: #ff8c42;
    --login-accent-rgb: 255 107 53;
    --login-accent-deep: #d0440e;
    --login-head: #13304f;
    --login-glow: #1b4673;
    --login-bg-1: #13304f;
    --login-bg-2: #0c1c30;
    --login-bg-3: #141a26;
}

[data-theme="blue"] {
    --login-accent: #0277bd;
    --login-accent-light: #29a3e0;
    --login-accent-rgb: 41 163 224;
    --login-accent-deep: #01579b;
    --login-head: #0277bd;
    --login-glow: #0f6ca8;
    --login-bg-1: #0b4a75;
    --login-bg-2: #06304f;
    --login-bg-3: #082338;
}

[data-theme="green"] {
    --login-accent: #2e7d32;
    --login-accent-light: #4caf50;
    --login-accent-rgb: 76 175 80;
    --login-accent-deep: #1b5e20;
    --login-head: #1b5e20;
    --login-glow: #2c7a35;
    --login-bg-1: #17491d;
    --login-bg-2: #0d2f12;
    --login-bg-3: #0a2010;
}

[data-theme="dark"] {
    --login-glow: #1a2a3c;
    --login-head: #0a1119;
    --login-bg-1: #141e2b;
    --login-bg-2: #0a1119;
    --login-bg-3: #05080c;
}

.auth-body {
    margin: 0;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--login-bg-2);
}

.login-page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(ellipse at 10% 110%, rgb(var(--login-accent-rgb) / 22%) 0%, transparent 50%),
        radial-gradient(circle at 15% 10%, var(--login-glow) 0%, transparent 45%),
        linear-gradient(160deg, var(--login-bg-1) 0%, var(--login-bg-2) 60%, var(--login-bg-3) 100%);
}

/* ---------- Backdrop ---------- */
.backdrop {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.backdrop .chart {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.grid-line { stroke: rgb(255 255 255 / 5%); stroke-width: 1; }

.bars rect {
    fill: rgb(140 180 255 / 6%);
    transform-box: fill-box;
    transform-origin: bottom;
    animation: grow 6s ease-in-out infinite alternate;
}

.area { fill: url(#login-area); }

.trend {
    fill: none;
    stroke: rgb(var(--login-accent-rgb) / 35%);
    stroke-width: 2;
}

.trend-flow {
    fill: none;
    stroke: var(--login-accent-light);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 90 1100;
    animation: flow 7s linear infinite;
    filter: drop-shadow(0 0 6px rgb(var(--login-accent-rgb) / 70%));
}

.ticker {
    position: absolute;
    inset: 0;
    overflow: hidden;
    mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent);
    -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent);
}

.ticker-track {
    position: absolute;
    top: 0;
    right: -40px;
    width: 75%;
    rotate: -8deg;
    animation: drift 70s linear infinite;
}

.ticker p {
    margin: 0 0 38px;
    color: rgb(255 255 255 / 8%);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
}

.aurora { position: absolute; inset: 0; }

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.4;
    animation: wander 26s ease-in-out infinite alternate;
}

.blob.blue { top: -10%; left: 35%; width: 520px; height: 520px; background: #0067a8; }
.blob.orange { bottom: -18%; left: -8%; width: 460px; height: 460px; background: var(--login-accent); opacity: 0.22; animation-duration: 32s; }
.blob.teal { top: 40%; right: -10%; width: 420px; height: 420px; background: #4ecdc4; opacity: 0.18; animation-duration: 38s; animation-direction: alternate-reverse; }

.vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, transparent 0%, rgb(7 22 43 / 55%) 70%),
        linear-gradient(180deg, rgb(7 22 43 / 10%), rgb(7 22 43 / 75%));
}

/* ---------- Layout ---------- */
.layout {
    position: relative;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(400px, 1fr);
}

.intro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 48px 56px;
}

/* ---------- Theme ---------- */
.intro-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.intro-top .theme-picker { --theme-swatch-ring: #fff; animation: rise .7s ease both; }

#login-area stop { stop-color: var(--login-accent); }

/* the drawings set colours as attributes, so the theme overrides them by value */
.hero [fill="#d0440e"] { fill: var(--login-accent-deep); }
.hero [fill="#ff6b35"], .hero [fill="#ff8c42"] { fill: var(--login-accent-light); }
.hero [stroke="#ff8c42"] { stroke: var(--login-accent-light); }
.hero [fill="#13304f"] { fill: var(--login-head); }
.hero [stop-color="#ff8c42"] { stop-color: var(--login-accent-light); }
.hero [stop-color="#d0440e"] { stop-color: var(--login-accent-deep); }

/* ---------- The till and the devices, one at a time ---------- */
.hero-slides {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 640px;
}

.hero-slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s ease, visibility .8s;
}

.hero-slide.is-active { opacity: 1; visibility: visible; }

.hero-dots {
    grid-area: 2 / 1;
    display: flex;
    justify-content: center;
    gap: 2px;
}

.hero-dots button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.hero-dots button::before {
    content: '';
    display: block;
    width: 9px;
    height: 9px;
    margin: auto;
    border-radius: 50%;
    background: rgb(255 255 255 / 35%);
    transition: background .3s, transform .3s;
}

.hero-dots button.is-active::before { background: var(--login-accent-light); transform: scale(1.25); }

.hero-dots button:focus-visible { outline: 2px solid var(--login-accent-light); outline-offset: -2px; border-radius: 50%; }

.hero {
    display: block;
    width: 100%;
    max-height: 34vh;
    filter: drop-shadow(0 18px 28px rgb(0 0 0 / 30%));
    font-family: inherit;
    animation: rise .7s .2s ease both;
}

.hero-receipt { animation: feed 7s ease-out infinite alternate; }
.hero-receipt-short { animation: feed-short 5s ease-out infinite alternate; }
.hero-beam { animation: beam 1.1s ease-in-out infinite alternate; }
.hero-scanline { animation: sweep 1.6s ease-in-out infinite alternate; }
.hero-led { animation: blink 2.4s ease-in-out infinite; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    animation: rise .7s ease both;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--login-accent), var(--login-accent-light));
    box-shadow: 0 8px 20px rgb(var(--login-accent-rgb) / 35%);
    font-size: 22px;
}

.brand-name {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: .04em;
}

.intro-copy {
    max-width: 560px;
    animation: rise .8s .1s ease both;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px 14px;
    border: 1px solid rgb(255 255 255 / 14%);
    border-radius: 999px;
    background: rgb(255 255 255 / 6%);
    backdrop-filter: blur(8px);
    color: rgb(255 255 255 / 80%);
    font-size: 12.5px;
    letter-spacing: .04em;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--login-accent);
    animation: ping 2.4s ease-out infinite;
}

.intro-copy h1 {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(34px, 4.2vw, 56px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.03em;
}

.highlight {
    background: linear-gradient(90deg, var(--login-accent-light) 0%, var(--login-accent) 60%, var(--login-accent-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.intro-copy p {
    max-width: 470px;
    margin: 0 0 28px;
    color: rgb(255 255 255 / 70%);
    font-size: 16px;
    line-height: 1.65;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chips li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 12px;
    background: rgb(255 255 255 / 6%);
    backdrop-filter: blur(8px);
    color: rgb(255 255 255 / 88%);
    font-size: 13.5px;
}

.chips i { color: var(--login-accent-light); }

.clock-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgb(255 255 255 / 55%);
    font-size: 12.5px;
    animation: rise .8s .2s ease both;
}

.clock {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid rgb(255 255 255 / 14%);
    border-radius: 12px;
    background: rgb(255 255 255 / 7%);
    backdrop-filter: blur(8px);
}

.clock .time { color: #fff; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock .date { color: rgb(255 255 255 / 60%); }

/* ---------- Card ---------- */
.card-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 48px 24px 24px;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: auto 0;
    padding: 40px 40px 32px;
    border-radius: 22px;
    background: rgb(255 254 251 / 97%);
    color: #1f2937;
    box-shadow:
        0 30px 80px rgb(0 0 0 / 35%),
        0 8px 24px rgb(0 0 0 / 18%),
        inset 0 1px 0 rgb(255 255 255 / 60%);
    animation: rise .7s .15s cubic-bezier(.2, .8, .2, 1) both;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 40px;
    right: 40px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, #4ecdc4, var(--login-accent-light) 55%, var(--login-accent));
}

.card-logo {
    display: block;
    max-width: 200px;
    max-height: 70px;
    margin: 0 auto 22px;
    object-fit: contain;
}

.auth-card h2 {
    margin: 0 0 6px;
    text-align: center;
    color: #111827;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.025em;
}

.auth-card .lead {
    margin: 0 0 28px;
    font-weight: 400;
    text-align: center;
    color: #6b7280;
    font-size: 14.5px;
}

.auth-form .field { margin-bottom: 20px; }

.auth-form .field-label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap > i {
    position: absolute;
    left: 15px;
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 42px;
    border: 0;
    border-radius: 12px;
    background: #f7f5f1;
    box-shadow: 0 0 0 1px #e3ded5 inset;
    color: #111827;
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: box-shadow .15s ease, background .15s ease;
}

.input-wrap input::placeholder { color: #a8a29e; }
.input-wrap input:hover { box-shadow: 0 0 0 1px #cfc8bc inset; }

.input-wrap input:focus {
    background: #fff;
    box-shadow: 0 0 0 1px var(--login-accent) inset, 0 0 0 4px rgb(var(--login-accent-rgb) / 14%);
}

.input-wrap:focus-within > i { color: var(--login-accent); }

.field.is-error .input-wrap input {
    box-shadow: 0 0 0 1px #dc3545 inset, 0 0 0 4px rgb(220 53 69 / 12%);
}

.field-error {
    margin-top: 6px;
    color: #dc3545;
    font-size: 12.5px;
    font-weight: 600;
}

.field-error:empty { display: none; }

.reveal {
    position: absolute;
    right: 6px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
}

.reveal:hover { color: #374151; background: rgb(0 0 0 / 4%); }


.submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    margin-top: 6px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--login-accent-deep) 0%, var(--login-accent) 100%);
    box-shadow: 0 10px 24px rgb(var(--login-accent-rgb) / 32%);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgb(var(--login-accent-rgb) / 38%);
    filter: brightness(1.04);
}

.submit:focus-visible { outline: 3px solid rgb(var(--login-accent-rgb) / 35%); outline-offset: 3px; }
.submit:disabled { cursor: progress; opacity: .85; }
.submit-arrow { transition: transform .15s ease; }
.submit:hover .submit-arrow { transform: translateX(3px); }

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgb(255 255 255 / 40%);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.submit.is-busy .spinner { display: inline-block; }
.submit.is-busy .submit-arrow { display: none; }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 10px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.help {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
}

/* ---------- Footer bar ---------- */
.auth-footer {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 16px;
    padding: 14px 56px;
    border-top: 3px solid var(--login-accent);
    background: rgb(7 22 43 / 70%);
    backdrop-filter: blur(8px);
    color: rgb(255 255 255 / 65%);
    font-size: 12.5px;
}

/* ---------- Motion ---------- */
@keyframes feed { from { transform: translateY(125px); } 45%, to { transform: translateY(0); } }
@keyframes feed-short { from { transform: translateY(46px); } 45%, to { transform: translateY(0); } }
@keyframes sweep { from { transform: translateY(-10px); } to { transform: translateY(12px); } }
@keyframes beam { from { opacity: .15; } to { opacity: .42; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes wander { from { translate: 0 0; } to { translate: 60px 40px; } }
@keyframes drift { from { translate: 0 0; } to { translate: 0 -50%; } }
@keyframes flow { from { stroke-dashoffset: 1190; } to { stroke-dashoffset: 0; } }
@keyframes grow { from { scale: 1 .55; } to { scale: 1 1; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes ping {
    0% { box-shadow: 0 0 0 0 rgb(var(--login-accent-rgb) / 60%); }
    80%, 100% { box-shadow: 0 0 0 9px rgb(var(--login-accent-rgb) / 0%); }
}

@media (prefers-reduced-motion: reduce) {
    .blob, .pulse-dot, .brand, .intro-copy, .clock-wrap, .auth-card,
    .bars rect, .trend-flow, .ticker-track, .spinner, .hero, .hero-receipt, .hero-receipt-short, .hero-beam,
    .hero-scanline, .hero-led { animation: none; }
}

/* ---------- Short screens: the till stays, the sign-in stays in view ---------- */
@media (max-height: 800px) and (min-width: 961px) {
    .intro { gap: 20px; padding-top: 32px; padding-bottom: 32px; }
    .intro-copy p, .chips { display: none; }
}

/* ---------- Tablets and phones ---------- */
@media (max-width: 960px) {
    .layout { grid-template-columns: minmax(0, 1fr); align-content: start; }
    .intro { gap: 16px; padding: 28px 20px 8px; }
    .intro-copy p, .chips, .clock-wrap { display: none; }
    .intro-copy h1 { font-size: 26px; }
    .hero { max-height: 200px; }
    .eyebrow { margin-bottom: 12px; }
    .card-column { padding: 12px 16px 24px; }
    .auth-card { padding: 32px 22px 26px; border-radius: 18px; }
    .auth-card::before { left: 22px; right: 22px; }
    .auth-footer { justify-content: center; padding: 12px 16px; text-align: center; }
}

/* Phones: the sign-in comes first */
@media (max-width: 520px) {
    .hero-slides { display: none; }
}
