/* ========================================
   Nigella ERP — Auth Layout
   Viewport-locked, responsive, no page scroll
   ======================================== */

:root {
    --auth-ink: #0b1524;
    --auth-ink-mid: #132338;
    --auth-accent: #F58635;
    --auth-accent-soft: #F7A05C;
    --auth-mist: rgba(255, 244, 232, 0.88);
    --auth-white: #ffffff;
    --auth-surface: #f7f8fb;
    --auth-text: #1a2332;
    --auth-muted: #6b778c;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

.auth-body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--auth-surface);
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

.auth-container {
    display: flex;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

/* ========================================
   LEFT BRAND PANEL — flowing modern stage
   ======================================== */

.auth-branding-section {
    flex: 1.05;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vh, 48px) clamp(24px, 3vw, 40px);
    background:
        radial-gradient(1200px 700px at 10% -10%, rgba(245, 134, 53, 0.28), transparent 55%),
        radial-gradient(900px 600px at 95% 110%, rgba(224, 109, 28, 0.22), transparent 50%),
        linear-gradient(155deg, #08111d 0%, #122a42 46%, #0a1628 100%);
    color: var(--auth-white);
    min-height: 0;
    isolation: isolate;
}

.premium-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.mesh-flow {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(circle at 20% 30%, rgba(245, 134, 53, 0.28), transparent 42%),
        radial-gradient(circle at 78% 20%, rgba(247, 160, 92, 0.18), transparent 36%),
        radial-gradient(circle at 60% 80%, rgba(249, 196, 138, 0.2), transparent 40%);
    filter: blur(8px);
    animation: meshDrift 18s ease-in-out infinite alternate;
    opacity: 0.9;
}

@keyframes meshDrift {
    0% { transform: translate3d(-2%, -1%, 0) scale(1); }
    100% { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

.aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    will-change: transform, opacity;
    contain: layout style paint;
}

.aurora-a {
    width: min(460px, 58vw);
    height: min(460px, 58vw);
    top: -140px;
    left: -100px;
    background: radial-gradient(circle, rgba(245, 134, 53, 0.65) 0%, transparent 70%);
    animation: auroraFlowA 16s ease-in-out infinite;
}

.aurora-b {
    width: min(400px, 52vw);
    height: min(400px, 52vw);
    right: -120px;
    bottom: -100px;
    background: radial-gradient(circle, rgba(224, 109, 28, 0.5) 0%, transparent 70%);
    animation: auroraFlowB 20s ease-in-out infinite;
}

.aurora-c {
    width: min(280px, 38vw);
    height: min(280px, 38vw);
    left: 38%;
    top: 40%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 70%);
    animation: auroraFlowC 14s ease-in-out infinite;
}

.aurora-d {
    width: min(220px, 30vw);
    height: min(220px, 30vw);
    right: 18%;
    top: 18%;
    background: radial-gradient(circle, rgba(249, 184, 110, 0.35) 0%, transparent 70%);
    animation: auroraFlowD 22s ease-in-out infinite;
}

@keyframes auroraFlowA {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.5; }
    33% { transform: translate3d(48px, 30px, 0) scale(1.1); opacity: 0.7; }
    66% { transform: translate3d(18px, 50px, 0) scale(0.96); opacity: 0.45; }
}

@keyframes auroraFlowB {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.45; }
    50% { transform: translate3d(-40px, -34px, 0) scale(1.12); opacity: 0.7; }
}

@keyframes auroraFlowC {
    0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.3; }
    50% { transform: translate3d(22px, -36px, 0); opacity: 0.62; }
}

@keyframes auroraFlowD {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.35; }
    50% { transform: translate3d(-24px, 28px, 0) scale(1.15); opacity: 0.55; }
}

.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(186, 210, 255, 0.12);
    box-shadow: inset 0 0 40px rgba(245, 134, 53, 0.05);
}

.orbit-ring-a {
    width: min(520px, 70vw);
    height: min(520px, 70vw);
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    animation: orbitSpin 48s linear infinite;
}

.orbit-ring-b {
    width: min(360px, 48vw);
    height: min(360px, 48vw);
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    border-color: rgba(143, 196, 255, 0.1);
    animation: orbitSpinReverse 36s linear infinite;
}

@keyframes orbitSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes orbitSpinReverse {
    to { transform: translate(-50%, -50%) rotate(-360deg); }
}

.float-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(186, 220, 255, 0.7);
    box-shadow: 0 0 12px rgba(120, 180, 255, 0.55);
    animation: particleFloat 9s ease-in-out infinite;
}

.float-particle.p1 { left: 14%; top: 22%; animation-delay: 0s; }
.float-particle.p2 { left: 78%; top: 28%; width: 4px; height: 4px; animation-delay: 1.4s; }
.float-particle.p3 { left: 62%; top: 68%; animation-delay: 2.2s; }
.float-particle.p4 { left: 28%; top: 74%; width: 3px; height: 3px; animation-delay: 3.1s; }
.float-particle.p5 { left: 48%; top: 18%; width: 3px; height: 3px; animation-delay: 4s; }

@keyframes particleFloat {
    0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.25; }
    50% { transform: translate3d(0, -18px, 0); opacity: 0.9; }
}

.brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 40% 45%, black 20%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse at 40% 45%, black 20%, transparent 72%);
    animation: gridBreathe 12s ease-in-out infinite;
    opacity: 0.55;
}

@keyframes gridBreathe {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.02); }
}

.brand-sheen {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.06) 44%, transparent 60%);
    background-size: 240% 100%;
    animation: sheenSweep 11s ease-in-out infinite;
}

@keyframes sheenSweep {
    0%, 100% { background-position: 120% 0; }
    50% { background-position: -20% 0; }
}

.brand-content {
    position: relative;
    z-index: 2;
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(12px, 2.4vh, 28px);
    animation: brandEnter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes brandEnter {
    from { opacity: 0; transform: translate3d(0, 18px, 0); filter: blur(4px); }
    to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}

.brand-logo-premium {
    width: clamp(96px, 14vh, 140px);
    height: clamp(96px, 14vh, 140px);
    margin: 0 auto clamp(8px, 1.2vh, 14px);
    position: relative;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    animation: fadeSlide 0.55s ease-out 0.05s both;
}

/* Legacy wrappers — never show a plate/box behind the mark */
.logo-halo,
.logo-icon-premium {
    display: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.brand-logo-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    animation: logoSoftFloat 6.5s ease-in-out infinite;
}

@keyframes logoSoftFloat {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(0, -7px, 0) rotate(1deg); }
}

.brand-text-premium {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.brand-eyebrow {
    margin: 0 0 clamp(6px, 1vh, 10px);
    font-size: clamp(10px, 1.2vh, 12px);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(232, 240, 252, 0.72);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: fadeSlide 0.5s ease-out 0.1s both;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #F58635;
    box-shadow: 0 0 0 0 rgba(245, 134, 53, 0.55);
    animation: livePulse 2.2s ease-out infinite;
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 134, 53, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(245, 134, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(125, 211, 252, 0); }
}

.brand-name-premium {
    margin: 0 0 clamp(6px, 1vh, 10px);
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(28px, 4.2vw, 48px);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: #fff;
    animation: fadeSlide 0.55s ease-out 0.16s both;
}

.brand-name-accent {
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.72em;
    letter-spacing: 0.08em;
    vertical-align: 0.12em;
    background: linear-gradient(120deg, #F7A05C 0%, #F58635 35%, #E8913A 65%, #F7A05C 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: accentFlow 6s ease-out infinite;
}

@keyframes accentFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.brand-product-line {
    margin: 0 0 clamp(6px, 1.2vh, 12px);
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: clamp(11px, 1.35vh, 13px);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(186, 210, 242, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    animation: fadeSlide 0.55s ease-out 0.22s both;
}

.product-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(143, 196, 255, 0.55);
}

.brand-tagline-premium {
    margin: 0 auto;
    max-width: 36ch;
    font-size: clamp(13px, 1.7vh, 16px);
    line-height: 1.55;
    font-weight: 400;
    color: var(--auth-mist);
    text-align: center;
    animation: fadeSlide 0.55s ease-out 0.28s both;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translate3d(0, 10px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.premium-features {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(8px, 1.2vh, 12px);
    margin-top: clamp(4px, 1vh, 8px);
    width: 100%;
}

.feature-premium {
    position: relative;
    display: flex;
    align-items: center;
    text-align: left;
    gap: 14px;
    padding: clamp(10px, 1.4vh, 14px) clamp(12px, 1.2vw, 16px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    animation: featureEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--delay, 0.2s);
    transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.feature-glow {
    position: absolute;
    inset: auto auto -40% -20%;
    width: 55%;
    height: 90%;
    background: radial-gradient(circle, rgba(99, 150, 255, 0.22), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.feature-premium:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    border-color: rgba(186, 210, 255, 0.28);
    transform: translateX(6px) translateY(-1px);
    box-shadow: 0 10px 28px rgba(8, 18, 36, 0.28);
}

.feature-premium:hover .feature-glow {
    opacity: 1;
}

.feature-premium:hover .feature-icon-premium {
    transform: scale(1.06);
    background: rgba(245, 134, 53, 0.32);
}

@keyframes featureEnter {
    from { opacity: 0; transform: translate3d(-14px, 8px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.feature-icon-premium {
    width: clamp(32px, 4.2vh, 38px);
    height: clamp(32px, 4.2vh, 38px);
    border-radius: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d7e7ff;
    background: rgba(245, 134, 53, 0.24);
    border: 1px solid rgba(143, 196, 255, 0.28);
    animation: iconPulse 3.8s ease-in-out infinite;
    transition: transform 0.25s ease, background 0.25s ease;
    position: relative;
    z-index: 1;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 134, 53, 0); }
    50% { box-shadow: 0 0 0 7px rgba(245, 134, 53, 0.14); }
}

.feature-icon-premium svg {
    width: 18px;
    height: 18px;
}

.feature-content-premium {
    position: relative;
    z-index: 1;
}

.feature-content-premium h3 {
    margin: 0 0 3px;
    font-size: clamp(13px, 1.55vh, 14px);
    font-weight: 600;
    color: #fff;
}

.feature-content-premium p {
    margin: 0;
    font-size: clamp(12px, 1.4vh, 13px);
    line-height: 1.35;
    color: rgba(232, 240, 252, 0.72);
}

/* ========================================
   RIGHT FORM PANEL
   ======================================== */

.auth-form-section {
    flex: 0.95;
    background: var(--auth-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3.5vh, 40px) clamp(16px, 3vw, 40px);
    padding-left: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left));
    padding-right: max(clamp(16px, 3vw, 40px), env(safe-area-inset-right));
    position: relative;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.auth-form-section::before {
    content: '';
    position: absolute;
    inset: auto -20% -30% auto;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(245, 134, 53, 0.06) 0%, transparent 70%);
    pointer-events: none;
    animation: glowBreathe 8s ease-in-out infinite;
}

@keyframes glowBreathe {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

/* ========================================
   RESPONSIVE — still no page scroll
   ======================================== */

@media (max-width: 1024px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-branding-section {
        flex: 0 0 auto;
        max-height: 34%;
        padding: clamp(12px, 2vh, 24px) clamp(16px, 4vw, 24px);
        padding-top: max(clamp(12px, 2vh, 24px), env(safe-area-inset-top));
    }

    .brand-content {
        gap: clamp(6px, 1.2vh, 12px);
        max-width: 560px;
        margin: 0 auto;
    }

    .premium-features {
        display: none;
    }

    .brand-tagline-premium {
        max-width: none;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .auth-form-section {
        flex: 1 1 auto;
        align-items: center;
        justify-content: center;
        padding: clamp(12px, 2vh, 24px) clamp(14px, 4vw, 24px);
        padding-bottom: max(clamp(12px, 2vh, 24px), env(safe-area-inset-bottom));
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .auth-branding-section {
        max-height: 30%;
    }

    .brand-logo-premium {
        width: 72px;
        height: 72px;
    }

    .brand-name-premium {
        font-size: clamp(22px, 6vw, 28px);
    }

    .brand-product-line {
        font-size: 10.5px;
        letter-spacing: 0.1em;
    }
}

@media (max-width: 480px) {
    .auth-branding-section {
        max-height: 28%;
        padding: 12px 14px;
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .brand-eyebrow {
        letter-spacing: 0.12em;
    }

    .brand-name-premium {
        font-size: 22px;
    }

    .brand-product-line {
        font-size: 10px;
    }

    .brand-tagline-premium {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
}

/* Short viewports: compress brand pane further */
@media (max-height: 720px) {
    .auth-branding-section {
        padding-top: clamp(12px, 2vh, 20px);
        padding-bottom: clamp(10px, 1.5vh, 16px);
    }

    .premium-features .feature-premium:nth-child(n+3) {
        display: none;
    }

    .brand-product-line {
        display: none;
    }
}

@media (max-height: 600px) and (min-width: 1025px) {
    .premium-features {
        display: none;
    }

    .brand-tagline-premium {
        display: none;
    }
}

@media (max-height: 640px) and (max-width: 1024px) {
    .auth-branding-section {
        max-height: 22%;
    }

    .brand-tagline-premium {
        display: none;
    }

    .brand-logo-premium {
        width: 64px;
        height: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aurora,
    .mesh-flow,
    .orbit-ring,
    .float-particle,
    .brand-grid,
    .brand-sheen,
    .logo-halo,
    .logo-icon-premium,
    .brand-content,
    .feature-premium,
    .feature-icon-premium,
    .brand-eyebrow,
    .brand-name-premium,
    .brand-name-accent,
    .brand-product-line,
    .brand-tagline-premium,
    .eyebrow-dot,
    .auth-form-section::before {
        animation: none !important;
    }
}

@media (max-width: 1024px) {
    .orbit-ring,
    .float-particle,
    .brand-grid {
        display: none;
    }
}

/* ========================================
   DARK MODE
   ======================================== */

[data-theme="dark"] .auth-body {
    background: #0b1220;
}

[data-theme="dark"] .auth-form-section {
    background: #121a2a;
}

[data-theme="dark"] .auth-form-section::before {
    background: radial-gradient(circle, rgba(224, 109, 28, 0.1) 0%, transparent 70%);
}
