* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: #1a237e;
}

/* Оверлей для перехода */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.transition-overlay.active {
    opacity: 1;
    background: rgba(0, 0, 0, 0.95);
}

/* Промежуточный экран с изображением */
.transition-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.transition-image {
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: imageFade 2s ease-in-out forwards;
}

.transition-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@keyframes imageFade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Canvas for particles */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Background image with parallax */
.brick-wall {
    position: absolute;
    top: 0;
    left: 0;
    width: 120%;
    height: 120%;
    background-image: url('https://i.postimg.cc/9MTL6r23/9997.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: translate(-8.33%, -8.33%);
    transition: transform 0.1s ease;
    z-index: 0;
}

/* Gradient overlay to blend edges */
.brick-wall::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        rgba(26, 35, 126, 0) 50%,
        rgba(26, 35, 126, 0.3) 100%
    );
    z-index: 0;
}

/* Mist effect */
.mist {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.02) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.02) 100%
    );
    opacity: 0.3;
    animation: drift 30s linear infinite;
    z-index: 1;
}

@keyframes drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Dramatic spotlight effect with pulsing */
.spotlight {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 800px;
    background: 
        radial-gradient(
            ellipse 300px 400px at center top,
            rgba(255,255,224,0.4) 0%,
            rgba(255,255,224,0.25) 20%,
            rgba(255,255,255,0.15) 40%,
            rgba(255,255,255,0.08) 60%,
            rgba(255,255,255,0.03) 80%,
            transparent 100%
        );
    pointer-events: none;
    z-index: 1;
    animation: pulse-spotlight 6s ease-in-out infinite;
}

@keyframes pulse-spotlight {
    0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

/* Additional ambient lighting */
.ambient-light {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(
            circle at 50% 20%,
            rgba(255,255,255,0.1) 0%,
            transparent 50%
        );
    pointer-events: none;
    z-index: 1;
}

/* Login form container */
.login-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 45px 40px;
    width: 420px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    z-index: 2;
    animation: pulse 3s ease-in-out infinite;
}

.login-title {
    color: #ffffff;
    font-size: 36px;
    font-weight: 300;
    text-align: center;
    margin-bottom: 45px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.input-wrapper {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 18px 50px 18px 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    color: #000000;
    font-size: 16px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(255, 255, 255, 0.1);
}

.form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.15),
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Input icons */
.input-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Login button */
.login-btn {
    width: 100%;
    padding: 18px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 25px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.1);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Responsive design */
@media (max-width: 480px) {
    .login-container {
        width: 90%;
        padding: 35px 25px;
        margin: 20px;
    }
    
    .login-title {
        font-size: 30px;
        margin-bottom: 35px;
    }

    .spotlight {
        width: 400px;
        height: 600px;
    }
}

/* Loading animation for login container */
@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Register button */
.register-btn {
    width: 100%;
    padding: 18px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-top: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.register-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.1);
}

.register-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Modal styles (coherent with login form) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 45px 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    animation: pulse 3s ease-in-out infinite;
}

.modal-content h2 {
    color: #ffffff;
    font-size: 36px;
    font-weight: 300;
    text-align: center;
    margin-bottom: 45px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

/* Reuse form-group/input-wrapper from login for consistency */
.modal .form-group {
    margin-bottom: 25px;
}

.modal .complete-btn {
    width: 100%;
    padding: 18px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal .complete-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.1);
}
/* Close btn as left arrow */
.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #1a1a1a;
}

/* Tooltip icon and hover */
.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: #000;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    margin-left: 5px;
    cursor: help;
    position: relative;
}

.tooltip-icon::after {
    content: attr(data-title);
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tooltip-icon:hover::after {
    opacity: 1;
}

/* Form groups even spacing */
.modal .form-group {
    margin-bottom: 25px;
}

/* Error/valid borders */
.error {
    border-color: red !important;
}

.valid {
    border-color: green !important;
}

/* Success modal */
.success-content {
    text-align: center;
    animation: pulse 3s ease-in-out infinite;
}

.success-content h2 {
    color: #10b981;
}

.success-content p {
    color: #ffffff;
}

/* Confetti fall animation */
@keyframes fall {
    0% {
        top: -10px;
        opacity: 1;
    }
    100% {
        top: 100vh;
        opacity: 0;
    }
}