/* Variables & Reset */
:root {
    --primary-white: #ffffff;
    --accent-cyan: #68dfe3;
    --accent-yellow: #ffdc5c;
    --white: #ffffff;
    --dark-bg: #08092b;
    --input-bg: #0e0f3d;
    --font-head: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--dark-bg); color: var(--white); font-family: var(--font-body);
    height: 100vh; display: flex; justify-content: center; align-items: center;
    overflow: hidden; position: relative;
    background: radial-gradient(circle at 50% 50%, #121342 0%, #08092b 100%);
}
body.no-scroll { overflow: hidden !important; }

/* Preloader */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(8, 9, 43, 0.95);
    backdrop-filter: blur(10px); z-index: 999999; display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease-out;
}
.loader-content { position: relative; width: 120px; height: 120px; display: flex; justify-content: center; align-items: center; }
.loader-circle {
    position: absolute; width: 100%; height: 100%; border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-white); border-bottom-color: var(--accent-cyan);
    border-radius: 50%; animation: spin 1s linear infinite; box-shadow: 0 0 15px var(--primary-white);
}
.loader-icon { font-size: 2.5rem; color: var(--white); animation: iconPulse 0.8s infinite alternate; transition: opacity 0.2s; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes iconPulse { 0% { transform: scale(0.8); opacity: 0.7; filter: blur(1px); } 100% { transform: scale(1.1); opacity: 1; filter: blur(0); } }

/* Layout & UI */
.grid-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(255,255,255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px; background-position: center; pointer-events: none; z-index: 0;
}

.back-home-btn {
    position: absolute; top: 30px; left: 30px; color: var(--white); text-decoration: none;
    font-family: var(--font-head); font-weight: 800; text-transform: uppercase; font-size: 0.85rem;
    letter-spacing: 2px; z-index: 10; transition: 0.2s; display: flex; align-items: center; gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1); padding: 12px 18px; border-radius: 5px; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
}
.back-home-btn:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); text-shadow: 0 0 10px rgba(104, 223, 227, 0.8); }

/* Footer */
.footer-bottom {
    position: absolute; bottom: 35px; width: 100%; text-align: center;
    font-size: 0.95rem; color: #888; z-index: 10; font-family: var(--font-body);
}

/* Login Box */
.login-container { width: 100%; max-width: 480px; padding: 20px; z-index: 1; }
.login-box {
    background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(20px);
    padding: 60px 50px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8); transition: border-color 0.3s;
}
.login-box:hover { border-color: rgba(104, 223, 227, 0.3); }

/* Header Text */
.header-titles { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; }

.security-status { color: var(--accent-yellow); font-family: var(--font-head); font-weight: 800; letter-spacing: 4px; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 10px; }
h1 { font-family: var(--font-head); font-size: 3.5rem; margin-bottom: 10px; line-height: 1; letter-spacing: -1px; font-weight: 800; }
.desc-text { font-size: 1rem; color: #888; margin-bottom: 40px; font-weight: 400; }

.glitch-wrapper { display: inline-block; position: relative; }
.glitch { position: relative; background: linear-gradient(90deg, var(--primary-white), var(--accent-cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; text-transform: uppercase; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--dark-bg); -webkit-background-clip: text; background-clip: text; }
.glitch::before { left: 3px; text-shadow: -1px 0 var(--primary-white); clip: rect(24px, 550px, 90px, 0); animation: glitch-anim 3s infinite linear alternate-reverse; }
.glitch::after { left: -3px; text-shadow: -1px 0 var(--accent-cyan); clip: rect(85px, 550px, 140px, 0); animation: glitch-anim2 3s infinite linear alternate-reverse; }
@keyframes glitch-anim { 0% { clip: rect(30px, 9999px, 10px, 0); } 100% { clip: rect(0, 0, 0, 0); } }
@keyframes glitch-anim2 { 0% { clip: rect(60px, 9999px, 70px, 0); } 100% { clip: rect(0, 0, 0, 0); } }

/* Form & Input */
.form-group { position: relative; margin-bottom: 25px; width: 100%; text-align: left; }
.input-icon { position: absolute; left: 20px; top: 32.5px; transform: translateY(-50%); color: var(--accent-cyan); font-size: 1.1rem; }

.login-box input {
    width: 100%; height: 65px; padding: 0 55px; line-height: 65px; background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; color: var(--white);
    font-family: var(--font-body); font-size: 1.1rem; letter-spacing: 4px; transition: all 0.2s;
    text-transform: uppercase; 
}
.login-box input::placeholder { color: #555; letter-spacing: 2px; font-size: 0.9rem; line-height: normal; text-transform: uppercase; }
.login-box input:focus { outline: none; background: #000; border-color: rgba(104, 223, 227, 0.4); border-bottom: 2px solid var(--accent-cyan); }

/* Validation & Shake */
.error-msg { display: none; color: var(--primary-white); font-size: 0.75rem; font-family: var(--font-head); font-weight: 800; margin-top: 10px; letter-spacing: 1px; }
.login-box input.error-border { border-color: var(--primary-white) !important; border-bottom: 2px solid var(--primary-white) !important; box-shadow: 0 0 15px rgba(255, 255, 255, 0.2) !important; }
.shake { animation: shakeAnim 0.4s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shakeAnim {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(5px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-10px, 0, 0); }
    40%, 60% { transform: translate3d(10px, 0, 0); }
}

/* Button */
.btn-main {
    width: 100%; height: 65px; background: linear-gradient(45deg, var(--accent-cyan), #4cb5f0);
    color: #000; font-family: var(--font-head); font-size: 1.05rem; font-weight: 800;
    text-transform: uppercase; border-radius: 8px; border: none; cursor: pointer; transition: all 0.3s; box-shadow: 0 0 20px rgba(104, 223, 227, 0.2); letter-spacing: 2px;
}
.btn-main:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(104, 223, 227, 0.5); }
.btn-main:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* Responsive */
@media (max-width: 768px) {
    .back-home-btn { top: 20px; left: 20px; font-size: 0.75rem; padding: 10px 15px; }
    h1 { font-size: 2.5rem; }
    .login-container { padding: 15px; }
    .login-box { padding: 50px 30px; border: none; background: rgba(10, 10, 10, 0.98); }
    .footer-bottom { font-size: 0.8rem; bottom: 25px; }
}