* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #050510;
    color: #c0c5d0;
    font-family: 'Exo 2', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* === RETROWAVE CANVAS === */
#retrowave {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* === ФОН === */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle 500px at var(--x, 50%) var(--y, 50%), rgba(0, 240, 255, 0.08), transparent),
        radial-gradient(circle 400px at calc(var(--x, 50%) + 200px) calc(var(--y, 50%) - 100px), rgba(255, 0, 255, 0.05), transparent),
        linear-gradient(180deg, rgba(5, 5, 16, 0.3) 0%, rgba(10, 10, 26, 0.3) 100%);
    z-index: 1;
}

/* === СКАНЛАЙНЫ === */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.12),
        rgba(0, 0, 0, 0.12) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 3;
}

/* === СЕТКА === */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 2;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* === ШУМ === */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 2;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* === УГЛОВЫЕ ДЕКОРАТИВНЫЕ ЭЛЕМЕНТЫ === */
.corner-decor {
    position: fixed;
    width: 80px;
    height: 80px;
    z-index: 5;
    pointer-events: none;
}

.corner-decor::before,
.corner-decor::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.6), transparent);
}

.corner-decor.top-left {
    top: 20px;
    left: 20px;
}

.corner-decor.top-left::before {
    top: 0;
    left: 0;
    width: 60px;
    height: 2px;
}

.corner-decor.top-left::after {
    top: 0;
    left: 0;
    width: 2px;
    height: 60px;
}

.corner-decor.top-right {
    top: 20px;
    right: 20px;
}

.corner-decor.top-right::before {
    top: 0;
    right: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(270deg, rgba(0, 240, 255, 0.6), transparent);
}

.corner-decor.top-right::after {
    top: 0;
    right: 0;
    width: 2px;
    height: 60px;
}

.corner-decor.bottom-left {
    bottom: 20px;
    left: 20px;
}

.corner-decor.bottom-left::before {
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
}

.corner-decor.bottom-left::after {
    bottom: 0;
    left: 0;
    width: 2px;
    height: 60px;
}

.corner-decor.bottom-right {
    bottom: 20px;
    right: 20px;
}

.corner-decor.bottom-right::before {
    bottom: 0;
    right: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(270deg, rgba(0, 240, 255, 0.6), transparent);
}

.corner-decor.bottom-right::after {
    bottom: 0;
    right: 0;
    width: 2px;
    height: 60px;
}

/* === БОКОВЫЕ ДЕКОРАТИВНЫЕ ЛИНИИ === */
.side-decor {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 5;
    pointer-events: none;
}

.side-decor.left {
    left: 40px;
}

.side-decor.right {
    right: 40px;
}

.line-segment {
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, rgba(255, 0, 255, 0.5), transparent);
    animation: linePulse 3s ease-in-out infinite;
}

.line-segment:nth-child(2) {
    animation-delay: 0.5s;
    height: 60px;
}

.line-segment:nth-child(3) {
    animation-delay: 1s;
    height: 30px;
}

@keyframes linePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* === ГЕКСАГОНАЛЬНЫЙ ДЕКОР === */
.hex-decor {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 5;
    pointer-events: none;
}

.hex-decor.top {
    top: 30px;
}

.hex-decor.bottom {
    bottom: 30px;
}

.hex-line {
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 159, 0.4), transparent);
}

.hex-dot {
    width: 6px;
    height: 6px;
    background: #00ff9f;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff9f;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 10px #00ff9f; transform: scale(1); }
    50% { box-shadow: 0 0 20px #00ff9f; transform: scale(1.3); }
}

/* === СЛУЧАЙНЫЕ HEX-СИМВОЛЫ === */
.random-chars {
    position: fixed;
    bottom: 60px;
    left: 60px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 5;
    pointer-events: none;
}

.random-chars span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: rgba(0, 240, 255, 0.3);
    letter-spacing: 0.1em;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
}

/* === КОНТЕЙНЕР ЛОГИНА === */
.login-container {
    position: relative;
    z-index: 3;
    width: min(440px, 90vw);
    background: rgba(15, 15, 30, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 0 40px rgba(0, 240, 255, 0.08),
        0 0 80px rgba(0, 240, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: containerAppear 0.6s ease-out;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00f0ff, transparent);
    border-radius: 50%;
}

@keyframes containerAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === ШАПКА === */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.3), transparent);
    margin: 0.75rem 0;
}

.header-hex {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.header-hex .hex-item {
    font-size: 1.2rem;
    color: rgba(0, 255, 159, 0.4);
    text-shadow: 0 0 10px rgba(0, 255, 159, 0.2);
    animation: hexSpin 4s ease-in-out infinite;
}

.header-hex .hex-item:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes hexSpin {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.4; }
    50% { transform: rotate(180deg) scale(1.2); opacity: 1; }
}

.nas-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.server-rack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 8px;
}

.slot {
    width: 60px;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    position: relative;
    transition: all 0.3s ease;
}

.slot.active {
    background: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
    animation: diskBlink 2s ease-in-out infinite;
}

@keyframes diskBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* === ЗАГОЛОВОК С ГЛИТЧЕМ === */
h1 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.75rem;
    font-weight: 400;
    color: #00f0ff;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
    letter-spacing: 0.15em;
    margin: 0.5rem 0;
    position: relative;
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ff9f;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(20px, 9999px, 45px, 0); }
    20% { clip: rect(60px, 9999px, 85px, 0); }
    40% { clip: rect(30px, 9999px, 70px, 0); }
    60% { clip: rect(80px, 9999px, 95px, 0); }
    80% { clip: rect(10px, 9999px, 50px, 0); }
    100% { clip: rect(50px, 9999px, 90px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(70px, 9999px, 85px, 0); }
    20% { clip: rect(20px, 9999px, 35px, 0); }
    40% { clip: rect(90px, 9999px, 100px, 0); }
    60% { clip: rect(40px, 9999px, 60px, 0); }
    80% { clip: rect(15px, 9999px, 45px, 0); }
    100% { clip: rect(60px, 9999px, 75px, 0); }
}

/* === ФОРМА === */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.label-icon {
    color: #00f0ff;
    font-size: 0.7rem;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.input-group input {
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 6px;
    color: #e0e0e0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    text-align: center;
}

.input-group input::placeholder {
    color: #555;
}

.input-group input:focus {
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
}

/* === ОПЦИИ ФОРМЫ === */
.form-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #888;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 3px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input:checked + .checkmark {
    background: rgba(0, 240, 255, 0.2);
    border-color: #00f0ff;
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00f0ff;
    font-size: 12px;
}

.separator {
    color: rgba(0, 240, 255, 0.2);
}

.forgot-link {
    color: rgba(255, 0, 255, 0.6);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.forgot-link:hover {
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

/* === КНОПКА === */
.login-btn {
    position: relative;
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(0, 240, 255, 0.08));
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 6px;
    color: #00f0ff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(0, 240, 255, 0.15));
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.3), 0 0 50px rgba(0, 240, 255, 0.15);
    transform: translateY(-2px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn.loading span {
    opacity: 0.5;
}

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

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

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.1), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.login-btn:hover .btn-glow {
    opacity: 1;
}

.btn-scan {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.2), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.login-btn:hover .btn-scan {
    left: 100%;
}

/* === СООБЩЕНИЕ ОБ ОШИБКЕ === */
.error-message {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 0, 80, 0.08);
    border: 1px solid rgba(255, 0, 80, 0.3);
    border-radius: 6px;
    animation: errorAppear 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97), glitchBorder 0.3s steps(2) 3;
    position: relative;
    overflow: hidden;
}

@keyframes errorAppear {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes glitchBorder {
    0% { border-color: rgba(255, 0, 80, 0.8); box-shadow: 0 0 15px rgba(255, 0, 80, 0.3); }
    25% { border-color: rgba(0, 240, 255, 0.6); box-shadow: 0 0 15px rgba(0, 240, 255, 0.3); }
    50% { border-color: rgba(255, 0, 80, 0.4); box-shadow: 0 0 5px rgba(255, 0, 80, 0.2); }
    75% { border-color: rgba(255, 0, 255, 0.5); box-shadow: 0 0 10px rgba(255, 0, 255, 0.2); }
    100% { border-color: rgba(255, 0, 80, 0.3); box-shadow: none; }
}

.error-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 80, 0.1), transparent);
    animation: scanLine 1.5s linear infinite;
}

@keyframes scanLine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.error-icon {
    color: #ff0050;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 0, 80, 0.5);
    flex-shrink: 0;
    animation: iconFlicker 2s infinite;
}

@keyframes iconFlicker {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(255, 0, 80, 0.5); }
    5% { opacity: 0.3; }
    10% { opacity: 1; }
    15% { opacity: 0.2; }
    20% { opacity: 1; text-shadow: 0 0 20px rgba(255, 0, 80, 0.8); }
    25% { opacity: 1; }
}

.error-text {
    font-size: 0.85rem;
    color: #ff0050;
    line-height: 1.4;
    position: relative;
    animation: textGlitch 0.1s steps(1) 5;
}

@keyframes textGlitch {
    0% { transform: translate(-2px, 0); color: #ff00ff; }
    20% { transform: translate(2px, 0); color: #ff0050; }
    40% { transform: translate(-1px, 0); color: #00f0ff; }
    60% { transform: translate(1px, 0); color: #ff0050; }
    80% { transform: translate(-1px, 0); }
    100% { transform: translate(0, 0); color: #ff0050; }
}

/* === ФУТЕР === */
.login-footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 240, 255, 0.1);
}

.footer-line {
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 255, 0.3), transparent);
    margin: 0 auto 1rem;
}

.warning-text {
    font-size: 0.75rem;
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.sys-info {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: #555;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

.tech-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tech-info span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: rgba(0, 255, 159, 0.4);
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(0, 255, 159, 0.15);
    border-radius: 3px;
    background: rgba(0, 255, 159, 0.03);
}

.tech-info span:hover {
    color: #00ff9f;
    border-color: rgba(0, 255, 159, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 159, 0.1);
}
