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

* {
    box-sizing: border-box;
}

/* --- CLEAN ACCENT SCROLLBAR --- */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: #4b7f00;
    border-radius: 10px;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #4b7f00 rgba(255, 255, 255, 0.02);
}

body {
    background: #121212;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    margin: 0;
    color: #e0e0e0;
}

h1 {
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

p {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0.5px;
    margin: 20px 0 30px;
}

span {
    font-size: 12px;
    color: #a0a0a0;
}

a {
    color: #e0e0e0;
    font-size: 14px;
    text-decoration: none;
    margin: 15px 0;
    transition: color 0.3s ease;
}

a:hover {
    color: #00bcd4;
}

button {
    border-radius: 20px;
    border: 1px solid #00bcd4;
    background-color: #00bcd4;
    color: #121212;
    font-size: 12px;
    font-weight: 600;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in, background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

button:hover {
    background-color: transparent;
    color: #00bcd4;
}

button:active {
    transform: scale(0.95);
}

button:focus {
    outline: none;
}

button.ghost {
    background-color: transparent;
    border-color: #ffffff;
    color: #ffffff;
}

button.ghost:hover {
    background-color: #ffffff;
    color: #121212;
}

form {
    background-color: #1e1e1e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 10px 50px;
    height: 100%;
    text-align: center;
    border-radius: 10px;
}

input,
select {
    background-color: #333333;
    color: #ffffff;
    border: 1px solid #444444;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 8px 0;
    width: 100%;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
select:focus {
    border-color: #00bcd4;
    box-shadow: 0 0 5px #00bcd4;
    outline: none;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7em top 50%;
    background-size: 0.65em auto;
    cursor: pointer;
}

.container {
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25),
        0 10px 10px rgba(0, 0, 0, 0.22);
    position: relative;
    overflow: hidden;
    width: 768px;
    max-width: 100%;
    min-height: 700px;
}

.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
}

.sign-in-container {
    left: 0;
    width: 50%;
    z-index: 2;
}

.container.right-panel-active .sign-in-container {
    transform: translateX(100%);
}

.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

.container.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show 0.6s;
}

@keyframes show {

    0%,
    49.99% {
        opacity: 0;
        z-index: 1;
    }

    50%,
    100% {
        opacity: 1;
        z-index: 5;
    }
}

.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.container.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: #383838;
    background: -webkit-linear-gradient(to right, #383838, #1e1e1e);
    background: linear-gradient(to right, #383838, #1e1e1e);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    color: #ffffff;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.container.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.overlay-left {
    transform: translateX(-20%);
}

.container.right-panel-active .overlay-left {
    transform: translateX(0);
}

.overlay-right {
    right: 0;
    transform: translateX(0);
}

.container.right-panel-active .overlay-right {
    transform: translateX(20%);
}

.social-container {
    margin: 20px 0;
}

.social-container a {
    border: 1px solid #444444;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    height: 40px;
    width: 40px;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.social-container a:hover {
    border-color: #00bcd4;
    transform: scale(1.1);
}

.social-container i {
    color: #e0e0e0;
    transition: color 0.3s ease;
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .container {
        width: 95%;
        min-height: auto;
        height: auto;
        display: flex;
        flex-direction: column;
        overflow: visible; /* Allows content to flow */
    }

    /* Reset absolute positioning for mobile stack */
    .form-container {
        position: relative;
        width: 100% !important;
        height: auto;
        top: auto;
        left: auto;
        transform: none !important;
        transition: none;
    }

    .sign-in-container, 
    .sign-up-container {
        padding: 40px 20px;
    }

    /* Logic: Hide the inactive form on mobile */
    .sign-up-container {
        display: none;
        opacity: 1;
        z-index: 5;
    }

    /* Display active form when panel is toggled */
    .container.right-panel-active .sign-up-container {
        display: block;
    }

    .container.right-panel-active .sign-in-container {
        display: none;
    }

    /* Transform the Overlay into a simple toggle bar */
    .overlay-container {
        position: relative;
        left: 0;
        width: 100%;
        height: 180px; /* Smaller height for mobile */
        transform: none !important;
        order: -1; /* Puts the toggle info at the top */
    }

    .overlay {
        width: 100%;
        left: 0;
        transform: none !important;
    }

    .overlay-panel {
        width: 100%;
        padding: 20px;
        transform: none !important;
    }

    /* Hide the inactive overlay panel */
    .overlay-left, .overlay-right {
        display: none;
    }

    /* Show "Sign Up" info when on the Sign In page */
    .overlay-right {
        display: flex;
    }

    /* Show "Sign In" info when on the Sign Up page */
    .container.right-panel-active .overlay-left {
        display: flex;
    }

    .container.right-panel-active .overlay-right {
        display: none;
    }

    /* Form spacing adjustments */
    form {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    p {
        margin: 10px 0 20px;
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .container {
        box-shadow: none; /* Cleaner look on small screens */
    }

    button {
        padding: 12px 30px;
        width: 100%; /* Full width buttons are easier to tap */
    }
}