/* ==========================================================================
   Ven868 — dark glass authentication pages
   Used by user-login.php and user-registrar1.php
   ========================================================================== */

:root {
    --auth-blue: #2f9cf4;
    --auth-blue-hover: #0b87ec;
    --auth-cyan: #67e8f9;
    --auth-ink: #f8fafc;
    --auth-muted: #cbd5e1;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    color-scheme: dark;
}

body.auth-page {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: clamp(1rem, 4vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    background-color: #020617;
    background-image:
        radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.22), transparent 32%),
        radial-gradient(circle at 85% 85%, rgba(249, 115, 22, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.58), rgba(2, 6, 23, 0.84)),
        url('../images/background/bea5.jpg');
    background-position: center, center, center, center;
    background-size: auto, auto, auto, cover;
    background-repeat: no-repeat;
    color: var(--auth-ink);
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    width: 100%;
}

.auth-panel {
    position: relative;
    width: 100%;
    max-width: 28rem;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 1.5rem;
    background: rgba(2, 6, 23, 0.58);
    box-shadow:
        0 32px 80px -24px rgba(2, 6, 23, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(22px) saturate(135%);
    -webkit-backdrop-filter: blur(22px) saturate(135%);
    color: var(--auth-ink);
    animation: auth-panel-in 0.5s ease-out both;
}

.auth-panel--wide {
    max-width: 32rem;
}

.auth-header {
    margin-bottom: 1.75rem;
    text-align: center;
}

.auth-logo {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #06b6d4, #2563eb 55%, #f97316);
    color: #fff;
    font-size: 1.5rem;
    box-shadow:
        0 14px 30px -12px rgba(6, 182, 212, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.auth-brand {
    margin: 0;
    color: #fff;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: clamp(1.8rem, 6vw, 2.2rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
}

.auth-brand-accent {
    background: linear-gradient(90deg, #22d3ee, #60a5fa 55%, #fb923c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-subtitle {
    margin: 0.65rem 0 0;
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-form {
    display: grid;
    gap: 1.1rem;
    margin: 0;
}

.auth-field {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.auth-label {
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    z-index: 1;
    color: rgba(255, 255, 255, 0.58);
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
}

.auth-input {
    width: 100%;
    min-height: 3rem;
    padding: 0.78rem 1rem 0.78rem 2.8rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    outline: none;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    caret-color: var(--auth-cyan);
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.52);
    opacity: 1;
}

.auth-input:hover {
    background: rgba(255, 255, 255, 0.13);
}

.auth-input:focus {
    border-color: rgba(103, 232, 249, 0.85);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.18);
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #0b172a inset;
    box-shadow: 0 0 0 1000px #0b172a inset;
    caret-color: #fff;
    transition: background-color 9999s ease-out 0s;
}

.auth-input::-ms-reveal {
    filter: invert(1);
}

.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 0;
    border-radius: 999px;
    background: var(--auth-blue);
    color: #fff;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 30px -14px rgba(47, 156, 244, 0.75);
    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.auth-submit:hover {
    background: var(--auth-blue-hover);
    box-shadow: 0 18px 36px -14px rgba(11, 135, 236, 0.8);
    transform: translateY(-1px);
}

.auth-submit:active {
    transform: translateY(0) scale(0.99);
}

.auth-submit:focus-visible {
    outline: 3px solid rgba(125, 211, 252, 0.6);
    outline-offset: 3px;
}

.auth-switch {
    margin: 0.15rem 0 0;
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.86rem;
    line-height: 1.6;
    text-align: center;
}

.auth-link {
    color: #7dd3fc;
    font-weight: 600;
    text-decoration: none;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #bae6fd;
    text-decoration: underline;
}

.auth-link:focus-visible {
    outline: 3px solid rgba(125, 211, 252, 0.6);
    outline-offset: 3px;
    border-radius: 4px;
}

@keyframes auth-panel-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .auth-panel {
        background: rgba(2, 6, 23, 0.94);
    }
}

@media (max-width: 520px) {
    body.auth-page {
        padding: 1rem;
    }

    .auth-panel {
        padding: 1.4rem;
        border-radius: 1.25rem;
    }

    .auth-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 380px) {
    .auth-brand {
        font-size: 1.65rem;
    }

    .auth-panel {
        padding: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-panel {
        animation: none;
    }

    .auth-submit {
        transition: none;
    }

    .auth-submit:hover,
    .auth-submit:active {
        transform: none;
    }
}

/* ==========================================================================
   Captcha and form feedback
   ========================================================================== */

.auth-captcha {
    display: grid;
    gap: 0.55rem;
    padding: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.auth-captcha-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.auth-captcha-title {
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-captcha-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #7dd3fc;
    font-size: 0.8rem;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.auth-captcha-refresh:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #bae6fd;
}

.auth-captcha-refresh:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.7);
    outline-offset: 2px;
}

.auth-captcha-body {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.auth-captcha-image {
    display: block;
    flex: 0 0 auto;
    width: 145px;
    height: 45px;
    border-radius: 0.5rem;
    background: #fff;
}

.auth-captcha-field {
    display: grid;
    flex: 1 1 8rem;
    gap: 0.4rem;
    min-width: 0;
}

.auth-captcha-help {
    margin: 0;
    color: rgba(226, 232, 240, 0.64);
    font-size: 0.72rem;
    line-height: 1.45;
}

.auth-optional {
    color: rgba(226, 232, 240, 0.55);
    font-size: 0.72rem;
    font-weight: 400;
}

.auth-message {
    margin: 0;
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    font-size: 0.82rem;
    line-height: 1.45;
}

.auth-message[hidden] {
    display: none;
}

.auth-message.is-error {
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}

.auth-message.is-success {
    border: 1px solid rgba(52, 211, 153, 0.35);
    background: rgba(16, 185, 129, 0.12);
    color: #a7f3d0;
}

.auth-message.is-info {
    border: 1px solid rgba(125, 211, 252, 0.35);
    background: rgba(14, 165, 233, 0.12);
    color: #bae6fd;
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

@media (max-width: 460px) {
    .auth-captcha-body {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-captcha-image {
        width: 100%;
        max-width: 145px;
        height: auto;
    }
}

@media (max-height: 760px) {
    body.auth-page {
        align-items: flex-start;
    }
}

/* ==========================================================================
   Floating storefront menu
   ========================================================================== */

.auth-side-menu {
    --auth-side-width: 70px;
    --auth-side-offset: clamp(0.75rem, 2vw, 1.5rem);

    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: calc(var(--auth-side-offset) + var(--auth-side-width));
    padding-right: var(--auth-side-offset);
    pointer-events: none;
}

.auth-side-rail {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: var(--auth-side-width);
    padding: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1.15rem;
    box-shadow:
        0 24px 60px -24px rgba(2, 6, 23, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: auto;
}

.auth-side-rail::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    content: "";
}

.auth-side-home,
.auth-side-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    width: 100%;
    min-height: 3.4rem;
    padding: 0.45rem 0.2rem;
    border: 0;
    border-radius: 0.8rem;
    outline: none;
    background: transparent;
    color: rgba(226, 232, 240, 0.82);
    font: inherit;
    font-size: 0.58rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.auth-side-home i,
.auth-side-btn i {
    color: #7dd3fc;
    font-size: 1.05rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.auth-side-home:hover,
.auth-side-btn:hover,
.auth-side-categories[open] > .auth-side-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.auth-side-home:hover i,
.auth-side-btn:hover i,
.auth-side-categories[open] > .auth-side-btn i {
    color: #bae6fd;
}

.auth-side-home:focus-visible,
.auth-side-btn:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.7);
    outline-offset: 2px;
}

.auth-side-divider {
    display: block;
    width: calc(100% - 0.5rem);
    height: 1px;
    margin: 0.05rem auto;
    background: rgba(255, 255, 255, 0.12);
}

.auth-side-categories {
    margin: 0;
}

.auth-side-categories > .auth-side-btn {
    list-style: none;
    position: relative;
}

.auth-side-categories > .auth-side-btn::-webkit-details-marker {
    display: none;
}

.auth-side-chevron {
    position: absolute;
    top: 0.45rem;
    right: 0.35rem;
    color: rgba(226, 232, 240, 0.5) !important;
    font-size: 0.48rem !important;
    transition: transform 0.2s ease !important;
}

.auth-side-categories[open] .auth-side-chevron {
    transform: rotate(180deg);
}

.auth-category-panel {
    position: fixed;
    top: 50%;
    right: calc(var(--auth-side-offset) + var(--auth-side-width) + 0.8rem);
    z-index: 51;
    display: flex;
    flex-direction: column;
    width: 17.5rem;
    max-height: min(72vh, 620px);
    padding: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    background: rgba(2, 6, 23, 0.9);
    box-shadow:
        0 32px 80px -24px rgba(2, 6, 23, 0.95),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    overflow: hidden;
    transform: translateY(-50%);
}

.auth-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.2rem 0.45rem 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-category-title {
    color: #e2e8f0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-category-all {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #7dd3fc;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.auth-category-all:hover {
    color: #bae6fd;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-category-all:focus-visible,
.auth-category-link:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.7);
    outline-offset: 2px;
}

.auth-category-list {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 0.12rem;
    padding: 0.4rem 0.1rem 0.1rem;
    overflow-y: auto;
    scrollbar-color: rgba(125, 211, 252, 0.35) transparent;
    scrollbar-width: thin;
}

.auth-category-list::-webkit-scrollbar {
    width: 6px;
}

.auth-category-list::-webkit-scrollbar-track {
    background: transparent;
}

.auth-category-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(125, 211, 252, 0.35);
}

.auth-category-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem;
    border-radius: 0.6rem;
    color: rgba(226, 232, 240, 0.86);
    font-size: 0.8rem;
    line-height: 1.25;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.auth-category-link i {
    flex: 0 0 1rem;
    width: 1rem;
    color: #67e8f9;
    font-size: 0.78rem;
    text-align: center;
}

.auth-category-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.auth-category-empty {
    margin: 0;
    padding: 1rem 0.6rem;
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.78rem;
    text-align: center;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .auth-side-rail::before {
        background: rgba(2, 6, 23, 0.94);
    }

    .auth-category-panel {
        background: rgba(2, 6, 23, 0.97);
    }
}

@media (max-width: 760px) {
    body.auth-page {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    }

    .auth-side-menu {
        top: auto;
        right: 1rem;
        bottom: calc(1rem + env(safe-area-inset-bottom));
        left: auto;
        width: auto;
        padding-right: 0;
        align-items: flex-end;
    }

    .auth-side-rail {
        flex-direction: row;
        width: auto;
        padding: 0.4rem;
        border-radius: 1rem;
    }

    .auth-side-home,
    .auth-side-btn {
        width: auto;
        min-width: 3rem;
        min-height: 3rem;
        flex-direction: row;
        gap: 0.4rem;
        padding: 0.4rem 0.65rem;
        font-size: 0.72rem;
    }

    .auth-side-label {
        display: none;
    }

    .auth-side-divider {
        width: 1px;
        height: 2rem;
        margin: auto 0.1rem;
    }

    .auth-side-chevron {
        display: none;
    }

    .auth-category-panel {
        top: auto;
        right: 1rem;
        bottom: calc(4.9rem + env(safe-area-inset-bottom));
        left: 1rem;
        width: auto;
        max-height: min(60vh, 460px);
        transform: none;
    }
}

@media (max-width: 380px) {
    .auth-side-menu {
        right: 0.75rem;
    }

    .auth-category-panel {
        right: 0.75rem;
        left: 0.75rem;
    }
}

@media print {
    .auth-side-menu {
        display: none;
    }
}
