:root {
    --orange: #ff7a00;
    --orange-2: #ff9a3c;
    --orange-dark: #c95c00;
    --black: #0a0a0a;
    --panel: #141414;
    --panel-2: #1c1c1c;
    --line: #2a2a2a;
    --text: #f2f2f2;
    --muted: #9a9a9a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', system-ui, sans-serif;
    background: var(--black);
    color: var(--text);
    overflow-x: hidden;
}

/* ---------- Background scene ---------- */
.scene-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    perspective: 600px;
    pointer-events: none;
}

.grid-floor {
    position: absolute;
    left: -50%;
    right: -50%;
    bottom: -40%;
    height: 90%;
    background-image:
        linear-gradient(rgba(255, 122, 0, .35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 122, 0, .35) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: rotateX(70deg);
    mask-image: linear-gradient(to top, #000 10%, transparent 75%);
    -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 75%);
    animation: floorMove 6s linear infinite;
}

@keyframes floorMove {
    from { background-position: 0 0; }
    to   { background-position: 0 60px; }
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: .35;
}
.glow-1 { width: 420px; height: 420px; background: var(--orange); top: -120px; left: -100px; }
.glow-2 { width: 360px; height: 360px; background: var(--orange-dark); bottom: -120px; right: -80px; opacity: .25; }

/* ---------- Shell ---------- */
main { position: relative; z-index: 1; }

.login-shell {
    max-width: 1150px;
    min-height: 640px;
    background: linear-gradient(145deg, rgba(28, 28, 28, .85), rgba(10, 10, 10, .9));
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, .7),
        0 0 0 1px rgba(255, 122, 0, .05),
        inset 0 1px 0 rgba(255, 255, 255, .05);
    backdrop-filter: blur(8px);
}

/* ---------- Brand panel ---------- */
.brand-panel {
    padding: 48px;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 122, 0, .18), transparent 55%),
        linear-gradient(160deg, #161616, #0b0b0b);
    border-right: 1px solid var(--line);
}

.logo-mark {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--orange-2), var(--orange-dark));
    color: #000;
    font-size: 1.25rem;
    box-shadow: 0 6px 0 #7a3800, 0 10px 20px rgba(255, 122, 0, .35);
}
.logo-text { font-weight: 700; font-size: 1.35rem; letter-spacing: .5px; }
.logo-text span { color: var(--orange); font-weight: 400; margin-left: 2px; }

.brand-title {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 4px 0 rgba(0, 0, 0, .6);
}
.brand-title span {
    background: linear-gradient(90deg, var(--orange), var(--orange-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand-sub { color: var(--muted); max-width: 420px; margin: 14px 0 26px; }

.brand-stats > div {
    padding: 10px 16px;
    border-left: 3px solid var(--orange);
    background: rgba(255, 255, 255, .03);
    border-radius: 0 10px 10px 0;
}
.brand-stats strong { display: block; font-size: .95rem; }
.brand-stats small { color: var(--muted); font-size: .75rem; }

/* ---------- 3D cube ---------- */
.cube-stage {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 900px;
}
.cube {
    width: 130px; height: 130px;
    position: relative;
    transform-style: preserve-3d;
    animation: spin 14s linear infinite;
}
.face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    color: var(--orange);
    background: linear-gradient(145deg, rgba(255, 122, 0, .14), rgba(0, 0, 0, .85));
    border: 1px solid rgba(255, 122, 0, .55);
    box-shadow: inset 0 0 30px rgba(255, 122, 0, .25);
    border-radius: 14px;
}
.front  { transform: translateZ(65px); }
.back   { transform: rotateY(180deg) translateZ(65px); }
.right  { transform: rotateY(90deg) translateZ(65px); }
.left   { transform: rotateY(-90deg) translateZ(65px); }
.top    { transform: rotateX(90deg) translateZ(65px); }
.bottom { transform: rotateX(-90deg) translateZ(65px); }

@keyframes spin {
    from { transform: rotateX(-20deg) rotateY(0); }
    to   { transform: rotateX(-20deg) rotateY(360deg); }
}

/* ---------- Login card (3D tilt) ---------- */
.tilt-wrap { perspective: 1200px; width: 100%; max-width: 430px; }

.login-card {
    position: relative;
    padding: 40px 36px 28px;
    border-radius: 20px;
    background: linear-gradient(160deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line);
    border-top: 3px solid var(--orange);
    transform-style: preserve-3d;
    transition: transform .15s ease-out, box-shadow .3s;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, .65),
        0 0 40px rgba(255, 122, 0, .08);
}
.login-card > * { transform: translateZ(30px); }

.card-title-3d {
    font-weight: 700;
    font-size: 1.9rem;
    margin-bottom: 4px;
    text-shadow: 0 3px 0 #000;
}
.text-secondary-soft { color: var(--muted); font-size: .92rem; }

.form-label { font-size: .82rem; color: #cfcfcf; font-weight: 500; margin-bottom: 6px; }

.input-3d { position: relative; }
.input-3d > i {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--orange);
    z-index: 2;
}
.input-3d .form-control {
    height: 50px;
    padding-left: 42px;
    padding-right: 44px;
    background: #0e0e0e;
    color: var(--text);
    border: 1px solid #2c2c2c;
    border-radius: 12px;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .04);
    transition: border-color .2s, box-shadow .2s;
}
.input-3d .form-control::placeholder { color: #5f5f5f; }
.input-3d .form-control:focus {
    border-color: var(--orange);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, .7), 0 0 0 3px rgba(255, 122, 0, .2);
}
.toggle-pass {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    background: none; border: 0;
    color: var(--muted);
    padding: 6px 8px;
}
.toggle-pass:hover { color: var(--orange); }

.invalid-msg { display: none; color: #ff8a3d; font-size: .78rem; margin-top: 5px; }
.is-invalid-field .invalid-msg { display: block; }
.is-invalid-field .form-control { border-color: #ff5a1f; }

.form-check-input { background-color: #0e0e0e; border-color: #444; }
.form-check-input:checked { background-color: var(--orange); border-color: var(--orange); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(255, 122, 0, .2); border-color: var(--orange); }
.form-check-label { color: #bdbdbd; }

.link-orange { color: var(--orange); text-decoration: none; }
.link-orange:hover { color: var(--orange-2); text-decoration: underline; }

/* 3D push button */
.btn-3d {
    height: 52px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #000;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--orange-2), var(--orange));
    box-shadow: 0 6px 0 var(--orange-dark), 0 12px 24px rgba(255, 122, 0, .35);
    transition: transform .1s, box-shadow .1s, filter .2s;
}
.btn-3d:hover { color: #000; filter: brightness(1.07); }
.btn-3d:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 var(--orange-dark), 0 4px 10px rgba(255, 122, 0, .3);
}
.btn-3d:disabled { color: #000; opacity: .85; }

.alert-orange {
    background: rgba(255, 122, 0, .1);
    border: 1px solid rgba(255, 122, 0, .4);
    color: var(--orange-2);
    border-radius: 10px;
}

.card-foot {
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: .75rem;
    color: #6f6f6f;
}
.card-foot i { color: var(--orange); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .login-shell { max-width: 480px; min-height: auto; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; }
}
@media (max-width: 575.98px) {
    .login-card { padding: 30px 22px 22px; }
    .card-title-3d { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cube, .grid-floor { animation: none; }
}
