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

:root {
    --bg-deep: #04133b;
    --bg-mid: #0a3fb7;
    --bg-bright: #1f67ff;
    --bg-soft: rgba(88, 146, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.94);
    --card-border: rgba(255, 255, 255, 0.24);
    --text: #0d1b43;
    --muted: #58709d;
    --border: rgba(123, 150, 204, 0.24);
    --blue: #1355ed;
    --blue-dark: #0b2f97;
    --shadow: rgba(3, 16, 55, 0.35);
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    position: relative;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(68, 134, 255, 0.36), transparent 30%),
        radial-gradient(circle at bottom right, rgba(13, 53, 168, 0.45), transparent 36%),
        linear-gradient(145deg, #0a4de2 0%, #0735a8 42%, #04133b 100%);
}

.login-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 22% 18%, rgba(96, 162, 255, 0.18), transparent 24%),
        radial-gradient(circle at 82% 72%, rgba(32, 92, 245, 0.2), transparent 22%);
    mix-blend-mode: screen;
}

.background-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 88px 88px;
    opacity: 0.2;
    transform: perspective(1000px) rotateX(66deg) translateY(18%);
    transform-origin: top center;
}

.background-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(12px);
}

.orb-top {
    width: 420px;
    height: 420px;
    top: -180px;
    left: -110px;
    background: radial-gradient(circle, rgba(94, 156, 255, 0.45) 0%, rgba(94, 156, 255, 0) 70%);
    animation: driftOrb 16s ease-in-out infinite alternate;
}

.orb-bottom {
    width: 500px;
    height: 500px;
    right: -160px;
    bottom: -230px;
    background: radial-gradient(circle, rgba(11, 58, 180, 0.48) 0%, rgba(11, 58, 180, 0) 72%);
    animation: driftOrbAlt 18s ease-in-out infinite alternate;
}

.background-bar {
    position: absolute;
    left: -24vw;
    width: 92vw;
    border-radius: 999px;
    transform: rotate(-31deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(120, 175, 255, 0.18) 55%, rgba(12, 53, 174, 0.04) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    opacity: 0.82;
    animation: floatBar 16s ease-in-out infinite alternate;
}

.background-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 8%, rgba(66, 129, 255, 0.36) 48%, rgba(255, 255, 255, 0) 92%);
    opacity: 0.7;
}

.bar-1 {
    top: -8%;
    height: 94px;
    animation-duration: 18s;
}

.bar-2 {
    top: 6%;
    height: 58px;
    opacity: 0.36;
    animation-duration: 22s;
    animation-delay: -6s;
}

.bar-3 {
    top: 22%;
    height: 92px;
    left: -12vw;
    width: 102vw;
    animation-duration: 20s;
    animation-delay: -3s;
}

.bar-4 {
    top: 43%;
    height: 124px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0%, rgba(51, 120, 255, 0.4) 52%, rgba(255, 255, 255, 0.03) 100%);
    animation-duration: 19s;
    animation-delay: -9s;
}

.bar-5 {
    top: 61%;
    height: 68px;
    left: 20%;
    width: 58vw;
    opacity: 0.38;
    animation-duration: 14s;
    animation-delay: -4s;
}

.bar-6 {
    top: 72%;
    height: 108px;
    left: 38%;
    width: 76vw;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.01) 0%, rgba(76, 138, 255, 0.44) 56%, rgba(255, 255, 255, 0.02) 100%);
    animation-duration: 17s;
    animation-delay: -11s;
}

.bar-7 {
    top: 88%;
    height: 52px;
    opacity: 0.22;
    animation-duration: 24s;
    animation-delay: -8s;
}

.card-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    animation: cardIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(26px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.top-bar {
    height: 5px;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(90deg, #9fc4ff 0%, #4b8bff 32%, #0f4fe4 72%, #1638aa 100%);
    box-shadow: 0 10px 28px rgba(84, 146, 255, 0.25);
}

.card {
    padding: 42px 42px 36px;
    border-radius: 0 0 28px 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(242, 247, 255, 0.93) 100%);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    box-shadow:
        0 22px 60px rgba(3, 16, 55, 0.3),
        0 10px 24px rgba(6, 30, 95, 0.18);
}

.card-header {
    text-align: center;
    margin-bottom: 34px;
    animation: fadeUp 0.55s ease both 0.08s;
}

.avatar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(219, 232, 255, 0.95), rgba(255, 255, 255, 0.95));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 12px 24px rgba(65, 117, 225, 0.16);
}

.avatar-wrap::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 28px;
    border: 1px solid rgba(112, 157, 240, 0.28);
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 8px;
}

.card-subtitle {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.form-group {
    margin-bottom: 18px;
}

.form-group:nth-child(1) {
    animation: fadeUp 0.55s ease both 0.18s;
}

.form-group:nth-child(2) {
    animation: fadeUp 0.55s ease both 0.26s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

label svg {
    color: var(--blue);
}

.input-wrap {
    position: relative;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease, background-color 0.24s ease;
}

input::placeholder {
    color: #90a0bf;
}

input:focus {
    border-color: rgba(19, 85, 237, 0.52);
    background: #ffffff;
    box-shadow: 0 0 0 5px rgba(19, 85, 237, 0.12);
    transform: translateY(-1px);
}

.input-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #8ea0c4;
    transition: color 0.24s ease;
    pointer-events: none;
}

.input-wrap:focus-within .input-prefix {
    color: var(--blue);
}

.eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #8ea0c4;
    cursor: pointer;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.24s ease, background-color 0.24s ease;
}

.eye-btn:hover {
    color: var(--blue);
    background: rgba(19, 85, 237, 0.08);
}

.btn-submit {
    width: 100%;
    padding: 15px;
    margin-top: 6px;
    border: none;
    border-radius: 16px;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-bright) 0%, var(--blue) 52%, var(--blue-dark) 100%);
    box-shadow: 0 16px 30px rgba(12, 66, 196, 0.28);
    transition: transform 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease;
    animation: fadeUp 0.55s ease both 0.34s;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0) 78%);
    transform: translateX(-140%);
    transition: transform 0.7s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 38px rgba(12, 66, 196, 0.34);
    filter: saturate(1.05);
}

.btn-submit:hover::before {
    transform: translateX(140%);
}

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

.btn-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@keyframes floatBar {
    from {
        transform: translate3d(-3vw, -1.5vh, 0) rotate(-31deg);
    }

    to {
        transform: translate3d(8vw, 3vh, 0) rotate(-31deg);
    }
}

@keyframes driftOrb {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }

    to {
        transform: translate3d(48px, 24px, 0) scale(1.08);
    }
}

@keyframes driftOrbAlt {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }

    to {
        transform: translate3d(-42px, -22px, 0) scale(1.06);
    }
}

@media (max-width: 640px) {
    body {
        padding: 18px;
    }

    .card {
        padding: 32px 24px 26px;
        border-radius: 0 0 24px 24px;
    }

    .card-title {
        font-size: 27px;
    }

    .background-grid {
        background-size: 64px 64px;
        opacity: 0.16;
    }

    .background-bar {
        width: 150vw;
        left: -48vw;
    }

    .bar-5,
    .bar-6 {
        width: 108vw;
        left: 10vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
