/*
 * Login / register popup (frontend/partials/auth-popup + livewire/auth-popup)
 * and the /login page (frontend/login/index), from the design popup.html.
 *
 * Everything sits under .za (the <dialog>) or .za-page and every class is
 * za-, so nothing here touches the rest of the site. Element resets use
 * :where() (no specificity) to cancel the theme's global rules (body
 * line-height 30px, h1/h2 sizes and margins, p margins, label/input styles)
 * while the component classes below always win.
 */
.za,
.za-page {
    --za-brand: #222222;
    --za-brand-2: #555555;
    --za-brand-rgb: 34, 34, 34;
    --za-required: #e5304a;
    --za-error: #c8102e;
    --za-ink: #222222;
    --za-ink-2: #4a4a4a;
    --za-muted: #6b6b6b;
    --za-line: #e5e5e5;
    --za-ease: cubic-bezier(.22, 1, .36, 1);
    --za-font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

:where(.za, .za-page),
:where(.za, .za-page) *,
:where(.za, .za-page) *::before,
:where(.za, .za-page) *::after { box-sizing: border-box; }

:where(.za, .za-page) :is(h1, h2, p, form, label, button, input, nav) {
    margin: 0;
    font-family: inherit;
    letter-spacing: normal;
    text-transform: none;
}

:where(.za, .za-page) a { color: inherit; }

html.za-lock { overflow: hidden; }

/* ═════════ POPUP (native <dialog>) ═════════ */
.za:not([open]) { display: none; } /* also for browsers without <dialog> */

dialog.za {
    border: 0;
    padding: 0;
    margin: auto;
    background: transparent;
    max-width: none;
    max-height: none;
    overflow: visible;
    color: var(--za-ink);
    font-family: var(--za-font);
    font-size: 16px;
    line-height: 1.45;
}
dialog.za::backdrop {
    background: rgba(20, 20, 22, .45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .3s ease;
}
dialog.za.is-in::backdrop { opacity: 1; }

.za-sheet {
    position: relative;
    width: min(94vw, 480px);
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-radius: 28px;
    padding: 36px 34px 30px;
    box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .45);
    opacity: 0;
    transform: translateY(40px) scale(.94);
    transition: opacity .35s ease, transform .5s var(--za-ease);
}
.za.is-in .za-sheet { opacity: 1; transform: none; }
.za-sheet::before { /* thin animated brand line on top */
    content: "";
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--za-brand), #9a9a9a, var(--za-brand));
    background-size: 200% 100%;
    animation: za-flow 3.5s linear infinite;
}
@keyframes za-flow { to { background-position: -200% 0; } }

.za-sr { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }

.za .za-x {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: #f1f1f1;
    color: var(--za-ink);
    display: grid;
    place-items: center;
    transition: transform .35s var(--za-ease), background .2s;
}
.za .za-x:hover { background: #e4e4e4; transform: rotate(90deg); }
.za-x svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }

/* the header's logo (logo.png), at the header's size */
.za-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.za .za-brand img { display: block; width: auto; height: 38px; max-width: 60%; }

/* tabs (radio driven, as in the design) */
.za .za-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #eee;
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 22px;
}
.za .za-tabs label {
    position: relative;
    z-index: 1;
    display: block;
    text-align: center;
    padding: 11px 8px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: var(--za-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: color .3s;
    -webkit-user-select: none;
    user-select: none;
}
.za-ind {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .28);
    transition: transform .45s var(--za-ease);
}
#za-t-login:checked ~ .za-body .za-top label[for="za-t-login"],
#za-t-reg:checked ~ .za-body .za-top label[for="za-t-reg"],
#za-m-phone:checked ~ .za-body .za-sub label[for="za-m-phone"],
#za-m-email:checked ~ .za-body .za-sub label[for="za-m-email"] { color: var(--za-ink); }
#za-t-reg:checked ~ .za-body .za-top .za-ind,
#za-m-email:checked ~ .za-body .za-sub .za-ind { transform: translateX(100%); }
#za-t-login:focus-visible ~ .za-body .za-top label[for="za-t-login"],
#za-t-reg:focus-visible ~ .za-body .za-top label[for="za-t-reg"],
#za-m-phone:focus-visible ~ .za-body .za-sub label[for="za-m-phone"],
#za-m-email:focus-visible ~ .za-body .za-sub label[for="za-m-email"] { outline: 3px solid var(--za-brand); outline-offset: 1px; }

.za-view,
.za-pane { display: none; animation: za-pane-in .5s var(--za-ease) both; }
#za-t-login:checked ~ .za-body .za-view-login,
#za-t-reg:checked ~ .za-body .za-view-reg,
#za-m-phone:checked ~ .za-body .za-pane-phone,
#za-m-email:checked ~ .za-body .za-pane-email { display: block; }
@keyframes za-pane-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

.za .za-h { margin: 0 0 4px; font: 800 26px/1.2 var(--za-font); letter-spacing: -.02em; color: var(--za-ink); }
.za .za-lead { margin: 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--za-muted); }
.za .za-notice {
    margin: -6px 0 18px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #eef6f0;
    color: #1d6b3a;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;
}

/* floating-label fields */
.za .za-field { position: relative; margin-bottom: 16px; }
.za .za-field input {
    display: block;
    width: 100%;
    height: 58px;
    margin: 0;
    padding: 22px 18px 6px;
    font: 500 16px/1.2 var(--za-font);
    color: var(--za-ink);
    background: #fafafa;
    border: 1.5px solid var(--za-line);
    border-radius: 14px;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .25s, box-shadow .25s, background .25s;
}
.za .za-field input::placeholder { color: transparent; }
.za .za-field label {
    position: absolute;
    left: 18px;
    top: 19px;
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
    color: var(--za-muted);
    pointer-events: none;
    transform-origin: left top;
    transition: transform .25s var(--za-ease), color .25s;
}
.za .za-field label i { color: var(--za-required); font-style: normal; margin-left: 2px; }
.za .za-field input:focus + label,
.za .za-field input:not(:placeholder-shown) + label { transform: translateY(-11px) scale(.76); }
.za .za-field input:focus + label { color: var(--za-brand); }
.za .za-field input:hover { border-color: #c9c9c9; }
.za .za-field input:focus { background: #fff; border-color: var(--za-brand); box-shadow: 0 0 0 5px rgba(var(--za-brand-rgb), .1); }
.za .za-field.is-bad input { border-color: var(--za-error); background: #fff; }
.za .za-field.is-bad input:focus { box-shadow: 0 0 0 5px rgba(200, 16, 46, .12); }
.za .za-with-btn input { padding-right: 150px; }

.za .za-inline {
    position: absolute;
    right: 8px;
    top: 8px;
    height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font: 700 14px/1 var(--za-font);
    color: var(--za-brand);
    background: rgba(var(--za-brand-rgb), .07);
    white-space: nowrap;
    transition: background .2s, transform .2s, opacity .2s;
}
.za .za-inline:hover { background: rgba(var(--za-brand-rgb), .14); }
.za .za-inline:active { transform: scale(.95); }
.za .za-inline:disabled { cursor: default; color: var(--za-muted); background: rgba(var(--za-brand-rgb), .05); transform: none; }
.za .za-inline.is-busy { opacity: .55; cursor: progress; }

.za .za-prefix {
    position: absolute;
    left: 18px;
    top: 19px;
    font-size: 16px;
    line-height: 20px;
    font-weight: 600;
    color: var(--za-ink-2);
    pointer-events: none;
    transition: transform .25s var(--za-ease);
}
.za .za-has-prefix input { padding-left: 58px; }
.za .za-has-prefix label { left: 58px; }
.za .za-has-prefix input:focus ~ .za-prefix,
.za .za-has-prefix input:not(:placeholder-shown) ~ .za-prefix { transform: translateY(5px); }
.za .za-has-prefix input:focus + label,
.za .za-has-prefix input:not(:placeholder-shown) + label { transform: translate(-40px, -11px) scale(.76); }

.za .za-err { margin: 6px 2px 0; font-size: 13px; line-height: 1.45; font-weight: 500; color: var(--za-error); }
.za .za-err-solo { margin: -4px 2px 14px; }
.za .za-err .za-link { margin-left: 4px; font-size: 13px; color: var(--za-ink); }

.za .za-btn {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 56px;
    margin: 0;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    color: #fff;
    font: 700 16px/1 var(--za-font);
    background: var(--za-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 14px 28px -12px rgba(0, 0, 0, .55);
    transition: transform .3s var(--za-ease), box-shadow .3s var(--za-ease);
}
.za .za-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(110deg, var(--za-brand), var(--za-brand-2), var(--za-brand), var(--za-brand-2));
    background-size: 300% 100%;
    transition: opacity .35s;
    animation: za-flow 4s linear infinite;
}
.za .za-btn::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .4), transparent);
    transform: skewX(-20deg);
}
.za .za-btn:hover { transform: translateY(-3px); box-shadow: 0 20px 34px -12px rgba(0, 0, 0, .45); }
.za .za-btn:hover::before { opacity: 1; }
.za .za-btn:hover::after { animation: za-sweep .9s var(--za-ease); }
.za .za-btn:active { transform: scale(.98); }
.za .za-btn:disabled { cursor: progress; }
.za-btn span,
.za-btn svg,
.za-btn .za-spin { position: relative; z-index: 1; }
.za-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--za-ease); }
.za .za-btn:hover svg { transform: translateX(5px); }
@keyframes za-sweep { to { left: 130%; } }

.za-spin {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.4px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: za-spin .7s linear infinite;
}
.za-btn.is-busy svg { display: none; }
.za-btn.is-busy .za-spin { display: block; }
@keyframes za-spin { to { transform: rotate(360deg); } }

.za .za-pill:focus-visible,
.za .za-x:focus-visible,
.za .za-btn:focus-visible,
.za .za-inline:focus-visible,
.za .za-link:focus-visible { outline: 3px solid var(--za-brand); outline-offset: 3px; }

.za .za-aside { margin: -4px 0 16px; text-align: right; font-size: 13px; line-height: 1.4; }
.za .za-link {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--za-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.za .za-note { margin: 2px 0 18px; font-size: 13px; line-height: 1.65; color: var(--za-muted); }
.za .za-note a { color: var(--za-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.za .za-switch { margin: 24px 0 0; text-align: center; font-size: 14px; line-height: 1.5; color: var(--za-muted); }
.za .za-switch label,
.za .za-switch .za-link { display: inline; color: var(--za-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }

@media (max-width: 560px) { /* phones: slide-up bottom sheet */
    dialog.za { margin: auto 0 0; width: 100%; max-width: 100%; }
    .za-sheet {
        width: 100%;
        border-radius: 26px 26px 0 0;
        padding: 32px 22px 26px;
        padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px));
        max-height: 94vh;
        max-height: 94dvh;
        transform: translateY(100%);
    }
    .za .za-brand img { height: 30px; }
}

/* ═════════ /login page ("My account") ═════════ */
.za-page {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #f6f6f6;
    color: var(--za-ink);
    font-family: var(--za-font);
}
.za-page-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.za-blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .6; animation: za-float 20s ease-in-out infinite; }
.za-b1 { width: 460px; height: 460px; background: #e4e4e6; top: -120px; left: -80px; }
.za-b2 { width: 520px; height: 520px; background: #d8d8dc; top: 30%; right: -160px; animation-delay: -6s; animation-duration: 24s; }
.za-b3 { width: 380px; height: 380px; background: #ececea; bottom: -140px; left: 30%; animation-delay: -12s; animation-duration: 28s; }
.za-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0, 0, 0, .09) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
@keyframes za-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, 40px) scale(1.08); }
    66% { transform: translate(-40px, 70px) scale(.94); }
}

.za-page .za-hero {
    min-height: min(68vh, 620px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 72px 20px 80px;
    line-height: 1.5;
}
.za-page .za-hero h1 {
    margin: 0;
    font: 800 clamp(38px, 7vw, 68px)/1.1 var(--za-font);
    letter-spacing: -.03em;
    background: linear-gradient(100deg, var(--za-ink) 25%, #8c8c8c 55%, var(--za-ink) 85%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: za-shine 6s linear infinite, za-down .8s var(--za-ease) both;
}
@keyframes za-shine { to { background-position: -200% center; } }
@keyframes za-down { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }

.za-page .za-crumbs { margin-top: 10px; display: inline-flex; gap: 10px; align-items: center; font-size: 15px; line-height: 1.5; color: var(--za-muted); }
.za-page .za-crumbs a { color: inherit; text-decoration: none; }
.za-page .za-crumbs a:hover { color: var(--za-ink); }
.za-page .za-crumbs svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.za-page .za-hero p { max-width: 520px; margin: 28px auto; font-size: 16px; line-height: 1.7; color: var(--za-ink-2); animation: za-rise .9s .2s var(--za-ease) both; }
.za-page .za-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; animation: za-rise .9s .35s var(--za-ease) both; }
@keyframes za-rise { from { opacity: 0; transform: translateY(30px) scale(.98); } to { opacity: 1; transform: none; } }

.za-page .za-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    background: var(--za-brand);
    color: #fff;
    font: 700 15px/1 var(--za-font);
    text-decoration: none;
    box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .55);
    transition: transform .3s var(--za-ease), box-shadow .3s var(--za-ease), background .2s, color .2s;
}
.za-page .za-pill svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.za-page .za-pill:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 28px -10px rgba(0, 0, 0, .5); }
.za-page .za-pill:active { transform: scale(.97); }
.za-page .za-pill.za-ghost { background: transparent; color: var(--za-ink); box-shadow: inset 0 0 0 1.5px var(--za-ink); }
.za-page .za-pill.za-ghost:hover { background: var(--za-ink); color: #fff; }
.za-page .za-pill:focus-visible { outline: 3px solid var(--za-brand); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    .za *, .za *::before, .za *::after, dialog.za::backdrop,
    .za-page *, .za-page *::before, .za-page *::after { animation: none !important; transition: none !important; }
}
