@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap");

:root {
    /* Core Colors matching new_homepage.css */
    --bg-dark: #030014;
    --bg-card: rgba(23, 25, 50, 0.6);
    --primary: #7000ff;
    --secondary: #00f3ff;
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --glass-border: rgba(255, 255, 255, 0.08);
    --gradient-btn: linear-gradient(90deg, #7000ff 0%, #00c6ff 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Outfit", sans-serif;
    text-decoration: none;
    list-style: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-dark);
    /* Optional: Radial Gradient background similar to homepage overlay */
    background-image: radial-gradient(circle at 50% 50%, rgba(3, 0, 20, 0.8) 0%, #030014 100%);
    color: var(--text-main);
    overflow: hidden;
}

/* 
   Spline-like background effect (optional/simplified) 
   We could reuse the spline iframe but CSS gradient is lighter 
*/
body::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(112, 0, 255, 0.3) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
}

body::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.2) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
}


.container {
    position: relative;
    width: 850px;
    height: 750px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    margin: 20px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.container h1 {
    font-family: 'Clash Display', sans-serif;
    /* If imported in HTML, else fallback */
    font-size: 36px;
    margin: -10px 0;
    font-weight: 600;
    color: var(--text-main);
}

.container p {
    font-size: 14.5px;
    margin: 15px 0;
    color: var(--text-muted);
}

.logo-container {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
}

.fpt-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

form {
    width: 100%;
}

.form-box {
    position: absolute;
    right: 0;
    width: 50%;
    height: 100%;
    background: transparent;
    /* Transparent so container glass shows */
    display: flex;
    align-items: center;
    color: var(--text-main);
    text-align: center;
    padding: 40px;
    z-index: 1;
    transition: 0.6s ease-in-out 1.2s, visibility 0s 1s;
}

.container.active .form-box {
    right: 50%;
}

/* Base login form is visible by default */
.form-box.login {
    visibility: visible;
    transition: 0.6s ease-in-out 1.2s, visibility 0s 1s;
}

/* Hide login form when active (register) */
.container.active .form-box.login {
    visibility: hidden;
    transition-delay: 0s;
    /* Hide immediately when sliding starts/ends? Adjust timing if needed */
}

/* Base register form is hidden by default */
.form-box.register {
    visibility: hidden;
}

/* Show register form when active */
.container.active .form-box.register {
    visibility: visible;
}

.input-box {
    position: relative;
    margin: 10px 0;
}

.input-box input {
    width: 100%;
    padding: 13px 50px 13px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    outline: none;
    font-size: 16px;
    color: var(--text-main);
    font-weight: 500;
    transition: 0.3s;
}

.input-box input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.input-box input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(112, 0, 255, 0.2);
}

.input-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--text-muted);
}

.forgot-link {
    margin: -15px 0 15px;
}

.forgot-link a {
    font-size: 14.5px;
    color: var(--text-muted);
    transition: 0.3s;
}

.forgot-link a:hover {
    color: var(--secondary);
}

.btn {
    width: 100%;
    height: 48px;
    background: var(--gradient-btn);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(112, 0, 255, 0.4);
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #fff;
    font-weight: 600;
    transition: 0.3s;
}

.btn:hover {
    box-shadow: 0 0 30px rgba(112, 0, 255, 0.6);
    transform: translateY(-2px);
}

.social-icons {
    display: flex;
    justify-content: center;
}

.social-icons a {
    display: inline-flex;
    padding: 10px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-size: 24px;
    color: var(--text-main);
    margin: 0 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.social-icons a:hover {
    background: var(--text-main);
    color: var(--bg-dark);
    transform: translateY(-3px);
}

.toggle-box {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Ensure rounded corners for the slider */
}

/* The colored slider panel */
.toggle-box::before {
    content: "";
    position: absolute;
    left: -250%;
    width: 300%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 150px;
    z-index: 2;
    transition: 1.8s ease-in-out;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.container.active .toggle-box::before {
    left: 50%;
}

.toggle-panel {
    position: absolute;
    width: 50%;
    height: 100%;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: 0.6s ease-in-out;
}

.toggle-panel.toggle-left {
    left: 0;
    transition-delay: 1.2s;
}

.container.active .toggle-panel.toggle-left {
    left: -50%;
    transition-delay: 0.6s;
}

.toggle-panel.toggle-right {
    right: -50%;
    transition-delay: 0.6s;
}

.container.active .toggle-panel.toggle-right {
    right: 0;
    transition-delay: 1.2s;
}

.toggle-panel p {
    margin-bottom: 20px;
}

.toggle-panel .btn {
    width: 160px;
    height: 46px;
    background: transparent;
    border: 2px solid #fff;
    box-shadow: none;
}

.toggle-panel .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

@media screen and (max-width: 650px) {
    .container {
        height: calc(100vh - 40px);
    }

    .form-box {
        bottom: 0;
        width: 100%;
        height: 70%;
    }

    .container.active .form-box {
        right: 0;
        bottom: 30%;
    }

    .toggle-box::before {
        left: 0;
        top: -270%;
        width: 100%;
        height: 300%;
        border-radius: 20vw;
    }

    .container.active .toggle-box::before {
        left: 0;
        top: 70%;
    }

    .container.active .toggle-panel.toggle-left {
        left: 0;
        top: -30%;
    }

    .toggle-panel {
        width: 100%;
        height: 30%;
    }

    .toggle-panel.toggle-left {
        top: 0;
    }

    .toggle-panel.toggle-right {
        right: 0;
        bottom: -30%;
    }

    .container.active .toggle-panel.toggle-right {
        bottom: 0;
    }
}

@media screen and (max-width: 400px) {
    .form-box {
        padding: 20px;
    }

    .toggle-panel h1 {
        font-size: 30px;
    }
}