body {
    background: #0a0a0a;
    color: #e8f1ff;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

#particles {
    opacity: .18;
    filter: saturate(70%);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#loginbox {
    position: relative;
    z-index: 2;
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 !important;
    padding: 0 !important;
    animation: fadeInUp .36s ease-out both;
}

#loginbox.mainbox {
    float: none !important;
    margin: 0 auto !important;
}

#loginbox.col-md-6,
#loginbox.col-sm-6 {
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    float: none !important;
}

.panel.panel-default {
    background: rgba(15,20,27,0.78);
    border: 1px solid #1b2636;
    box-shadow: 0 10px 28px rgba(0,0,0,0.55);
    border-radius: 12px;
    backdrop-filter: blur(2px);
}

.panel.panel-default > .panel-heading {
    background: rgba(15,20,27,0.78);
    border-bottom: 1px solid #1b2636;
}

.panel-title { color: #e8f1ff; }

.panel-body { background: transparent; }

.panel-title img {
    display: block;
    margin: 0 auto;
    max-width: 60%;
    animation: fadeIn .3s ease-out .05s both;
}

.form-control {
    background: #0c1117;
    border: 1px solid #1f2b3d;
    color: #dbe8ff;
    border-radius: 8px;
    padding: 12px 15px;
    height: auto;
    min-height: 45px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input.form-control:-webkit-autofill,
input.form-control:-webkit-autofill:hover,
input.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: #dbe8ff;
    -webkit-box-shadow: 0 0 0 1000px #0c1117 inset !important;
    box-shadow: 0 0 0 1000px #0c1117 inset !important;
    caret-color: #dbe8ff;
    transition: background-color 9999s ease-in-out 0s;
}

input.form-control:-moz-autofill {
    box-shadow: 0 0 0 1000px #0c1117 inset;
    -moz-text-fill-color: #dbe8ff;
    caret-color: #dbe8ff;
}

.form-control::placeholder { color: #8aa0bf; }

.input-group-addon {
    background: #0c1117;
    color: #8aa0bf;
    border: 1px solid #1f2b3d;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    padding: 12px 15px;
    min-height: 45px;
    display: flex;
    align-items: center;
    flex: 0 0 45px;
    transition: color .15s ease, border-color .15s ease;
}

.input-group .form-control { 
    border-left: 0; 
    border-radius: 0 8px 8px 0;
}

.input-group { 
    position: relative; 
    border-radius: 6px; 
    animation: fadeInUp .32s ease-out .06s both; 
    transition: box-shadow .15s ease;
    display: flex;
}
.input-group + .input-group { animation-delay: .12s; }

.input-group:focus-within { box-shadow: 0 0 0 3px rgba(58,169,255,0.12); }
.input-group:focus-within .form-control { border-color: #2f6fff; box-shadow: inset 2px 0 0 0 #3aa9ff; }
.input-group:focus-within .input-group-addon { 
    color: #a5cfff; 
    border-color: #2f6fff; 
    border-right-color: #2f6fff;
}

.btn.btn-primary {
    --btn-start: rgba(58,169,255,0.6);
    --btn-end: rgba(47,111,255,0.5);
    --btn-hover-start: rgba(58,169,255,0.8);
    --btn-hover-end: rgba(47,111,255,0.7);
    background: linear-gradient(135deg, var(--btn-start) 0%, var(--btn-end) 100%);
    border: 1px solid rgba(58,169,255,0.4);
    color: #e8f1ff;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    letter-spacing: .2px;
    transition: all .2s ease;
    box-shadow: 0 2px 8px rgba(58,169,255,0.1);
    animation: fadeInUp .32s ease-out .18s both;
}

.btn.btn-primary .glyphicon,
.btn.btn-primary .fa { margin-right: 8px; }

.btn.btn-primary:hover,
.btn.btn-primary:focus {
    background: linear-gradient(135deg, var(--btn-hover-start) 0%, var(--btn-hover-end) 100%);
    border-color: rgba(58,169,255,0.8);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(58,169,255,0.3), 0 0 20px rgba(58,169,255,0.2);
    transform: translateY(-1px);
}

.btn.btn-primary:active { transform: translateY(1px); }

/* Fix form-group margin */
#loginbox .form-group {
    margin-bottom: 0 !important;
}

/* Fix checkbox and label alignment - only for remember me */
#loginbox .form-group .col-sm-6:first-child .input-group {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#loginbox input[type="checkbox"] {
    margin: 0 !important;
    flex-shrink: 0 !important;
}

#loginbox label {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.login-error {
    margin-bottom: 16px;
    text-align: center;
    animation: fadeIn .25s ease-out both;
}

.login-error.alert {
    background: rgba(191, 54, 12, 0.12);
    border: 1px solid rgba(244, 67, 54, 0.35);
    color: #ff8a80;
}

.input-group.pull-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    animation: fadeIn .28s ease-out .14s both;
}

#remember_me {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid #25405a;
    background: #0c1117;
    position: relative;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 0 0 rgba(58,169,255,0);
    transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

#remember_me:focus {
    box-shadow: 0 0 0 3px rgba(58,169,255,0.2);
    border-color: #3aa9ff;
}

#remember_me:checked {
    background: linear-gradient(135deg, #3aa9ff 0%, #2f6fff 100%);
    border-color: #2f6fff;
}

#remember_me:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 4px;
    height: 9px;
    border: solid #06141f;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pull-right label {
    color: #aac3e6;
    margin: 0;
    line-height: 18px;
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0 }
    to { opacity: 1 }
}

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


