:root {
    /* EmpireOne brand — purple primary, blue secondary (see style.css) */
    --brand-cyan: #7F3FFC;
    --brand-cyan-hover: #9D6BFF;
    --brand-orange: #7F3FFC;
    --brand-yellow: #1C63F8;
    --brand-accent: var(--brand-purple);
    --brand-accent-hover: var(--brand-blue);
    --secondary: var(--brand-blue);

    /* Spacing & Sizes */
    --logo-nav-height: 60px;
    --password-input-padding-right: 50px;
    --icon-size-sm: 20px;
    
    /* Layout Defaults */
    --wrapper-z-index: 5;
    --nav-z-index: 20;
    --card-z-index: 10;
}

/* --- DARK THEME VARIABLES --- */
[data-theme="dark"] {
    --bg-base: #05060F;
    --bg-surface: #0D0F1C;
    --bg-card: rgb(33 34 48 / 44%);
    --bg-glass: rgb(33 34 48 / 44%);
    --login-input-bg: rgba(0, 0, 0, 0.4);
    --login-input-border: rgba(255, 255, 255, 0.10);
    --login-input-autofill: rgba(0, 0, 0, 0.4);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-base: rgb(255 255 255 / 22%);
    --border-strong: rgba(255, 255, 255, 0.18);
    --bg-color: #05060F;
    --orb-before-bg: linear-gradient(135deg, rgba(76, 141, 255,0.18), rgba(127, 63, 252,0.10));
    --orb-after-bg: linear-gradient(135deg, rgba(127, 63, 252,0.12), rgba(28, 99, 248,0.10));
    --grid-line-color: rgba(255, 255, 255, 0.04);
    
    --card-bg: var(--bg-card);
    --card-border: var(--border-base);
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.86);
    --text-title: #ffffff;
    --text-subtitle: white;
    --text-muted: rgba(255, 255, 255, 0.7);
}

/* --- LIGHT THEME VARIABLES --- */
[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: rgb(229 229 229 / 30%);
    --bg-glass: rgba(255, 255, 255, 0.72);
    --login-input-bg: rgba(255, 255, 255, 0.86);
    --login-input-border: rgba(15, 23, 42, 0.10);
    --login-input-autofill: rgba(255, 255, 255, 0.86);
    --border-subtle: rgba(15, 23, 42, 0.05);
    --border-base: rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.16);
    --bg-color: #f8fafc;
    --orb-before-bg: linear-gradient(135deg, rgba(76, 141, 255,0.16), rgba(127, 63, 252,0.10));
    --orb-after-bg: linear-gradient(135deg, rgba(127, 63, 252,0.08), rgba(28, 99, 248,0.12));
    --grid-line-color: rgba(15, 23, 42, 0.05);
    
    --card-bg: var(--bg-card);
    --card-border: rgba(0, 0, 0, 0.10);
    --card-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-title: #111827;
    --text-subtitle: #1c1e23;
    --text-muted: #4b5563;
}

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

img{
    max-width:100%;
    height:auto;
}

input,
button{
    font:inherit;
}

html,
    body {
        margin: 0;
        padding: 0;
        width: 100%;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

.animated-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background-color: var(--bg-color);
    transition: background-color 0.5s ease;
}

#particleCanvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: block;
}

/* Glowing Orbs using ::before and ::after */
.animated-bg::before,
.animated-bg::after {
    content: '';
    position: absolute;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: floatOrbs 20s ease-in-out infinite alternate;
    z-index: 1;
}

.animated-bg::before {
    top: -20%;
    left: -10%;
    background: var(--orb-before-bg);
}

.animated-bg::after {
    bottom: -20%;
    right: -10%;
    animation-delay: -10s;
    background: var(--orb-after-bg);
}

/* Subtle WorkGrid Overlay */
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 2;
    background-size: 50px 50px;
    background-image:
        linear-gradient(var(--grid-line-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line-color) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    pointer-events: none;
}

@keyframes floatOrbs {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(6%, 12%) scale(1.1); }
    66% { transform: translate(-4%, 6%) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* --- WRAPPER --- */
.wrapper {
    position: relative;
    width: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    z-index: var(--wrapper-z-index);
}

/* --- TOP HEADER NAV --- */
.login-nav {
    width: 100%;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: var(--nav-z-index);
    pointer-events: none; 
    box-sizing: border-box;
}

.login-nav > * {
    pointer-events: auto; 
}

.nav-logo img {
    height: var(--logo-nav-height);
    object-fit: contain;
    transition: all 0.3s ease;
}

/* --- LOGIN CARD STYLING --- */
.login-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;   /* Card upar rahega */
    width: 100%;
    min-height: 100vh;
    padding: 1rem 1.5rem 1.5rem;
    box-sizing: border-box;
    position: relative;
    z-index: var(--card-z-index);
}

.login-card {
    width: 100%;
    max-width: 425px;
    padding: 3rem 3rem;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    opacity: 1; 
}

.login-header {
    text-align: center;
    margin-bottom: 1.45rem;
}

.login-logo {
    width: 45%;
    height: 45%;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 1.5rem;
}

.login-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-title);
}

.login-subtitle {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-subtitle);
}

/* --- FORM GRID & FIELDS --- */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-field-password {
    padding-right: var(--password-input-padding-right);
}

.login-card .input-field {
    background: var(--login-input-bg);
    border-color: var(--login-input-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.login-card .input-field::placeholder {
    opacity: 1;
    color: var(--text-muted);
    transition: opacity 0.2s ease;
}

.login-card .input-field:focus::placeholder,
.login-card .input-field:not(:placeholder-shown)::placeholder,
.login-card .input-field:-webkit-autofill::placeholder {
    opacity: 0;
    color: transparent;
}

.login-card .input-field:-webkit-autofill,
.login-card .input-field:-webkit-autofill:hover,
.login-card .input-field:-webkit-autofill:focus,
.login-card .input-field:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--login-input-autofill) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

.login-card .input-label {
    background: transparent;
}

.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    color: var(--text-muted);
    transition: all 0.2s ease;
    z-index: 5;
    outline: none;
}

.password-toggle:hover, .password-toggle:focus {
    opacity: 1;
    color: var(--brand-cyan);
    transform: translateY(-50%) scale(1.1);
}

.icon-size-sm {
    width: var(--icon-size-sm);
    height: var(--icon-size-sm);
}

.btn-icon-margin {
    margin-left: 8px;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
}

.remember-me input[type="checkbox"] {
    accent-color: var(--secondary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    border-radius: 8px;
}

.forgot-pass {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.forgot-pass:hover {
    text-decoration: underline;
}

.btn-full {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
}

.btn-full {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Soft Glow */
.btn-full::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.15),
        rgba(76, 141, 255,0.30),
        rgba(127, 63, 252,0.22),
        rgba(255,255,255,0.15)
    );
    filter: blur(12px);
    opacity: 0;
    transition: opacity .4s ease;
    z-index: -1;
}

/* Shine Effect */
.btn-full::after {
    content: "";
    position: absolute;
    top: -40%;
    left: -120%;
    width: 45%;
    height: 180%;
    background: linear-gradient(
        115deg,
        transparent 0%,
        rgba(255,255,255,0.15) 35%,
        rgba(255,255,255,0.75) 50%,
        rgba(255,255,255,0.15) 65%,
        transparent 100%
    );
    transform: rotate(25deg);
    transition: left .8s cubic-bezier(.19,1,.22,1);
}

/* Hover */
.btn-full:hover::before{
    opacity:1;
}

.btn-full:hover::after{
    left:150%;
}

[data-theme="dark"] {
    --otp-input-bg: rgba(15, 23, 42, 0.6);
    --otp-input-border: rgba(255, 255, 255, 0.15);
    --otp-input-text: #ffffff;
    --otp-text-muted: rgba(255, 255, 255, 0.7);
    --otp-text-disabled: rgba(255, 255, 255, 0.4);
    --otp-focus-glow: rgba(76, 141, 255, 0.25);
}

/* Light Theme Specific Variables Override */
[data-theme="light"] {
    --otp-input-bg: rgba(255, 255, 255, 0.9);
    --otp-input-border: rgba(203, 213, 225, 0.9);
    --otp-input-text: #0f172a;
    --otp-text-muted: #475569;
    --otp-text-disabled: #94a3b8;
    --otp-focus-glow: rgba(76, 141, 255, 0.20);
}

.otp-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 1.5rem 0 1rem 0;
}

.otp-input {
    width: 100%;
    height: 52px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 8px !important; /* 8px Border Radius */
    background: var(--otp-input-bg);
    border: 1px solid var(--otp-input-border);
    color: var(--otp-input-text) !important;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.otp-input:focus {
    border-color: var(--brand-cyan, #7F3FFC);
    box-shadow: 0 0 0 3px var(--otp-focus-glow);
    transform: translateY(-2px);
}

.otp-options {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
}

.remember-device {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--otp-text-muted);
    transition: color 0.2s ease;
}

.remember-device input[type="checkbox"] {
    accent-color: var(--brand-cyan, #7F3FFC);
    width: 16px;
    height: 16px;
    cursor: pointer;
    border-radius: 4px;
}

.resend-container {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.88rem;
    color: var(--otp-text-muted);
    transition: color 0.2s ease;
}

.resend-btn {
    background: none;
    border: none;
    color: var(--brand-cyan, #7F3FFC);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 0.88rem;
    text-decoration: underline;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.resend-btn:disabled {
    color: var(--otp-text-disabled);
    cursor: not-allowed;
    text-decoration: none;
}

/* Large Desktop */
@media (min-width:1600px){

    .login-card{
        max-width:520px;
        padding:3.5rem;
    }

    .login-title{
        font-size:2.2rem;
    }

    .login-subtitle{
        font-size:1rem;
    }

}

/* Laptop */
@media (max-width:1200px){

    .login-card{
        max-width:440px;
    }

}

/* Tablet */
@media (max-width:992px){

    :root{
        --logo-nav-height:52px;
    }

    .login-nav{
        padding:18px 24px;
    }

    .login-layout{
        padding:30px 24px;
    }

    .login-card{
        max-width:430px;
        padding:2.5rem;
    }

}

/* Mobile */
@media (max-width:768px){

    :root {
        --logo-nav-height: 60px;
    }

    html,
    body{
        min-height:100%;
        overflow-y:auto;
    }

    .wrapper{
        min-height:100%;
    }

    .login-nav{
        padding:18px 18px 10px;
        position:sticky;
        top:0;
    }

    .login-layout{

        align-items:flex-start;
        justify-content:flex-start;

        padding:
            15px
            18px
            30px;

        min-height:auto;

    }

    .login-card{

        width:100%;
        max-width:100%;

        padding:
            60px
            26px;

        border-radius:18px;

    }

    .login-logo{

        width:160px;
        max-width:70%;
        height:auto;

        margin-inline:auto;
        display:block;

    }

    .login-title{

        font-size:1.7rem;

    }

    .login-subtitle{

        font-size:.92rem;

    }

    .form-grid{

        gap:18px;

    }

    .form-options{

        align-items:flex-start;
        gap:14px;

    }

    .btn-full{

        padding:15px;

    }

}

/* Small Mobile */
@media (max-width:480px){

    :root{

        --logo-nav-height:50px;
        --password-input-padding-right:46px;

    }

    .login-nav{

        padding:15px;

    }

    .login-layout{

        padding:12px 14px 20px;

    }

    .login-card{

        padding:45px 20px;
        border-radius:16px;

    }

    .login-logo{

        width:140px;

    }

    .login-title{

        font-size:1.45rem;

    }

    .login-subtitle{

        font-size:.85rem;

    }

    .form-grid{

        gap:15px;

    }

    .form-options{

        font-size:.85rem;

    }

    .btn-full{

        font-size:15px;
        padding:14px;

    }

}

/* Extra Small Devices */
@media (max-width:360px){

    .login-card{

        padding:30px 18px;

    }

    .login-logo{

        width:120px;

    }

    .login-title{

        font-size:1.3rem;

    }

    .login-subtitle{

        font-size:.8rem;

    }

}

/* Landscape Phones */
@media (max-height:700px){

    .wrapper{

        min-height:auto;

    }

    .login-layout{

        align-items:flex-start;

        padding-top:15px;
        padding-bottom:25px;

    }

}

/* Ultra Short Screens */
@media (max-height:600px){

    body{

        overflow-y:auto;

    }

}
