* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("hatter.jpg") center / cover no-repeat;
    filter: blur(6px) brightness(0.6);
    transform: scale(1.1);
    z-index: -1;
}

.login-box {
    width: 100%;
    max-width: 360px;
    padding: 30px;
    background: rgba(20, 20, 20, 0.82);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    box-shadow: 0 25px 45px rgba(0,0,0,0.5);
    text-align: center;
    transition: border 0.2s ease;
}

.login-box.error {
    border: 2px solid #ff4d4d;
}

.login-box.shake {
    animation: shake 0.4s;
}

@keyframes shake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-6px); }
    40%  { transform: translateX(6px); }
    60%  { transform: translateX(-6px); }
    80%  { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

.instruction {
    color: #f1f1f1;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.input-wrapper {
    position: relative;
    height: 52px;
    margin-bottom: 18px;
}

.input-wrapper input {
    width: 100%;
    height: 100%;
    padding: 0 44px;
    font-size: 1rem;
    color: #fff;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    outline: none;
    transition: 0.25s ease;
}

.input-wrapper input::placeholder {
    color: rgba(255,255,255,0.55);
}

.input-wrapper input:focus {
    border-color: #6ea8fe;
    box-shadow: 0 0 0 3px rgba(110,168,254,0.25);
}

.input-wrapper input.error {
    border-color: #ff4d4d;
    box-shadow: 0 0 0 3px rgba(255,77,77,0.3);
}

.icon {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    user-select: none;
}

.left-icon {
    left: 0;
    opacity: 0.6;
    pointer-events: none;
}

.right-icon {
    right: 0;
    cursor: pointer;
    opacity: 0.8;
}

.eye {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.eye.animate {
    transform: scale(0.7) rotate(-15deg);
    opacity: 0;
}

button {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #383838, #494949);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

button:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Loader */
.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    margin: auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

button.loading .btn-text {
    display: none;
}

button.loading .loader {
    display: block;
}

#errorMessage {
    margin-top: 12px;
    color: #ff6b6b;
    font-size: 0.9rem;
}
