:root {
    --primary-color: #00a8ff;
    --primary-hover: #0097e6;
    --bg-overlay: rgba(0, 0, 0, 0.6);
    --glass-bg: rgba(20, 20, 20, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #f5f6fa;
    --text-secondary: #dcdde1;
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.2);
    --input-focus: rgba(0, 168, 255, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: url('/static/images/background5.jpg') no-repeat center center;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: var(--primary-color);
    text-transform: uppercase;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Main Container */
.login-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-overlay);
    backdrop-filter: blur(5px);
}

.login-card {
    width: 1000px;
    height: 600px;
    display: flex;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    animation: slideUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
    overflow: hidden;
}

.login-left {
    flex: 6;
    border-right: 1px solid var(--glass-border);
    position: relative;
    background: rgba(0, 0, 0, 0.2);
}

.announcement-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.login-right {
    flex: 4;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-header {
    text-align: center;
    margin-bottom: 25px;
}

.brand-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(0, 168, 255, 0.3));
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px var(--input-focus);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color 0.3s;
}

.form-input:focus + .input-icon {
    color: var(--primary-color);
}

/* Slider Captcha Customization */
.slider-wrapper {
    margin-bottom: 20px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
    overflow: hidden;
    width: 360px; /* Updated width */
    margin-left: auto;
    margin-right: auto;
}

#slider-captcha-container {
    position: relative;
    width: 100%;
    height: 100px; /* Updated height to match backend generation */
    background: #2d3436;
    overflow: hidden;
}

#slider-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#slider-piece {
    position: absolute;
    left: 0;
    top: 0;
    height: 50px; /* Adjust based on backend generation */
    width: 50px;
    cursor: pointer;
    z-index: 10;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.8));
}

#slider-bar {
    position: relative;
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid var(--glass-border);
}

#slider-text {
    position: absolute;
    width: 100%;
    height: 100%;
    line-height: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    user-select: none;
    pointer-events: none;
}

#slider-mask {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(0, 168, 255, 0.2);
    width: 0;
}

#slider-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.5);
    transition: background 0.3s;
}

#slider-handle:hover {
    background: var(--primary-hover);
}

#slider-handle .arrow {
    color: white;
    font-weight: bold;
    font-size: 18px;
}

/* Button */
.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), #0984e3);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 168, 255, 0.4);
}

.btn-login:disabled {
    background: #636e72;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Links */
.auth-links {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.auth-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.auth-links a:hover {
    color: var(--primary-color);
}

.error-message {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #ff7675;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        width: 90%;
        padding: 25px;
    }
}
