* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

body {
    min-height: 100vh;
    background: #0b0b0f;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ---------- АНИМАЦИЯ КОСМОСА ---------- */
.cosmos-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    overflow: hidden;
}

/* Звёзды (мелкие) */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    box-shadow: 1744px 122px #fff , 134px 1321px #fff , 92px 859px #fff , 235px 1045px #fff , 366px 912px #fff , 498px 1423px #fff , 654px 456px #fff , 786px 382px #fff , 901px 654px #fff , 1089px 312px #fff , 1234px 765px #fff , 1400px 123px #fff , 1523px 876px #fff , 1678px 432px #fff , 1890px 1098px #fff , 210px 1456px #fff , 345px 1678px #fff , 478px 1890px #fff , 612px 2021px #fff;
    animation: moveStars 200s linear infinite;
    opacity: 0.8;
}

/* Мерцающие звёзды */
.twinkling {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    box-shadow: 456px 345px #aaa , 1234px 876px #ccc , 789px 1234px #ddd , 1678px 543px #bbb , 345px 1678px #999 , 987px 432px #aaa , 1456px 1789px #ccc , 567px 1890px #ddd;
    animation: twinkle 4s ease-in-out infinite alternate;
    opacity: 0.5;
}

/* Космическая туманность (облака) */
.clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(60, 70, 90, 0.2) 0%, transparent 40%),
                radial-gradient(circle at 70% 60%, rgba(40, 50, 70, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(80, 90, 110, 0.1) 0%, transparent 60%);
    animation: driftClouds 60s linear infinite;
}

@keyframes moveStars {
    0% { transform: translateY(0); }
    100% { transform: translateY(-2000px); }
}

@keyframes twinkle {
    0% { opacity: 0.2; }
    100% { opacity: 0.8; }
}

@keyframes driftClouds {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, -5%) rotate(2deg); }
}

/* ---------- КАРТОЧКА АВТОРИЗАЦИИ ---------- */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: rgba(20, 20, 28, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(100, 110, 130, 0.2);
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(70, 80, 100, 0.1) inset;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(120, 140, 170, 0.2) inset;
    transform: translateY(-5px);
}

h1 {
    color: #e0e5ec;
    font-weight: 500;
    font-size: 2.2rem;
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.subtitle {
    color: #8a95a5;
    font-size: 0.9rem;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(120, 140, 160, 0.2);
    padding-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Сообщения об ошибках / успехе */
.error-message, .success-message {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

.error-message {
    background: rgba(180, 50, 50, 0.15);
    border: 1px solid rgba(220, 80, 80, 0.4);
    color: #ffb0b0;
}

.success-message {
    background: rgba(40, 130, 90, 0.15);
    border: 1px solid rgba(70, 190, 140, 0.4);
    color: #b0ffd0;
}

/* Поля ввода */
.input-group {
    position: relative;
    margin-bottom: 28px;
}

.input-group label {
    display: block;
    color: #a0aab8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(10, 12, 18, 0.6);
    border: 1px solid rgba(100, 110, 130, 0.3);
    border-radius: 16px;
    color: #f0f4fa;
    font-size: 1rem;
    outline: none;
    transition: border 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(5px);
}

.input-group input:focus {
    border-color: #7a8b9e;
    box-shadow: 0 0 15px rgba(120, 150, 200, 0.2);
}

.input-group input::placeholder {
    color: #5a6472;
    font-weight: 300;
}

.focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #a0b0c0, transparent);
    transition: width 0.4s ease, left 0.4s ease;
}

.input-group input:focus ~ .focus-border {
    width: 100%;
    left: 0;
}

/* Кнопка */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(145deg, #2a3340, #1a1f28);
    border: 1px solid #4a5565;
    border-radius: 40px;
    color: #eaeef3;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 8px 0 #0f1218, 0 6px 15px rgba(0,0,0,0.5);
    transition: all 0.15s ease;
    margin-top: 8px;
    margin-bottom: 24px;
}

.login-btn:hover {
    background: linear-gradient(145deg, #324050, #222a35);
    border-color: #6a7a8e;
    box-shadow: 0 6px 0 #0f1218, 0 10px 20px rgba(0,0,0,0.6);
    transform: translateY(2px);
}

.login-btn:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #0f1218, 0 5px 12px rgba(0,0,0,0.6);
}

/* Дополнительные ссылки */
.additional-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: #7a8799;
}

.additional-links a {
    color: #b0bed0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.additional-links a:hover {
    color: #d0e0f0;
    text-decoration: underline;
}

.dot {
    color: #4a5a6a;
    font-weight: bold;
}

.demo-hint {
    margin-top: 24px;
    text-align: center;
    color: #6a7a8a;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Адаптация */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    h1 {
        font-size: 1.8rem;
    }
}