:root {
    --primary-color: rgba(255, 255, 255, 0.95);
    --accent-color: #7c7c7c;
    --bg-color: #0a0a0a;
    --form-width: 300px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
    position: relative;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.background-effect {
    position: absolute;
    width: 200vw;
    height: 200vh;
    background: linear-gradient(45deg,
            rgba(128, 128, 128, 0.05) 25%,
            transparent 50%,
            rgba(128, 128, 128, 0.05) 75%);
    background-size: 150px 150px;
    animation: bg-scroll 80s linear infinite;
    transform: rotate(15deg);
    filter: blur(2px);
    opacity: 0.1;
    will-change: transform;
}

.brand-logo,
.brand-logo2,
.diamond-container,
.content {
    position: relative;
    z-index: 2;
}

.brand-logo {
    position: absolute;
    top: 15%;
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #fff 30%, #aaa 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
    animation: logo-float 6s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

.brand-logo2 {
    position: absolute;
    top: 23%;
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: 1rem;
    background: linear-gradient(135deg, #fff 30%, #aaa 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    letter-spacing: 8px;
    animation: logo-float 6s ease-in-out infinite;
    pointer-events: none;
}

.diamond {
    position: relative;
    width: 480px;
    height: 480px;
}

.diamond::before,
.diamond::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid var(--primary-color);
    animation: rotate 25s linear infinite;
    box-sizing: border-box;
}

.diamond::after {
    border-width: 2px;
    width: 90%;
    height: 90%;
    margin: 5%;
    animation-direction: reverse;
}

.diamond-container {
    position: relative;
    transform: rotate(45deg);
    animation: diamond-float 8s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    will-change: transform, opacity;
    pointer-events: none;
}

.diamond-scale-wrapper {
    display: block;
    width: 100%;
    height: 100%;
    transform: scale(1);
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.diamond-container.scale-stage1 .diamond-scale-wrapper {
    transform: scale(1.2);
}

.diamond-container.scale-stage2 .diamond-scale-wrapper {
    transform: scale(1.5);
}

.content {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: diamond-btn 8s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.8rem;
    z-index: 3;
    pointer-events: none;
}

.auth-btn {
    width: var(--form-width);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px) saturate(180%);
    background-image:
        linear-gradient(to right bottom,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(0, 0, 0, 0.05) 100%),
        url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.2"/></svg>');
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease-out;
    font-size: 1rem;
    position: relative;
    z-index: 4;
    clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
    pointer-events: auto;
}

.auth-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    transition:
        transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
        box-shadow 0.3s ease;
    background:
        linear-gradient(45deg,
            rgba(255, 255, 255, 0) 50%,
            rgba(255, 255, 255, 0.1) 100%);
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.2),
            rgba(255, 255, 255, 0.05),
            rgba(255, 255, 255, 0.2));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.auth-btn:hover::after {
    opacity: 1;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#submitLogin {
    clip-path: none;
    margin-top: 1.5rem;
}

.auth-btn:active {
    transform: scale(0.95);
}

.auth-btn.hide {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.visually-hidden {
    color: #ffffffd0;
}

.login-form {
    visibility: hidden;
    opacity: 0;
    flex-direction: column;
    gap: 1.5rem;
    width: var(--form-width);
    transform: translateY(20px);
    transition: all 0.3s 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    pointer-events: none;
}

.login-form.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.login-form.active * {
    pointer-events: auto;
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--primary-color);
    font-size: 1rem;
    transition: all 0.2s ease;
    margin: 8px 0;
    pointer-events: auto;
}

.form-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.error-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 50, 50, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    animation: fadeInOut 2s forwards;
    pointer-events: none;
}

.error-shake {
    animation: error-shake 0.4s cubic-bezier(.36, .07, .19, .97);
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes diamond-float {

    0%,
    100% {
        transform: rotate(45deg) translateY(0);
    }

    30% {
        transform: rotate(45deg) translateY(-15px);
    }

    60% {
        transform: rotate(45deg) translateY(10px);
    }
}

@keyframes diamond-btn {

    0%,
    100% {
        transform: rotate(0deg) translateY(0);
    }

    30% {
        transform: rotate(0deg) translateY(-15px);
    }

    60% {
        transform: rotate(0deg) translateY(10px);
    }
}

@keyframes logo-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes first-scale {
    0% {
        transform: rotate(45deg) scale(1);
    }

    100% {
        transform: rotate(45deg) scale(1.2);
    }
}

@keyframes second-scale {
    0% {
        transform: rotate(45deg) scale(1.2);
    }

    100% {
        transform: rotate(45deg) scale(1.5);
    }
}

@keyframes bg-scroll {
    0% {
        transform: rotate(15deg) translateX(-50%);
    }

    100% {
        transform: rotate(15deg) translateX(0%);
    }
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    20%,
    80% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes diamond-pulse {
    0% {
        transform: rotate(45deg) scale(1);
    }

    30% {
        transform: rotate(45deg) scale(0.95);
    }

    70% {
        transform: rotate(45deg) scale(1.15);
    }

    100% {
        transform: rotate(45deg) scale(1);
    }
}

@keyframes login-success {
    0% {
        filter: hue-rotate(0deg);
    }

    50% {
        filter: hue-rotate(120deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

@keyframes error-shake {

    10%,
    90% {
        transform: translateX(-1px);
    }

    20%,
    80% {
        transform: translateX(2px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }

    40%,
    60% {
        transform: translateX(4px);
    }
}

@media (max-width: 768px) {
    .diamond {
        width: 320px;
        height: 320px;
    }

    .brand-logo {
        font-size: 2rem;
        top: 15%;
    }

    .auth-btn {
        width: var(--form-width);
        padding: 0.8rem;
        transform: scale(0.9);
    }

    #submitLogin {
        margin-top: 1rem;
    }
}