/* ========================================================
   Terminal Services v2 - Login specific styles (Premium)
   ======================================================== */

:root {
    --accent-color: hsl(120, 100%, 50%);
    --accent-dim: hsl(120, 100%, 25%);
    --accent-glow: hsla(120, 100%, 50%, 0.5);
    --error-color: hsl(0, 100%, 50%);
    --error-glow: hsla(0, 100%, 50%, 0.3);
    --glass-bg: rgba(8, 8, 8, 0.6);
    --glass-border: rgba(0, 255, 0, 0.3);
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #000; /* Solid black for maximum contrast with Matrix rain */
    color: var(--text-color);
    font-family: var(--font-mono);
    perspective: 1000px;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 40px;
    background: rgba(8, 8, 8, 0.45); /* More transparent to see the Matrix behind it */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.15), inset 0 0 10px rgba(0, 255, 0, 0.05);
    border-radius: 4px;
    animation: fadeInScale 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95) translateZ(-50px); }
    to { opacity: 1; transform: scale(1) translateZ(0); }
}

.login-container.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.login-header {
    margin-bottom: 35px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    padding-bottom: 20px;
}

.login-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent-color);
    width: 0;
    animation: typing 1.5s steps(23) 0.5s forwards, blink-cursor 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-cursor {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-color) }
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--accent-dim);
    letter-spacing: 1px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--accent-dim);
    transition: color 0.3s ease;
    min-height: 1.2rem; /* Prevent collapse when empty */
    line-height: 1.2;
    display: block;
}

.form-group:focus-within label {
    color: var(--accent-color);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-group input {
    width: 100%;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(0, 255, 0, 0.2);
    color: var(--accent-color);
    padding: 12px 15px;
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    border-radius: 2px;
    min-height: 46px; /* Ensure stable height */
}

.form-group input:focus {
    border-color: var(--accent-color);
    background: rgba(30, 30, 30, 0.9);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.15);
}

.password-toggle {
    position: absolute;
    right: 12px;
    cursor: pointer;
    color: var(--accent-dim);
    font-size: 0.8rem;
    user-select: none;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--accent-color);
}

.btn-login {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 15px;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    letter-spacing: 2px;
}

.btn-login:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-login:active {
    transform: scale(0.98);
}

.btn-login.loading {
    color: transparent;
    pointer-events: none;
}

.btn-login.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid #000;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    text-align: center;
    background: var(--error-glow);
    padding: 12px;
    border: 1px solid var(--error-color);
    margin: 10px 0;
    animation: glitch 0.3s ease;
}

@keyframes glitch {
    0% { transform: translate(0) }
    20% { transform: translate(-3px, 3px) }
    40% { transform: translate(-3px, -3px) }
    60% { transform: translate(3px, 3px) }
    80% { transform: translate(3px, -3px) }
    100% { transform: translate(0) }
}

/* Mobile Responsiveness for Login Screen */
@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
        width: 90%;
    }
    .login-title {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
    .login-subtitle {
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    .login-container {
        padding: 25px 15px;
    }
    .login-title {
        font-size: 0.95rem;
        letter-spacing: 0;
    }
}

