@font-face {
    font-family: 'Open Sans';
    src: url("./OpenSans-VariableFont_wdth,wght.ttf") format("truetype-variations");
    font-weight: 125 950;
    font-stretch: 75% 125%;
    font-style: normal;
}

html {
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 50%, #dcd5e0 100%);
    background-size: 200% 200%;
    background-attachment: fixed;
    animation: gradientShift 12s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

body {
    margin: 0;
    min-height: 100%;
    font-family: "Open Sans", sans-serif;
    font-size: 1rem;
    color: var(--primary-colour);
    animation: fadeIn 0.6s ease-in;
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.navigation-bar {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    animation: slideDown 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    60% {
        transform: translateY(4px);
        opacity: 1;
    }

    80% {
        transform: translateY(-2px);
    }

    100% {
        transform: translateY(0);
    }
}

.navigation {
    display: grid;
    grid-template-columns: 1fr 2fr;
    max-width: 1176px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
}

.version {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background-color: #c0392b;
    padding: .4rem;
    color: #ffffff;
    font-weight: bold;
}

.failure {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    padding: 1.2rem;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 1.5em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
    animation: shakeError 0.5s ease-in-out;
}

@keyframes shakeError {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

.panel {
    min-width: 30%;
    max-width: 1084px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px auto 20px auto;
    flex: 1;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.panel form {
    max-width: 420px;
    width: 100%;
    margin: 20px auto 0 auto;
    padding: 30px 40px;
    background: rgba(255, 255, 255, 0.98);
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: cardEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}

.panel form:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.92);
    }

    55% {
        opacity: 1;
        transform: translateY(-6px) scale(1.02);
    }

    75% {
        transform: translateY(3px) scale(0.99);
    }

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

img.logo {
    max-height: 80px;
    transition: transform 0.3s ease;
    animation: logoBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

img.logo:hover {
    transform: scale(1.05);
}

@keyframes logoBounce {
    0% {
        opacity: 0;
        transform: translateY(-15px) scale(0.8);
    }

    60% {
        opacity: 1;
        transform: translateY(2px) scale(1.05);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

h1 {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 130%;
    text-align: center;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--primary-colour) 0%, #1e3a5f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleSlide 0.7s ease-out 0.35s both;
}

@keyframes titleSlide {
    from {
        opacity: 0;
        filter: blur(12px);
        transform: scale(0.85);
    }

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

input {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

input:hover {
    border-color: #c1cdd6;
    background: #ffffff;
}

input::placeholder {
    color: rgba(24, 49, 90, 0.70);
    font-weight: 400;
}

input:focus-visible {
    outline: none;
    border: 2px solid var(--primary-colour);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(24, 49, 90, 0.1);
    transform: translateY(-1px);
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #2c3e50;
    letter-spacing: 0.3px;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    box-sizing: border-box;
    padding: 0 2rem;
    margin-top: 8px;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--primary-colour) 0%, #1e3a5f 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    pointer-events: auto;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(24, 49, 90, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(24, 49, 90, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(24, 49, 90, 0.3);
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: buttonShimmer 15s ease-in-out 10s infinite;
}

@keyframes buttonShimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.not-you {
    text-align: center;
    font-size: 0.9rem;
    margin: 4px 0;
}

.not-you a {
    color: var(--primary-colour);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
}

.not-you a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-colour);
    transition: width 0.3s ease;
}

.not-you a:hover::after {
    width: 100%;
}

.not-you a:hover {
    color: #1e3a5f;
}

/*Footer*/

.toggle-checkbox {
    display: none;
}

.footer-collapsible {
    width: 100%;
    background: rgba(241, 241, 241, 0.9);
    backdrop-filter: blur(10px);
    color: var(--primary-colour);
    text-align: left;
    padding: 10px 0;
    margin: 0;
    animation: fadeIn 1s ease-in 0.8s both;
}

.footer-content {
    display: block;

    p {
        margin-left: 10px;
    }

    li {
        padding-right: 100px;
    }
}

.toggle-checkbox:checked+.footer-toggle+.footer-content {
    display: none;
}

.footer-toggle {
    cursor: pointer;
    color: #007bff;
    display: block;
    margin-left: 10px;
    padding: 5px 0;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════ */
/* Part 1: Outro Animation (triggered on form submit)         */
/* ═══════════════════════════════════════════════════════════ */

body.leaving .panel {
    animation: outroSlideLeft 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

body.leaving .navigation-bar {
    animation: outroFadeUp 0.35s ease-in 0.05s forwards;
}

body.leaving #bottom-template {
    animation: outroFade 0.3s ease-in 0.05s forwards;
}

@keyframes outroSlideLeft {
    to {
        opacity: 0;
        transform: translateX(-60px);
        filter: blur(4px);
    }
}

@keyframes outroFadeUp {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes outroFade {
    to {
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════ */
/* Part 2: Login Credentials - Slide Transition Animations    */
/* ═══════════════════════════════════════════════════════════ */

body.login-credentials {
    animation: none;
}

body.login-credentials .navigation-bar {
    animation: none;
}

body.login-credentials img.logo {
    animation: none;
}

body.login-credentials .panel {
    animation: slideFromRight 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.login-credentials h1 {
    animation: slideFromRightSubtle 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

body.login-credentials .panel form {
    animation: slideFromRight 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

body.login-credentials .panel form:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

body.login-credentials input {
    transition: all 0.2s ease;
}

body.login-credentials button {
    transition: all 0.2s ease;
}

body.login-credentials button::after {
    animation: none;
}

body.login-credentials button:hover {
    transform: translateY(-1px);
}

body.login-credentials .footer-collapsible {
    animation: fadeIn 0.4s ease-in 0.3s both;
}

@keyframes slideFromRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

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

@keyframes slideFromRightSubtle {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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