:root {
    --portal-primary: #002147;
    --portal-primary-light: #0a3a6b;
    --portal-primary-dark: #001530;
    --portal-accent: #fdc800;
    --portal-accent-soft: #ffd740;
    --portal-cyan: #6ecff6;
    --portal-white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 18%, rgba(253, 200, 0, 0.22) 0%, rgba(253, 200, 0, 0) 36%),
        radial-gradient(circle at 82% 12%, rgba(110, 207, 246, 0.2) 0%, rgba(110, 207, 246, 0) 40%),
        radial-gradient(circle at 20% 85%, rgba(20, 74, 128, 0.25) 0%, rgba(20, 74, 128, 0) 42%),
        linear-gradient(130deg, var(--portal-primary-dark) 0%, var(--portal-primary) 45%, var(--portal-primary-light) 100%);
    animation: wallpaperShift 16s ease-in-out infinite alternate;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    inset: -30%;
    background:
        conic-gradient(from 0deg, rgba(253, 200, 0, 0.08), rgba(110, 207, 246, 0.08), rgba(255, 255, 255, 0.02), rgba(253, 200, 0, 0.08));
    filter: blur(42px);
    transform-origin: center;
    animation: wallpaperOrbit 30s linear infinite;
}

body::after {
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.14) 0.8px, transparent 0.8px),
        linear-gradient(120deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
    background-size: 4px 4px, 100% 100%;
    opacity: 0.35;
    animation: wallpaperGrain 10s steps(12) infinite;
}

.login-container {
    position: relative;
    width: 460px;
    height: 460px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.login-container::before,
.login-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.login-container::before {
    width: 540px;
    height: 540px;
    background: radial-gradient(circle, rgba(253, 200, 0, 0.24) 0%, rgba(253, 200, 0, 0) 62%);
    filter: blur(24px);
    animation: auroraFloat 14s ease-in-out infinite;
}

.login-container::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(110, 207, 246, 0.24) 0%, rgba(110, 207, 246, 0) 62%);
    filter: blur(22px);
    animation: auroraFloat 17s ease-in-out infinite reverse;
}

.circles-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotate 20s linear infinite;
    opacity: 0.95;
}

.circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.08), 0 0 25px rgba(0, 0, 0, 0.12);
}

.circle:nth-child(1) {
    border-color: rgba(253, 200, 0, 0.9);
    animation: pulse1 3s ease-in-out infinite;
}

.circle:nth-child(2) {
    border-color: rgba(110, 207, 246, 0.92);
    animation: pulse2 3s ease-in-out infinite 0.5s;
}

.circle:nth-child(3) {
    border-color: rgba(255, 255, 255, 0.85);
    animation: pulse3 3s ease-in-out infinite 1s;
}

.circle:nth-child(4) {
    border-color: rgba(18, 89, 152, 0.88);
    animation: pulse4 3s ease-in-out infinite 1.5s;
}

.login-box {
    position: relative;
    z-index: 10;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.25);
    padding: 40px;
    border-radius: 24px;
    width: 340px;
    text-align: center;
}

h2 {
    color: var(--portal-accent);
    margin-bottom: 30px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-shadow: 0 2px 16px rgba(0, 33, 71, 0.35);
}

.input-group {
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid rgba(0, 33, 71, 0.35);
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--portal-primary-dark);
}

input::placeholder {
    color: #52657d;
}

input:focus {
    border-color: var(--portal-accent);
    box-shadow: 0 0 0 4px rgba(253, 200, 0, 0.2);
}

.sign-in-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, var(--portal-primary), var(--portal-primary-light), var(--portal-accent));
    border: none;
    border-radius: 25px;
    color: var(--portal-white);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    background-size: 180% 180%;
    animation: buttonShine 5s ease-in-out infinite;
}

.sign-in-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 21, 48, 0.35);
}

.sign-in-btn:active {
    transform: translateY(0);
}

.links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 13px;
}

.links a {
    color: var(--portal-primary-dark);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.links a:hover {
    color: var(--portal-primary-light);
    text-decoration: underline;
}

@keyframes wallpaperShift {
    0% {
        background-position: 0% 0%, 100% 0%, 20% 100%, 0% 50%;
    }

    100% {
        background-position: 10% 5%, 85% 20%, 25% 85%, 100% 50%;
    }
}

@keyframes wallpaperOrbit {
    0% {
        transform: rotate(0deg) scale(1);
    }

    100% {
        transform: rotate(360deg) scale(1.05);
    }
}

@keyframes wallpaperGrain {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-6px, 3px);
    }

    50% {
        transform: translate(3px, -4px);
    }

    75% {
        transform: translate(4px, 2px);
    }

    100% {
        transform: translate(0, 0);
    }
}

@keyframes auroraFloat {
    0% {
        transform: translate(-10px, -12px) scale(1);
    }

    50% {
        transform: translate(14px, 10px) scale(1.06);
    }

    100% {
        transform: translate(-10px, -12px) scale(1);
    }
}

@keyframes buttonShine {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse1 {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.8;
        border-radius: 45% 55% 48% 52% / 42% 48% 52% 58%;
    }

    25% {
        transform: translate(-50%, -50%) scale(1.02);
        opacity: 0.9;
        border-radius: 58% 42% 55% 45% / 48% 62% 38% 52%;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
        border-radius: 52% 48% 62% 38% / 53% 45% 55% 47%;
    }

    75% {
        transform: translate(-50%, -50%) scale(0.98);
        opacity: 0.9;
        border-radius: 38% 62% 45% 55% / 58% 52% 48% 42%;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.8;
        border-radius: 45% 55% 48% 52% / 42% 48% 52% 58%;
    }
}

@keyframes pulse2 {
    0% {
        transform: translate(-50%, -50%) scale(0.92) rotate(10deg);
        opacity: 0.8;
        border-radius: 55% 45% 58% 42% / 52% 48% 52% 48%;
    }

    25% {
        transform: translate(-50%, -50%) scale(1) rotate(10deg);
        opacity: 0.9;
        border-radius: 42% 58% 45% 55% / 48% 60% 40% 52%;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.08) rotate(10deg);
        opacity: 1;
        border-radius: 48% 52% 40% 60% / 55% 45% 55% 45%;
    }

    75% {
        transform: translate(-50%, -50%) scale(1) rotate(10deg);
        opacity: 0.9;
        border-radius: 60% 40% 52% 48% / 42% 58% 42% 58%;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.92) rotate(10deg);
        opacity: 0.8;
        border-radius: 55% 45% 58% 42% / 52% 48% 52% 48%;
    }
}

@keyframes pulse3 {
    0% {
        transform: translate(-50%, -50%) scale(0.98) rotate(-10deg);
        opacity: 0.8;
        border-radius: 40% 60% 52% 48% / 45% 55% 45% 55%;
    }

    25% {
        transform: translate(-50%, -50%) scale(1.05) rotate(-10deg);
        opacity: 0.9;
        border-radius: 52% 48% 45% 55% / 58% 42% 58% 42%;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.02) rotate(-10deg);
        opacity: 1;
        border-radius: 60% 40% 58% 42% / 52% 48% 52% 48%;
    }

    75% {
        transform: translate(-50%, -50%) scale(0.95) rotate(-10deg);
        opacity: 0.9;
        border-radius: 45% 55% 42% 58% / 40% 60% 40% 60%;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.98) rotate(-10deg);
        opacity: 0.8;
        border-radius: 40% 60% 52% 48% / 45% 55% 45% 55%;
    }
}

@keyframes pulse4 {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(5deg);
        opacity: 0.8;
        border-radius: 48% 52% 55% 45% / 50% 50% 50% 50%;
    }

    25% {
        transform: translate(-50%, -50%) scale(1.08) rotate(5deg);
        opacity: 0.9;
        border-radius: 62% 38% 48% 52% / 45% 55% 45% 55%;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
        opacity: 1;
        border-radius: 50% 50% 38% 62% / 58% 42% 58% 42%;
    }

    75% {
        transform: translate(-50%, -50%) scale(1.05) rotate(5deg);
        opacity: 0.9;
        border-radius: 38% 62% 52% 48% / 52% 48% 52% 48%;
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(5deg);
        opacity: 0.8;
        border-radius: 48% 52% 55% 45% / 50% 50% 50% 50%;
    }
}

@media (max-width: 520px) {
    .login-container {
        width: 340px;
        height: 340px;
    }

    .login-container::before {
        width: 390px;
        height: 390px;
    }

    .login-container::after {
        width: 360px;
        height: 360px;
    }

    .login-box {
        width: 290px;
        padding: 24px;
    }
}
