@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-green: #4CAF50;
    --light-blue: #3272e7;
    --dark-blue: #1d48d8;
    --light-gray: #f5f5f5;
    --text-color: #333;
    --white: #fff;
    --yellow: #fdd835;
    --red: #ef5350;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--light-gray);
    overflow-x: hidden; /* Mencegah scrollbar horizontal yang tidak diinginkan */
}

.container {
    background-color: var(--white);
    border-radius: 20px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
    position: relative;
    width: 900px;
    max-width: 100%; /* Penting untuk responsif */
    min-height: 500px;
    overflow: hidden;
}

/* Base styles for form containers (mobile-first: default for small screens) */
.form-container {
    padding: 40px 20px; /* Sesuaikan padding untuk mobile */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%; /* Di mobile, setiap form mengambil lebar penuh */
    min-height: 50vh; /* Setengah tinggi viewport untuk setiap form di mobile */
    position: relative; /* Default untuk mobile */
    top: auto;
    left: auto;
    background-color: var(--white);
    z-index: auto;
    opacity: 1; /* Default terlihat di mobile */
    transition: none; /* Nonaktifkan transisi di mobile */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1); /* Tambahkan bayangan ringan antar bagian */
    margin-bottom: 20px; /* Jarak antar panel di mobile */
}

/* Order of panels for mobile */
.sign-in-container {
    order: 1;
}
.sign-up-container {
    order: 2;
}

/* Hide shapes in mobile */
.form-container .top-shape,
.form-container .bottom-shape {
    display: none;
}

/* Overlay container is hidden by default in mobile */
.overlay-container {
    display: none;
}

/* Mobile Toggle Button */
.mobile-toggle-btn {
    display: block; /* Tampilkan tombol di mobile */
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-green);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: none; /* Pastikan tidak ada border bawaan button */
    outline: none;
    transition: background-color 0.3s ease;
}

.mobile-toggle-btn:hover {
    background-color: var(--dark-blue);
}


/* --- Tablet / Medium Devices (>= 768px) --- */
@media (min-width: 768px) {
    .container {
        flex-direction: row; /* Kembali ke layout baris */
        width: 700px; /* Atur lebar container untuk tablet */
        min-height: 450px; /* Atur tinggi min untuk tablet */
    }

    /* Hide mobile toggle button */
    .mobile-toggle-btn {
        display: none;
    }

    /* Reset form containers for tablet/desktop */
    .form-container {
        position: absolute;
        top: 0;
        height: 100%;
        transition: all 0.6s ease-in-out; /* Aktifkan transisi */
        width: 50%;
        padding: 0 50px;
        box-shadow: none; /* Hapus bayangan antar panel */
        margin-bottom: 0; /* Hapus margin antar panel */
    }

    .sign-up-container {
        left: 0;
        opacity: 0;
        z-index: 1;
        order: auto; /* Reset order */
    }

    .sign-in-container {
        left: 0;
        z-index: 2;
        order: auto; /* Reset order */
    }

    /* Re-enable shapes for larger screens */
    .form-container .top-shape,
    .form-container .bottom-shape {
        position: absolute;
        width: 120px;
        height: 120px;
        border-radius: 50%;
        z-index: -1; /* Di bawah konten form */
        display: block; /* Pastikan selalu ditampilkan */;
    }

    .form-container .top-shape {
    background-color: var(--red);
    top: -60px;
    right: -60px;
    }

    .form-container .bottom-shape {
        background-color: var(--yellow);
        bottom: -60px;
        left: -60px;
    }

    /* Re-enable overlay for larger screens */
    .overlay-container {
        display: block;
        position: absolute;
        top: 0;
        left: 50%;
        width: 50%;
        height: 100%;
        overflow: hidden;
        transition: transform 0.6s ease-in-out;
        z-index: 100;
    }

    .overlay {
        background: linear-gradient(to right, var(--dark-blue), var(--light-blue));
        background-repeat: no-repeat;
        background-size: cover;
        background-position: 0 0;
        color: var(--white);
        position: relative;
        left: -100%;
        height: 100%;
        width: 200%;
        transform: translateX(0);
        transition: transform 0.6s ease-in-out;
    }

    .overlay-panel {
        position: absolute;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        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%);
        left: 0;
    }

    .overlay-right {
        right: 0;
        transform: translateX(0);
    }

    /* States when right-panel-active is present */
    .container.right-panel-active .sign-up-container {
        transform: translateX(100%);
        opacity: 1;
        z-index: 5;
    }

    .container.right-panel-active .sign-in-container {
        transform: translateX(100%);
    }

    .container.right-panel-active .overlay-container {
        transform: translateX(-100%);
    }

    .container.right-panel-active .overlay {
        transform: translateX(50%);
    }

    .container.right-panel-active .overlay-left {
        transform: translateX(0);
    }

    .container.right-panel-active .overlay-right {
        transform: translateX(20%);
    }

    /* Logo styles for overlay panels (specific to larger screens) */
    .logo {
        display: flex;
        align-items: center;
        position: absolute;
        top: 20px;
        left: 20px;
        font-size: 1.2em;
        font-weight: 600;
        color: var(--white);
        z-index: 1;
    }
}

/* --- Desktop / Large Devices (>= 992px) --- */
@media (min-width: 992px) {
    .container {
        width: 900px; /* Lebar container asli untuk desktop */
        min-height: 500px;
    }
}


/* General Styles (keep these, they apply to all screen sizes unless overridden) */
h2 {
    font-size: 2.2em;
    color: var(--text-color);
    margin-bottom: 20px;
}
.overlay-panel h2 {
    color: var(--white);
    margin-top: 50px;
}
p {
    font-size: 0.9em;
    line-height: 1.5;
    letter-spacing: 0.5px;
    margin: 15px 0 20px;
    color: var(--text-color);
}
.overlay-panel p {
    color: var(--white);
    margin: 15px 0 20px;
}
.social-icons {
    margin: 15px 0;
}
.social-icon {
    border: 1px solid #ddd;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    height: 40px;
    width: 40px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.social-icon:hover {
    background-color: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
}
.or-text {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 15px;
}
form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    align-items: center;
}
.input-group {
    background-color: var(--light-gray);
    border-radius: 25px;
    display: flex;
    align-items: center;
    margin: 8px 0;
    padding: 10px 15px;
    width: 100%;
}
.input-group i {
    color: #999;
    margin-right: 10px;
}
.input-group input {
    background: none;
    border: none;
    outline: none;
    width: 100%;
    padding: 5px 0;
    font-size: 1em;
    color: var(--text-color);
}
.input-group input::placeholder {
    color: #aaa;
}
.input-group select { /* Pastikan ini ada untuk dropdown */
    background: none;
    border: none;
    outline: none;
    width: 100%;
    padding: 5px 0;
    font-size: 1em;
    color: var(--text-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px;
}
.input-group select option[disabled] {
    color: #aaa;
    background-color: #f0f0f0;
}
.forgot-password {
    color: #888;
    font-size: 0.9em;
    text-decoration: none;
    margin: 15px 0;
}
button {
    background-color: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 12px 45px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    outline: none;
}
button.ghost {
    background-color: transparent;
    border: 1px solid var(--white);
    color: var(--white);
}
button:hover {
    background-color: var(--dark-blue);
}
button.ghost:hover {
    background-color: var(--white);
    color: var(--primary-green);
}
/* Untuk logo di overlay (hanya muncul di desktop/tablet) */
.logo {
    display: flex;
    align-items: center;
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--white);
    z-index: 1;
}
.logo-img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 5px;
}

/* Mobile Radio/Checkbox styles (pastikan ini tetap ada jika Anda menggunakannya) */
.input-group-radio-gender,
.input-group-checkbox-interests,
.input-group-checkbox-terms {
    background-color: var(--light-gray);
    border-radius: 25px;
    display: flex;
    align-items: center;
    margin: 8px 0;
    padding: 10px 15px;
    width: 100%;
    max-width: 300px;
}
.input-group-radio-gender i,
.input-group-checkbox-interests i {
    color: #999;
    margin-right: 10px;
}
.input-group-radio-gender .radio-label,
.input-group-checkbox-interests .checkbox-label {
    color: var(--text-color);
    margin-right: 15px;
    font-size: 1em;
}
.input-group-radio-gender .radio-options,
.input-group-checkbox-interests .checkbox-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.input-group-radio-gender .radio-options label,
.input-group-checkbox-interests .checkbox-options label,
.input-group-checkbox-terms label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-color);
}
.input-group-radio-gender .radio-options input[type="radio"],
.input-group-checkbox-interests .checkbox-options input[type="checkbox"],
.input-group-checkbox-terms input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-green);
    border-radius: 50%; /* Untuk radio */
    margin-right: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.input-group-checkbox-interests .checkbox-options input[type="checkbox"],
.input-group-checkbox-terms input[type="checkbox"] {
    border-radius: 4px; /* Untuk checkbox */
}
.input-group-radio-gender .radio-options input[type="radio"]::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-green);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.input-group-checkbox-interests .checkbox-options input[type="checkbox"]::before,
.input-group-checkbox-terms input[type="checkbox"]::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--white);
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.input-group-radio-gender .radio-options input[type="radio"]:checked {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}
.input-group-radio-gender .radio-options input[type="radio"]:checked::before {
    opacity: 1;
    background-color: var(--white);
}
.input-group-checkbox-interests .checkbox-options input[type="checkbox"]:checked,
.input-group-checkbox-terms input[type="checkbox"]:checked {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}
.input-group-checkbox-interests .checkbox-options input[type="checkbox"]:checked::before,
.input-group-checkbox-terms input[type="checkbox"]:checked::before {
    opacity: 1;
}
.input-group-checkbox-terms label a {
    color: var(--primary-green);
    text-decoration: none;
    margin-left: 5px;
}
.input-group-checkbox-terms label a:hover {
    text-decoration: underline;
}

.input-group {
    background-color: var(--light-gray);
    border-radius: 25px;
    display: flex;
    align-items: center;
    margin: 8px 0;
    padding: 10px 15px;
    width: 100%;
    position: relative; /* <-- TAMBAHKAN BARIS INI */
}


#toggleSignInPassword, 
#toggleSignUpPassword {
    cursor: pointer;
    color: #999;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}