@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&display=swap');

:root {
    --ips-blue: #1e5b93;
    --ips-blue-dark: #103a62;
    --ips-cyan: #00a7e1;
    --text: #12344f;
    --glass: rgba(255, 255, 255, 0.56);
    --glass-strong: rgba(255, 255, 255, 0.76);
    --glass-border: rgba(30, 91, 147, 0.18);
    --shadow: 0 28px 90px rgba(16, 58, 98, 0.22);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 50% 50%, rgba(0, 167, 225, 0.08), transparent 32%),
        #ffffff;
}

button,
input {
    font: inherit;
}

.intro-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    position: relative;
    isolation: isolate;
    padding: 24px;
}

.intro-shell::before,
.intro-shell::after {
    content: "";
    position: fixed;
    inset: auto;
    z-index: -1;
    width: 42vmin;
    height: 42vmin;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0;
    filter: blur(32px);
    transition: opacity 900ms ease;
}

.intro-shell::before {
    left: 11vw;
    top: 14vh;
    background: rgba(0, 167, 225, 0.13);
}

.intro-shell::after {
    right: 10vw;
    bottom: 12vh;
    background: rgba(30, 91, 147, 0.12);
}

.intro-complete .intro-shell::before,
.intro-complete .intro-shell::after {
    opacity: 1;
}

.logo-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: min(58vw, 520px);
    aspect-ratio: 2.6 / 1;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: default;
    animation: logoReveal 4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro-complete .logo-stage {
    cursor: pointer;
    animation: logoIdle 4s ease-in-out infinite;
}

.login-visible .logo-stage {
    opacity: 0;
    transform: translateY(-22px) scale(0.9);
    pointer-events: none;
    transition: opacity 360ms ease, transform 360ms ease;
    animation: none;
}

.logo-aura {
    position: absolute;
    inset: -44%;
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(0, 167, 225, 0.28), transparent 44%),
        conic-gradient(from 120deg, transparent, rgba(30, 91, 147, 0.3), transparent, rgba(0, 167, 225, 0.24), transparent);
    opacity: 0;
    filter: blur(18px);
    transform: scale(0.18) rotate(-18deg);
    animation: auraReveal 4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro-complete .logo-aura {
    opacity: 0.9;
    transform: scale(1) rotate(0deg);
    animation: auraBreath 4s ease-in-out infinite;
}

.intro-logo {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    opacity: 0;
    filter: blur(28px) saturate(0.45);
    transform: scale(0.72);
    clip-path: circle(0% at 50% 50%);
    animation: imageReveal 4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro-complete .intro-logo {
    opacity: 1;
    filter: drop-shadow(0 22px 38px rgba(30, 91, 147, 0.18));
    transform: scale(1);
    clip-path: circle(140% at 50% 50%);
    animation: none;
}

.login-panel {
    position: absolute;
    width: min(92vw, 440px);
    border: 1px solid var(--glass-border);
    border-top-color: rgba(255, 255, 255, 0.86);
    border-radius: 24px;
    padding: 32px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px) scale(0.96);
    background: linear-gradient(145deg, var(--glass-strong), var(--glass));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow);
    transition: opacity 260ms ease, visibility 260ms ease, transform 260ms ease;
}

.login-visible .login-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.panel-glow {
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(0,167,225,0.18), transparent 42%, rgba(30,91,147,0.14));
}

.login-logo {
    display: block;
    width: min(260px, 72%);
    margin: 0 auto 20px;
}

h1 {
    margin: 0;
    color: var(--ips-blue-dark);
    font-size: 2rem;
    line-height: 1;
    text-align: center;
}

.login-subtitle {
    margin: 12px 0 22px;
    color: rgba(16, 58, 98, 0.72);
    line-height: 1.5;
    text-align: center;
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--ips-blue-dark);
    font-weight: 800;
}

input {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(30, 91, 147, 0.18);
    border-radius: 14px;
    padding: 0 14px;
    color: var(--ips-blue-dark);
    background: rgba(255, 255, 255, 0.74);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input:focus {
    border-color: var(--ips-cyan);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 167, 225, 0.14);
}

.login-panel button {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    border: 0;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--ips-blue), var(--ips-cyan));
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(30, 91, 147, 0.24);
}

.alert {
    margin: 0 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 14px;
    padding: 12px 14px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.84), rgba(249, 115, 22, 0.74));
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.18);
}

@keyframes logoReveal {
    0% {
        transform: scale(0.82);
    }
    72% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes imageReveal {
    0% {
        opacity: 0;
        filter: blur(34px) saturate(0.3);
        transform: scale(0.64);
        clip-path: circle(0% at 50% 50%);
    }
    38% {
        opacity: 0.46;
        filter: blur(16px) saturate(0.7);
        clip-path: circle(18% at 50% 50%);
    }
    78% {
        opacity: 1;
        filter: blur(1px) saturate(1.08);
        transform: scale(1.02);
        clip-path: circle(88% at 50% 50%);
    }
    100% {
        opacity: 1;
        filter: drop-shadow(0 22px 38px rgba(30, 91, 147, 0.18));
        transform: scale(1);
        clip-path: circle(140% at 50% 50%);
    }
}

@keyframes auraReveal {
    0% {
        opacity: 0;
        transform: scale(0.14) rotate(-22deg);
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 0.9;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes auraBreath {
    0%,
    100% {
        opacity: 0.62;
        transform: scale(0.94);
    }
    50% {
        opacity: 0.95;
        transform: scale(1.04);
    }
}

@keyframes logoIdle {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.01);
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo-stage,
    .logo-aura,
    .intro-logo {
        animation-duration: 1ms;
    }
}

@media (max-width: 620px) {
    .logo-stage {
        width: min(82vw, 420px);
    }

    .login-panel {
        padding: 24px;
    }
}
