/* ================================================================
   The Pro — Glass UI
   A responsive glassmorphism layer for the auth screens & dashboard
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --glass-font: 'Plus Jakarta Sans', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --glass-text: #f7f9ff;
    --glass-muted: rgba(233, 240, 255, .86);
    --glass-line: rgba(255, 255, 255, .22);
    --glass-violet: #7c5cff;
    --glass-blue: #4d8dff;
    --glass-mint: #25d0c1;
    --glass-radius: 26px;
    --glass-shadow: 0 30px 80px rgba(6, 10, 35, .48), inset 0 1px 0 rgba(255, 255, 255, .28);
}

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

/* ---------- Animated background ---------- */

body.glass-auth {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 48px);
    font-family: var(--glass-font);
    color: var(--glass-text);
    background:
        radial-gradient(circle at 12% 18%, rgba(124, 92, 255, .45), transparent 45%),
        radial-gradient(circle at 88% 82%, rgba(37, 208, 193, .32), transparent 45%),
        linear-gradient(135deg, #0a0f28 0%, #151b45 50%, #241a4d 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

.glass-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.glass-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: .35;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .8), transparent 85%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .8), transparent 85%);
}

.orb {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    animation: glass-float 18s ease-in-out infinite alternate;
}

.orb--one {
    width: 34vw;
    height: 34vw;
    min-width: 240px;
    min-height: 240px;
    top: -8%;
    left: -6%;
    background: #6d4dff;
}

.orb--two {
    width: 28vw;
    height: 28vw;
    min-width: 200px;
    min-height: 200px;
    right: -4%;
    bottom: -10%;
    background: #1fc7bd;
    animation-delay: -6s;
}

.orb--three {
    width: 20vw;
    height: 20vw;
    min-width: 160px;
    min-height: 160px;
    right: 18%;
    top: 4%;
    background: #3a6dff;
    opacity: .38;
    animation-delay: -11s;
}

@keyframes glass-float {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(4vw, 5vh, 0) scale(1.15); }
}

/* ---------- Glass surfaces ---------- */

.glass-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.glass-shell--narrow {
    max-width: 480px;
}

.glass-panel {
    position: relative;
    isolation: isolate;
    border: 1px solid var(--glass-line);
    border-radius: var(--glass-radius);
    background: linear-gradient(135deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .055));
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

/* Blur lives on a background-only layer so text stays pixel crisp. */
.glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: inherit;
    backdrop-filter: blur(26px) saturate(160%);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
    pointer-events: none;
}

.glass-card {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    min-height: 560px;
}

/* ---------- Side / brand panel ---------- */

.glass-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(28px, 4vw, 48px);
    border-right: 1px solid rgba(255, 255, 255, .14);
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .16), transparent 45%),
        linear-gradient(155deg, rgba(124, 92, 255, .62), rgba(37, 208, 193, .18) 65%, rgba(255, 255, 255, .03));
}

.glass-aside::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    right: -110px;
    bottom: -110px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    box-shadow: 0 0 0 34px rgba(255, 255, 255, .045), 0 0 0 68px rgba(255, 255, 255, .03);
    pointer-events: none;
}

.glass-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: #fff;
}

.glass-brand img {
    width: 46px;
    height: 46px;
    padding: 7px;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 14px;
    background: rgba(255, 255, 255, .16);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}

.glass-aside h2 {
    margin: 0 0 14px;
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -.02em;
}

.glass-aside p {
    margin: 0;
    max-width: 34ch;
    color: var(--glass-muted);
    font-size: .92rem;
    line-height: 1.7;
}

.glass-features {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.glass-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, .88);
    font-size: .86rem;
    font-weight: 600;
}

.glass-features i {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 11px;
    background: rgba(255, 255, 255, .14);
    color: #b9fff2;
}

/* ---------- Form panel ---------- */

.glass-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 5vw, 56px);
}

.glass-brand--mobile {
    display: none;
    margin-bottom: 28px;
}

.glass-eyebrow {
    margin: 0 0 10px;
    color: #9bf0e3;
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.glass-main h1 {
    margin: 0 0 10px;
    font-size: clamp(1.75rem, 3.6vw, 2.3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.025em;
}

.glass-subtitle {
    margin: 0 0 30px;
    color: var(--glass-muted);
    font-size: .93rem;
    line-height: 1.6;
}

.glass-field {
    position: relative;
    margin-bottom: 16px;
}

.glass-field > i {
    position: absolute;
    top: 50%;
    left: 18px;
    z-index: 1;
    color: rgba(233, 240, 255, .62);
    font-size: .92rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.glass-field input {
    width: 100%;
    height: 54px;
    padding: 0 18px 0 50px;
    border: 1px solid var(--glass-line);
    border-radius: 14px;
    outline: none;
    background: rgba(255, 255, 255, .09);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: background .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.glass-field input::placeholder {
    color: rgba(233, 240, 255, .5);
}

.glass-field input:hover {
    background: rgba(255, 255, 255, .12);
}

.glass-field input:focus {
    border-color: rgba(155, 240, 227, .85);
    background: rgba(255, 255, 255, .15);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, .24);
}

.glass-field input.is-invalid {
    border-color: rgba(255, 138, 155, .8);
    box-shadow: 0 0 0 4px rgba(255, 90, 120, .16);
}

.glass-input--code {
    letter-spacing: .12em;
}

.glass-input--otp {
    font-size: 1.2rem !important;
    font-weight: 700;
    letter-spacing: .45em;
    text-align: center;
    padding-left: 50px !important;
}

.glass-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 6px 0 24px;
    color: var(--glass-muted);
    font-size: .85rem;
}

.glass-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.glass-check input {
    display: grid;
    place-content: center;
    width: 18px;
    height: 18px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.glass-check input::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #fff;
    clip-path: polygon(14% 44%, 0 65%, 43% 100%, 100% 22%, 80% 5%, 41% 68%);
    transform: scale(0);
    transition: transform .18s ease;
}

.glass-check input:checked {
    border-color: transparent;
    background: linear-gradient(135deg, var(--glass-violet), var(--glass-mint));
}

.glass-check input:checked::before {
    transform: scale(1);
}

.glass-check input:focus-visible {
    box-shadow: 0 0 0 4px rgba(124, 92, 255, .3);
}

.glass-link {
    color: #9bf0e3;
    font-weight: 700;
    text-decoration: none;
}

.glass-link:hover {
    text-decoration: underline;
}

.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    padding: 12px 22px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(120deg, var(--glass-violet), var(--glass-blue) 55%, var(--glass-mint));
    box-shadow: 0 14px 32px rgba(77, 141, 255, .34), inset 0 1px 0 rgba(255, 255, 255, .28);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.glass-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(77, 141, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .34);
    color: #fff;
    text-decoration: none;
}

.glass-btn:active {
    transform: translateY(0);
}

.glass-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .85);
    outline-offset: 3px;
}

.glass-divider {
    height: 1px;
    margin: 28px 0 18px;
    border: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
}

.glass-footer {
    margin: 0;
    color: rgba(233, 240, 255, .6);
    font-size: .78rem;
    text-align: center;
}

.glass-footer--outside {
    margin-top: 20px;
}

.glass-error {
    display: block;
    margin: -6px 0 16px;
    color: #ffb9c6;
    font-size: .8rem;
}

.glass-alert {
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 140, 160, .42);
    border-radius: 12px;
    background: rgba(255, 90, 120, .15);
    color: #ffd9e0;
    font-size: .85rem;
}

/* ---------- Welcome screen ---------- */

.glass-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 0;
    padding: clamp(34px, 6vw, 56px);
    text-align: center;
}

.glass-logo {
    width: clamp(84px, 18vw, 112px);
    height: clamp(84px, 18vw, 112px);
    margin-bottom: 24px;
    padding: 12px;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 28px;
    background: rgba(255, 255, 255, .13);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
}

.glass-welcome h1 {
    margin-bottom: 12px;
}

.glass-welcome .glass-btn {
    max-width: 280px;
    margin: 12px auto 0;
}

/* ---------- Dashboard ---------- */

body:has(.glass-dashboard) {
    background:
        radial-gradient(circle at 8% 0%, rgba(124, 92, 255, .35), transparent 42%),
        radial-gradient(circle at 95% 90%, rgba(37, 208, 193, .25), transparent 42%),
        #0c1130 !important;
}

body:has(.glass-dashboard) #content-wrapper {
    background: transparent !important;
}

body:has(.glass-dashboard) .topbar,
body:has(.glass-dashboard) .navbar {
    border-bottom: 1px solid rgba(255, 255, 255, .12) !important;
    background: rgba(12, 17, 48, .82) !important;
}

body:has(.glass-dashboard) .sidebar {
    background: linear-gradient(180deg, rgba(30, 36, 86, .94), rgba(15, 19, 52, .94)) !important;
}

body:has(.glass-dashboard) .sidebar .nav-link,
body:has(.glass-dashboard) .sidebar .nav-item .nav-link {
    color: rgba(255, 255, 255, .76);
}

.glass-dashboard {
    position: relative;
    min-height: calc(100vh - 60px);
    padding: clamp(18px, 3vw, 36px) 0;
    font-family: var(--glass-font);
    color: var(--glass-text);
}

.glass-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 26px;
    padding: clamp(22px, 3vw, 32px);
}

.glass-hero h1 {
    margin: 0 0 6px;
    font-size: clamp(1.6rem, 3.4vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -.02em;
}

.glass-hero p {
    margin: 0;
    color: var(--glass-muted);
    font-size: .9rem;
}

.glass-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    border: 1px solid rgba(155, 240, 227, .35);
    border-radius: 999px;
    background: rgba(37, 208, 193, .12);
    color: #b9fff2;
    font-size: .78rem;
    font-weight: 700;
}

.glass-badge i {
    font-size: .7rem;
}

.glass-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: clamp(14px, 2vw, 22px);
}

.glass-stat {
    position: relative;
    isolation: isolate;
    padding: clamp(20px, 2.4vw, 28px);
    border: 1px solid var(--glass-line);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .045));
    box-shadow: 0 18px 44px rgba(6, 10, 35, .32), inset 0 1px 0 rgba(255, 255, 255, .22);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.glass-stat::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: inherit;
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    pointer-events: none;
}

.glass-stat::before {
    content: '';
    position: absolute;
    top: -70px;
    right: -60px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--stat-glow, rgba(124, 92, 255, .45));
    filter: blur(34px);
    opacity: .7;
}

.glass-stat:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, .38);
    box-shadow: 0 26px 56px rgba(6, 10, 35, .44), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.glass-stat--violet { --stat-glow: rgba(169, 0, 255, .55); }
.glass-stat--amber  { --stat-glow: rgba(255, 165, 0, .55); }
.glass-stat--green  { --stat-glow: rgba(19, 223, 15, .5); }
.glass-stat--red    { --stat-glow: rgba(255, 60, 90, .55); }

.glass-stat__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.glass-stat__label {
    color: var(--glass-muted);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .01em;
}

.glass-stat__icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 13px;
    background: rgba(255, 255, 255, .13);
    color: #fff;
    font-size: 1.05rem;
}

.glass-stat__value {
    margin: 18px 0 8px;
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
}

.glass-stat__foot {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(233, 240, 255, .58);
    font-size: .74rem;
}

.glass-stat__foot i {
    color: #9bf0e3;
}

/* ---------- Fallbacks & accessibility ---------- */

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass-panel,
    .glass-stat {
        background: rgba(24, 29, 70, .88);
    }
}

@media (max-width: 820px) {
    .glass-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .glass-aside {
        display: none;
    }

    .glass-brand--mobile {
        display: inline-flex;
    }

    .glass-main {
        padding: 30px 24px;
    }
}

@media (max-width: 480px) {
    body.glass-auth {
        padding: 14px;
        align-items: start;
    }

    .glass-shell {
        margin: auto 0;
    }

    .glass-panel {
        border-radius: 20px;
    }

    .glass-main {
        padding: 26px 20px;
    }

    .glass-hero {
        padding: 22px;
    }
}

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

    .glass-btn,
    .glass-stat,
    .glass-field input,
    .glass-check input {
        transition: none;
    }

    .glass-btn:hover,
    .glass-stat:hover {
        transform: none;
    }
}
