/* =========================================================
   Login / Register  (public/css/auth.css)  - Affinity Smart POS
   Desktop: ink art panel on the left, form on the right.
   Tablet and phone: art becomes a banner on top, form card below.
   Needs pos.css and animations.css (loaded by layouts/auth.blade.php).
   ========================================================= */

.auth { min-height: 100vh; background: var(--bg); }
.auth-shell { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }

/* ---------- Art panel ---------- */
.auth-art {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 24px);
    margin: 12px;
    padding: 38px 46px 0;
    color: #f4f2ee;
    background: #0d0f14;
    border-radius: 32px;
    animation: zoomIn .8s var(--ease, ease) backwards;
}
.art-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.art-mark { width: 46px; height: 46px; display: grid; place-items: center; font: 800 24px/1 var(--font); color: #fff; background: var(--accent); border-radius: 15px; box-shadow: var(--glow-sm); transform: rotate(-6deg); }
.art-brand b { display: block; font-size: 20px; line-height: 1.1; letter-spacing: -.03em; }
.art-brand small { display: block; font-size: 11.5px; letter-spacing: .08em; color: #aab0bd; }

.art-copy { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 470px; padding: 30px 0 170px; }
.art-copy h2 { margin: 0 0 16px; font-size: clamp(34px, 3.6vw, 56px); line-height: 1.04; letter-spacing: -.035em; color: #fff; }
.art-copy h2 .hl { color: var(--accent); }
.art-copy > p { max-width: 400px; margin: 0 0 26px; font-size: 16px; color: #aab0bd; }

.art-features { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.art-features li { display: flex; align-items: center; gap: 14px; font-weight: 500; color: #e9e7e2; animation: riseIn .6s var(--ease, ease) backwards; animation-delay: calc(var(--n) * 120ms + .5s); }
.art-features i { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; font-size: 19px; color: var(--accent); background: rgba(255, 255, 255, .08); border-radius: 13px; }

/* Skyline silhouette (from partials/skyline.blade.php) */
.skyline { position: absolute; right: 0; bottom: 0; z-index: 0; width: max(100%, 780px); height: auto; overflow: visible; pointer-events: none; }
.skyline .sun { animation: sunRise 1.6s var(--ease, ease) backwards; }
.skyline .win { animation: twinkle 3.4s ease-in-out infinite; }
.skyline .win:nth-child(2n) { animation-delay: 1.1s; }
.skyline .win:nth-child(3n) { animation-delay: 2.2s; animation-duration: 4.4s; }
.skyline .win:nth-child(5n) { animation: none; }
@keyframes sunRise { from { transform: translateY(70px); opacity: 0; } }
@keyframes twinkle { 50% { opacity: .3; } }

/* Floating receipt that "prints" */
.receipt-wrap { position: absolute; z-index: 2; right: 46px; top: 30%; width: 236px; filter: drop-shadow(0 26px 30px rgba(0, 0, 0, .5)); animation: receiptFloat 5.5s ease-in-out infinite; }
.receipt {
    position: relative;
    padding: 20px 18px 30px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #20232b;
    background: #fff;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), 95% 100%, 90% calc(100% - 9px), 85% 100%, 80% calc(100% - 9px), 75% 100%, 70% calc(100% - 9px), 65% 100%, 60% calc(100% - 9px), 55% 100%, 50% calc(100% - 9px), 45% 100%, 40% calc(100% - 9px), 35% 100%, 30% calc(100% - 9px), 25% 100%, 20% calc(100% - 9px), 15% 100%, 10% calc(100% - 9px), 5% 100%, 0 calc(100% - 9px));
}
.r-head { margin-bottom: 10px; padding-bottom: 10px; text-align: center; font-weight: 700; font-size: 13px; border-bottom: 1px dashed #c9cdd5; }
.r-line { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 12.5px; animation: lineIn .5s var(--ease, ease) backwards; animation-delay: calc(var(--n) * .35s + .7s); }
.r-total { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 10px; font-weight: 800; font-size: 15px; border-top: 1px dashed #c9cdd5; animation: lineIn .5s var(--ease, ease) 2s backwards; }
.r-stamp { position: absolute; right: 12px; bottom: 34px; padding: 1px 10px; font: 800 16px/1.3 var(--font); letter-spacing: .06em; color: #f06c1a; border: 3px solid #f06c1a; border-radius: 8px; transform: rotate(-14deg); animation: stampIn .5s var(--ease-bounce, ease) 2.5s backwards; }
@keyframes receiptFloat { 0%, 100% { transform: rotate(5deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-12px); } }
@keyframes lineIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes stampIn { from { opacity: 0; transform: rotate(-14deg) scale(2.4); } }

/* ---------- Form side ---------- */
.auth-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; padding: 22px 32px 24px; }
.auth-top { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.auth-top .alt { font-size: 14px; color: var(--muted); }
.auth-body { flex: 1; display: grid; place-items: center; padding: 20px 0; }

.auth-card {
    position: relative;
    width: min(100%, 450px);
    padding: 36px 34px 30px;
    background: var(--card);
    border-radius: 30px;
    box-shadow: var(--shadow);
    animation: riseIn .7s var(--ease, ease) .1s backwards;
}
.auth-title { margin: 0 0 6px; font-size: 32px; }
.auth-sub { margin: 0 0 26px; color: var(--muted); }

.auth-form .float-field { margin-bottom: 18px; }
.auth-form .form-control { height: 56px; padding: 0 16px; font-size: 16px; border-radius: 16px; }
.auth-form .float-field > label { top: 16px; }
.auth-form .has-toggle .form-control { padding-right: 56px; }

.pw-toggle { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; display: grid; place-items: center; font-size: 19px; color: var(--muted); background: transparent; border: 0; border-radius: 12px; cursor: pointer; transition: color .2s, background-color .2s; }
.pw-toggle:hover { color: var(--ink); background: var(--bg); }

.field-error { margin: -10px 4px 16px; font-size: 13px; font-weight: 500; color: var(--danger); animation: fadeIn .3s ease; }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 24px; font-size: 14px; }
.auth-row .sw { display: flex; align-items: center; gap: 10px; }
.auth-row .sw label:not(.switch) { cursor: pointer; }

.auth-link { font-weight: 600; color: color-mix(in srgb, var(--accent) 80%, #000); }
.auth-link:hover { text-decoration: underline; color: color-mix(in srgb, var(--accent) 80%, #000); }
[data-theme="dark"] .auth-link, [data-theme="dark"] .auth-link:hover { color: var(--accent); }

.auth-submit { min-height: 56px; font-size: 16px; border-radius: 16px; }
.auth-foot { margin: 22px 0 0; text-align: center; font-size: 14.5px; color: var(--muted); }
.auth-copy { margin: 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* Custom tick box */
.tick { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 22px; font-size: 14px; color: var(--muted); cursor: pointer; }
.tick input { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; display: grid; place-content: center; background: var(--card); border: 2px solid var(--line); border-radius: 8px; cursor: pointer; transition: background-color .2s, border-color .2s; }
.tick input::after { content: ""; width: 11px; height: 6px; margin-top: -3px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg) scale(0); transition: transform .25s var(--ease-bounce, ease); }
.tick input:checked { background: var(--accent); border-color: var(--accent); }
.tick input:checked::after { transform: rotate(-45deg) scale(1); }
.tick input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Password strength */
.meter4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: -6px 0 8px; }
.meter4 i { height: 6px; background: var(--line); border-radius: 6px; transition: background-color .3s; }
.meter4[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.meter4[data-level="2"] i:nth-child(-n+2) { background: var(--accent); }
.meter4[data-level="3"] i:nth-child(-n+3) { background: #8bc34a; }
.meter4[data-level="4"] i { background: var(--ok); }
.hint { display: block; margin: 0 2px 18px; font-size: 13px; color: var(--muted); }
.match { min-height: 20px; margin: -8px 2px 14px; font-size: 13px; font-weight: 500; }
.match.ok { color: var(--ok); }
.match.bad { color: var(--danger); }

/* ---------- Smaller laptops: hide the receipt so text never overlaps ---------- */
@media (max-width: 1199.98px) { .receipt-wrap { display: none; } }
@media (max-height: 700px) and (min-width: 992px) { .receipt-wrap { display: none; } .art-copy { padding-bottom: 120px; } }

/* ---------- Tablet and phone: art becomes a banner ---------- */
@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: minmax(0, 1fr); }
    .auth-art { min-height: 0; margin: 10px 10px 0; padding: 24px 26px 0; border-radius: 28px; }
    .art-copy { max-width: none; padding: 22px 0 108px; }
    .art-copy h2 { font-size: clamp(28px, 6vw, 40px); margin-bottom: 0; }
    .art-copy > p, .art-features { display: none; }
    .skyline { width: max(100%, 620px); }

    .auth-main { min-height: 0; padding: 0 16px 24px; }
    .auth-top { position: absolute; top: 24px; right: 26px; z-index: 5; }
    .auth-top .alt { display: none; }
    .auth-body { display: block; padding: 0; }
    .auth-card { width: min(100%, 520px); margin: -34px auto 0; padding: 30px 26px 26px; }
    .auth-copy { margin-top: 18px; }
}

@media (max-width: 479.98px) {
    .auth-art { margin: 8px 8px 0; padding: 20px 20px 0; border-radius: 24px; }
    .art-brand b { font-size: 18px; }
    .art-mark { width: 40px; height: 40px; font-size: 21px; border-radius: 13px; }
    .auth-top { top: 22px; right: 20px; }
    .auth-main { padding: 0 8px 20px; }
    .auth-card { padding: 26px 20px 22px; border-radius: 26px; }
    .auth-title { font-size: 27px; }
    .auth-row { margin-bottom: 20px; }
}

/* ---------- Shop-type tags in the art panel ---------- */
.art-copy > p.art-lead { margin-bottom: 14px; font-size: 17px; font-weight: 500; color: #e9e7e2; }
.art-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.art-tags .tag { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; font: inherit; font-size: 13.5px; font-weight: 500; color: #cfd3dc; background: rgba(255, 255, 255, .08); border: 0; border-radius: 999px; cursor: pointer; transition: background-color .25s, color .25s, transform .2s var(--ease, ease); }
.art-tags .tag:hover { color: #fff; transform: translateY(-2px); }
.art-tags .tag.on { color: #fff; background: var(--accent); box-shadow: var(--glow-sm); }
.art-tags .tag i { font-size: 15px; }

.r-head { line-height: 1.25; }
.r-head small { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; letter-spacing: .04em; color: #7a8190; }

@media (max-height: 780px) and (min-width: 992px) { .art-features { display: none; } .art-copy { padding-bottom: 130px; } }
@media (max-width: 991.98px) { .art-tags, .art-copy > p.art-lead { display: none; } }

/* ---------- Shop-type picker (register page) ---------- */
.field-label { display: block; margin: 2px 2px 10px; font-size: 14px; font-weight: 600; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 20px; }
.type-chip { position: relative; display: block; margin: 0; cursor: pointer; }
.type-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tc-body { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; text-align: center; background: var(--bg); border: 2px solid transparent; border-radius: 16px; transition: transform .2s var(--ease, ease), background-color .2s, border-color .2s; }
.tc-body i { font-size: 22px; color: var(--muted); transition: color .2s, transform .3s var(--ease-bounce, ease); }
.tc-body b { font-size: 12.5px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.type-chip:hover .tc-body { transform: translateY(-2px); }
.type-chip input:checked + .tc-body { background: var(--accent-soft); border-color: var(--accent); }
.type-chip input:checked + .tc-body i { color: var(--accent); transform: scale(1.18); }
.type-chip input:focus-visible + .tc-body { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Invalid fields: red border, red glow, red label ---------- */
.auth-form .form-control.is-invalid,
.auth-form .form-control.is-invalid:focus {
    background-image: none;                       /* hides Bootstrap's own icon so it never covers the eye button */
    border-color: var(--danger);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 16%, transparent);
}
.auth-form .has-toggle .form-control.is-invalid { padding-right: 56px; }
.float-field > .form-control.is-invalid + label,
.float-field > .form-control.is-invalid:focus + label { color: var(--danger); }
.auth-alert { margin: 0 0 20px; align-items: center; }
.auth-alert i { color: var(--danger); }