:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: rgba(15, 23, 42, .12);
    --paper: #f8fafc;
    --gold: #d4af37;
    --green: #16a34a;
    --cyan: #0891b2;
}

* { box-sizing: border-box; }

body.login-shell {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        linear-gradient(90deg, rgba(15, 23, 42, .06) 1px, transparent 1px),
        linear-gradient(0deg, rgba(15, 23, 42, .05) 1px, transparent 1px),
        #e5e7eb;
    background-size: 32px 32px;
    overflow: hidden;
}

.login-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .42;
    background-image: radial-gradient(rgba(15, 23, 42, .16) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

.login-stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(28rem, .82fr);
}

.login-product {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 2rem clamp(1.2rem, 4vw, 4.5rem);
    color: #fff;
    background:
        linear-gradient(rgba(2, 6, 23, .42), rgba(2, 6, 23, .62)),
        linear-gradient(135deg, #111827 0%, #0f172a 36%, #134e4a 100%);
}

.login-product::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 0 36%, rgba(255, 255, 255, .07) 36% 36.5%, transparent 36.5% 100%),
        repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px 72px);
    animation: scanScene 16s linear infinite;
}

.login-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-lockup,
.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: inherit;
    text-decoration: none;
    font-weight: 950;
    letter-spacing: .02em;
}

.brand-lockup img,
.mobile-brand img {
    width: 3.2rem;
    height: 3.2rem;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.landing-link {
    color: #fff;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    padding: .75rem 1rem;
    font-size: .78rem;
    font-weight: 900;
    text-decoration: none;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(8px);
}

.hero-copy {
    position: relative;
    z-index: 2;
    width: min(46rem, 92%);
    margin-top: min(12vh, 7rem);
}

.eyebrow,
#form-kicker {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .72rem;
    font-weight: 950;
}

.hero-copy h1 {
    margin: 1rem 0 .9rem;
    font-size: clamp(3rem, 7vw, 6.6rem);
    line-height: .92;
    letter-spacing: 0;
    font-weight: 950;
    max-width: 11ch;
}

.hero-copy p {
    color: #cbd5e1;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.55;
    font-weight: 750;
    max-width: 34rem;
}

.product-scene {
    position: absolute;
    right: clamp(1rem, 4vw, 5rem);
    bottom: clamp(2rem, 5vh, 4rem);
    width: min(42rem, 56vw);
    height: 23rem;
    z-index: 2;
    perspective: 1200px;
}

.scene-panel {
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(248,250,252,.1);
    backdrop-filter: blur(18px);
    box-shadow: 0 28px 80px rgba(2,6,23,.42);
}

.panel-main {
    position: absolute;
    inset: 2rem 4rem 1rem 1rem;
    border-radius: 1.25rem;
    padding: 1.25rem;
    transform: rotateX(8deg) rotateY(-12deg);
    animation: floatPanel 7s ease-in-out infinite;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.panel-head span,
.panel-grid span,
.panel-float small {
    color: #cbd5e1;
    font-size: .75rem;
    font-weight: 850;
}

.panel-head strong {
    font-size: 1.8rem;
    font-weight: 950;
}

.scene-chart {
    height: 10rem;
    display: flex;
    align-items: end;
    gap: .75rem;
    margin-top: 2rem;
}

.scene-chart i {
    flex: 1;
    border-radius: .6rem .6rem .25rem .25rem;
    background: linear-gradient(180deg, #34d399, #0f766e);
    animation: barPulse 3s ease-in-out infinite;
}

.scene-chart i:nth-child(2) { animation-delay: .2s; }
.scene-chart i:nth-child(3) { animation-delay: .4s; }
.scene-chart i:nth-child(4) { animation-delay: .6s; }
.scene-chart i:nth-child(5) { animation-delay: .8s; }

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-top: 1rem;
}

.panel-grid span {
    border-radius: .75rem;
    background: rgba(255,255,255,.08);
    padding: .75rem;
}

.panel-float {
    position: absolute;
    display: flex;
    align-items: center;
    gap: .7rem;
    border-radius: 1rem;
    padding: .9rem 1rem;
    min-width: 13rem;
    animation: floatChip 5s ease-in-out infinite;
}

.panel-float span {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.1);
    color: #67e8f9;
}

.panel-float strong {
    display: block;
    font-size: .85rem;
    font-weight: 950;
}

.panel-float.one { top: 0; right: .5rem; }
.panel-float.two { left: 0; bottom: .3rem; animation-delay: .7s; }
.panel-float.three { right: 0; bottom: 4rem; animation-delay: 1.3s; }

.login-card {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.25rem, 4vw, 4rem);
    background: rgba(248,250,252,.88);
    backdrop-filter: blur(12px);
    border-left: 1px solid rgba(15, 23, 42, .08);
}

.mobile-brand {
    display: none;
    margin-bottom: 2rem;
}

.mobile-brand img { filter: brightness(0); }

.form-header {
    margin-bottom: 2rem;
}

.form-header h2 {
    margin: .65rem 0 .45rem;
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    line-height: .95;
    font-weight: 950;
}

.form-header p {
    color: var(--muted);
    font-weight: 750;
    line-height: 1.5;
}

.login-form {
    display: grid;
    gap: 1rem;
}

.dual-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
}

.field-wrap span {
    display: flex;
    justify-content: space-between;
    color: #475569;
    font-size: .68rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 .4rem .25rem;
}

.field-wrap a {
    color: var(--cyan);
    text-decoration: none;
}

.lg-input {
    width: 100%;
    min-height: 3.35rem;
    border: 1px solid var(--line);
    border-radius: .95rem;
    background: #fff;
    color: var(--ink);
    padding: 0 1rem;
    outline: none;
    font-size: .92rem;
    font-weight: 850;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .04);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.lg-input:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 4px rgba(15, 23, 42, .08), 0 18px 34px rgba(15, 23, 42, .07);
    transform: translateY(-1px);
}

.remember-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}

.remember-row input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--ink);
}

.lg-btn,
.solid-btn,
.ghost-btn {
    min-height: 3.35rem;
    border: 0;
    border-radius: .95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    font-size: .78rem;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.lg-btn,
.solid-btn {
    color: #fff;
    background: #0f172a;
    box-shadow: 0 18px 36px rgba(15, 23, 42, .22);
}

.lg-btn:hover,
.solid-btn:hover,
.ghost-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.ghost-btn {
    color: #334155;
    background: #e2e8f0;
}

.switch-copy {
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}

.switch-copy button {
    border: 0;
    background: transparent;
    color: var(--cyan);
    font-weight: 950;
    cursor: pointer;
}

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(10px);
    animation: fadeIn .24s ease both;
}

.login-modal.hidden { display: none; }

.login-modal-card {
    position: relative;
    width: min(26rem, 100%);
    border-radius: 1.35rem;
    background: #fff;
    border: 1px solid var(--line);
    padding: 1.4rem;
    box-shadow: 0 30px 90px rgba(15, 23, 42, .32);
    animation: modalIn .28s ease both;
}

.login-modal-card h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 950;
}

.login-modal-card p {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 750;
    line-height: 1.5;
    margin: .35rem 0 1rem;
}

.modal-close {
    position: absolute;
    top: .8rem;
    right: .8rem;
    width: 2.4rem;
    height: 2.4rem;
    border: 0;
    border-radius: .8rem;
    background: #f1f5f9;
    color: #475569;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-top: 1rem;
}

.modal-alert-icon {
    font-size: 3.4rem;
    color: var(--gold);
    margin-bottom: .5rem;
}

.toast-login {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    pointer-events: none;
}

.fade-in { animation: fadeIn .32s ease both; }

@keyframes scanScene {
    from { background-position: 0 0, 0 0; }
    to { background-position: 180px 0, 72px 0; }
}

@keyframes floatPanel {
    0%, 100% { transform: rotateX(8deg) rotateY(-12deg) translateY(0); }
    50% { transform: rotateX(8deg) rotateY(-12deg) translateY(-12px); }
}

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

@keyframes barPulse {
    0%, 100% { filter: brightness(1); transform: scaleY(1); }
    50% { filter: brightness(1.25); transform: scaleY(1.04); }
}

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

@keyframes modalIn {
    from { opacity: 0; transform: translateY(18px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 980px) {
    body.login-shell { overflow-y: auto; }

    .login-stage {
        grid-template-columns: 1fr;
    }

    .login-product {
        display: none;
    }

    .login-card {
        min-height: 100vh;
    }

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

@media (max-width: 560px) {
    .login-card {
        padding: 1.2rem;
    }

    .dual-fields {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        grid-template-columns: 1fr;
    }
}
