/*
 * Orqit premium authentication UI — light theme (Linear / Notion / Stripe inspired).
 * Loaded after orqit-auth.css so these rules augment base layout classes.
 */

/* ---- Design tokens ---- */
:root {
    --premium-bg-top: #f8faff;
    --premium-bg-bot: #f3fbf7;
    --premium-violet: #8b5cf6;
    --premium-indigo: #6366f1;
    --premium-cyan: #06b6d4;
    --premium-emerald: #10b981;
    --premium-rose: #f43f5e;
    --premium-amber: #f97316;
    --premium-glass: rgba(255, 255, 255, 0.72);
    --premium-glass-border: rgba(255, 255, 255, 0.85);
    --premium-gradient-cta: linear-gradient(125deg, #8b5cf6 0%, #6366f1 42%, #0ea5e9 88%);
    --premium-gradient-soft: radial-gradient(
        ellipse 140% 100% at 10% -20%,
        rgba(167, 139, 250, 0.28),
        transparent 55%
      ),
      radial-gradient(ellipse 100% 80% at 100% 60%, rgba(34, 211, 238, 0.2), transparent 50%),
      radial-gradient(ellipse 70% 50% at 50% 100%, rgba(52, 211, 153, 0.15), transparent 45%);
    --premium-shadow-soft: 0 4px 24px rgba(15, 23, 42, 0.06);
    --premium-shadow-lift: 0 14px 40px rgba(99, 102, 241, 0.12);
}

body.orqit-auth-page {
    background: linear-gradient(
        180deg,
        var(--premium-bg-top) 0%,
        var(--premium-bg-bot) 100%
    );
}

/* Atmospheric background (nested under .auth-scope-premium) */
.auth-scope-premium {
    position: relative;
    /* isolation: isolate caused mega dropdowns on /login to composite incorrectly (washed-out / “transparent”).
       Layer nav + dropdowns explicitly with z-index instead. */
    isolation: auto;
    /* Do NOT use overflow-x here: fixed mega menus must not be clipped by this wrapper. */
    overflow-x: visible;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.auth-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.auth-atmosphere__grid {
    position: absolute;
    inset: -1px;
    background-image: radial-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 92%);
    opacity: 0.35;
}

.auth-atmosphere__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.55;
    animation: premiumBlobFloat 18s ease-in-out infinite;
}

.auth-atmosphere__blob--a {
    width: min(46vw, 420px);
    height: min(46vw, 420px);
    background: rgba(167, 139, 250, 0.5);
    top: -12%;
    left: -10%;
}

.auth-atmosphere__blob--b {
    width: min(52vw, 480px);
    height: min(52vw, 480px);
    background: rgba(34, 211, 238, 0.35);
    top: 30%;
    right: -14%;
    animation-delay: -6s;
}

.auth-atmosphere__blob--c {
    width: min(40vw, 360px);
    height: min(40vw, 360px);
    background: rgba(251, 113, 133, 0.22);
    bottom: -8%;
    left: 38%;
    animation-delay: -12s;
}

@keyframes premiumBlobFloat {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(2%, 3%) scale(1.04);
    }
    66% {
        transform: translate(-2%, 1%) scale(0.98);
    }
}

/* ---- Global workspace login ---- */

.auth-scope-premium .pub-nav {
    position: relative;
    /* Must sit above .auth-global-wrap (z-index:1) and create a high stacking context for fixed mega panels. */
    z-index: 8000;
    flex-shrink: 0;
}

.auth-scope-premium .auth-global-wrap {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    padding: clamp(16px, 3vw, 28px) clamp(16px, 3vw, 24px) clamp(32px, 5vw, 56px);
    background: transparent;
    overflow-x: clip;
}

.auth-scope-premium .auth-global-stage {
    align-items: start;
    width: 100%;
}

.auth-scope-premium .auth-global-content {
    min-width: 0;
    position: relative;
    z-index: 2;
    padding: 4px 8px;
    animation: premiumFadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Hero column: clip absolute floats so they never paint over the form column */
.auth-scope-premium .auth-hero-visual {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
    align-self: stretch;
    border-radius: 20px;
    padding: 12px 8px 20px;
    margin-top: 0;
}

.auth-scope-premium .auth-hero-compose {
    margin-left: 0;
    margin-right: auto;
    max-width: min(100%, 560px);
}

@keyframes premiumFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-scope-premium .auth-global-title {
    font-weight: 800;
    letter-spacing: -0.038em;
    background: linear-gradient(120deg, #0f172a 10%, var(--premium-violet) 55%, #0ea5e9 120%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .auth-scope-premium .auth-global-title {
        color: var(--auth-text);
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
    }

    .auth-atmosphere__blob {
        animation: none;
    }
}

.auth-scope-premium .auth-global-copy,
.auth-scope-premium .auth-global-content .auth-tagline {
    color: #475569;
    font-size: 1.02rem;
    line-height: 1.5;
}

.auth-scope-premium .auth-global-content .auth-logo {
    font-size: 1.85rem;
    font-weight: 800;
    background: linear-gradient(90deg, #4f46e5, var(--premium-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .auth-scope-premium .auth-global-content .auth-logo {
        color: #4f46e5;
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
    }
}

.auth-scope-premium .workspace-input-wrap,
.auth-scope-premium .auth-input {
    border-radius: 14px;
    background: var(--premium-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: var(--premium-shadow-soft);
}

.auth-scope-premium .workspace-input-wrap:focus-within,
.auth-scope-premium .auth-input:focus {
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), var(--premium-shadow-soft);
}

.auth-scope-premium .workspace-suffix {
    background: rgba(248, 250, 252, 0.85);
}

.auth-scope-premium .btn-primary {
    border: none;
    background-image: var(--premium-gradient-cta);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.32);
    transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}

.auth-scope-premium .btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 14px 36px rgba(99, 102, 241, 0.4);
}

.auth-scope-premium .btn-google {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.95);
}

.auth-scope-premium .btn-google:hover {
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: var(--premium-shadow-lift);
    transform: translateY(-2px);
}

.auth-scope-premium .auth-link {
    color: #5b21b6;
}

.auth-scope-premium .auth-link:hover {
    color: var(--premium-cyan);
}

/* Hero composition + floating UI */
.auth-hero-compose {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    min-height: 420px;
    animation: premiumFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.auth-hero-compose__main {
    width: 100%;
    max-width: 560px;
    margin: 24px auto 0;
    display: block;
    filter: drop-shadow(0 20px 44px rgba(15, 23, 42, 0.12));
}

.auth-hero-compose__floating {
    position: absolute;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}

.auth-hero-compose__floating--sla {
    top: 6%;
    left: 6%;
    color: #047857;
    background: rgba(236, 253, 245, 0.9);
}

.auth-hero-compose__floating--ai {
    top: 22%;
    right: 6%;
    color: #5b21b6;
    background: rgba(245, 243, 255, 0.92);
}

.auth-hero-compose__thumb {
    position: absolute;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--premium-shadow-lift);
    overflow: hidden;
}

.auth-hero-compose__thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.auth-hero-compose__thumb--dash {
    width: min(38%, 200px);
    bottom: 6%;
    left: 4%;
    animation: premiumFloatChip 7s ease-in-out infinite;
}

.auth-hero-compose__thumb--cloud {
    width: min(42%, 220px);
    bottom: 10%;
    right: 4%;
    animation: premiumFloatChip 8s ease-in-out infinite alternate;
}

@keyframes premiumFloatChip {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-hero-compose,
    .auth-hero-compose__thumb--dash,
    .auth-hero-compose__thumb--cloud {
        animation: none;
    }
}

.auth-hero-compose__accent {
    position: absolute;
    width: min(28%, 150px);
    top: 2%;
    right: 4%;
    opacity: 0.95;
    filter: drop-shadow(0 8px 20px rgba(99, 102, 241, 0.2));
}

@media (max-width: 980px) {
    .auth-hero-compose {
        margin: 32px auto 0;
        min-height: 360px;
    }

    .auth-hero-compose__accent {
        right: 0;
        width: 120px;
    }

    .auth-hero-compose__thumb--dash,
    .auth-hero-compose__thumb--cloud {
        position: relative;
        inset: auto;
        width: min(92%, 320px);
        margin: 12px auto 0;
        animation: none;
    }

    .auth-hero-compose__floating {
        position: absolute;
        z-index: 2;
    }
}

/* Tenant split — premium LIGHT (no heavy dark slab) */

.auth-split--premium {
    min-height: 100dvh;
}

.auth-split--premium .auth-brand-panel {
    position: relative;
    color: #0f172a;
    background:
        radial-gradient(80% 60% at 0% 0%, rgba(196, 181, 253, 0.45) 0%, transparent 55%),
        radial-gradient(70% 50% at 100% 20%, rgba(165, 243, 252, 0.4) 0%, transparent 50%),
        linear-gradient(165deg, #fafbff 0%, #f4f6fe 48%, #f0fdf9 100%);
    border-right: 1px solid rgba(226, 232, 240, 0.75);
}

.auth-split--premium .auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.55;
    pointer-events: none;
}

.auth-split--premium .auth-brand-panel h1 {
    margin-top: 10px;
    font-weight: 800;
}

.auth-split--premium .auth-brand-panel p {
    color: #475569;
}

.auth-split--premium .auth-feature-list li {
    color: #334155;
    background: var(--premium-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.92);
}

.auth-split--premium .auth-tenant-logo {
    background: rgba(255, 255, 255, 0.65);
}

.auth-split--premium .auth-form-panel {
    background: linear-gradient(180deg, #fcfcfd 0%, #f6f9fc 55%, #f5fbfb 100%);
}

.auth-split--premium .auth-card {
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.7);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        var(--premium-shadow-soft),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.auth-split--premium .auth-card h2 {
    font-weight: 800;
    letter-spacing: -0.025em;
}

.auth-split--premium .btn-primary {
    border: none;
    background-image: var(--premium-gradient-cta);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.26);
}

.auth-split--premium .btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.auth-split--premium .auth-input {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
}

.auth-split--premium .btn-google {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 980px) {
    .auth-split--premium .auth-brand-panel h1,
    .auth-split--premium .auth-brand-panel p,
    .auth-split--premium .auth-feature-list {
        display: initial;
    }
}

/* ---- Layering / full-height tenant shell ---- */
.auth-scope-premium .auth-split--premium {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: clip;
}

/* Keep .pub-nav OUT of this group — it needs a higher z-index than .auth-global-wrap for mega menus.
   A previous rule set z-index:1 here and overwrote .pub-nav, making dropdowns paint “transparent”. */
.auth-scope-premium > .auth-global-wrap,
.auth-scope-premium > .pub-footer,
.auth-scope-premium > .pub-scripts {
    position: relative;
    z-index: 1;
}

.auth-scope-premium > .pub-footer {
    flex-shrink: 0;
}

.auth-split--premium .auth-brand-logo-wrap > .auth-logo {
    font-size: clamp(1.5rem, 3vw, 1.95rem);
    font-weight: 800;
    color: #0f172a;
    background: linear-gradient(100deg, #4f46e5, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .auth-split--premium .auth-brand-logo-wrap > .auth-logo {
        background: none;
        color: #4f46e5;
        -webkit-background-clip: unset;
        background-clip: unset;
    }
}

@media (min-width: 901px) {
    body.orqit-auth-page .pub-mega-menu {
        filter: none !important;
    }
}
