:root {
    --primary-navy: #262262;
    --primary-navy-dark: #1d1949;
    --primary-red: #ff4b2b; /* Warna aksen untuk button ghost */
    --green-light: #7dbe32;
    --green-dark: #6aa92b;
    --white: #ffffff;
    --gray-bg: #e5e5e5;
    --text-dark: #333;
    --shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
    --font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(rgba(1, 1, 15, 0.5), rgba(16, 13, 60, 0.9)),
        url("/assets/img/backgrounds/bg.webp");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: var(--font-family);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

h1.text-title {
    color: var(--white);
    font-weight: 700;
    font-size: 32px;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
}

h2 {
    text-align: center;
    font-weight: 600;
    font-size: 28px;
    margin: 10px 0;
}

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

span {
    font-size: 12px;
}

a {
    color: var(--text-dark);
    font-size: 14px;
    text-decoration: none;
    margin: 10px 0;
    transition: 0.3s;
}

button {
    border-radius: 20px;
    border: 1px solid var(--primary-navy);
    background-color: var(--primary-navy);
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in, background-color 0.3s;
    cursor: pointer;
    margin-top: 10px;
}

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

button.ghost {
    background-color: transparent;
    border-color: var(--white);
}

button.btn-sm {
    padding: 10px 20px;
    font-size: 11px;
    width: auto;
}

form {
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    height: 100%;
    text-align: center;
}

input,
select {
    background-color: #eee;
    border: none;
    padding: 12px 15px;
    margin: 8px 0;
    width: 100%;
    border-radius: 20px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

select {
    margin-bottom: 20px;
    /* Adds a custom arrow to the right of the dropdown */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-wrapper {
    width: 100%;
    position: relative;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    cursor: pointer;
}

/* =========================================
    DESKTOP LAYOUT (The Sliding Logic)
   ========================================= */

.container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    width: 768px;
    max-width: 100%;
    min-height: 550px;
}

.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: linear-gradient(
        to right,
        var(--green-dark),
        var(--green-light)
    );
    color: var(--white);
    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%);
}

.overlay-panel .overlay-form {
    background-color: transparent;
    padding: 0;
    height: auto;
    width: 100%; /* Ensures inputs take full width */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.overlay-panel hr {
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.4); /* Semi-transparent white */
    margin: 20px 0 10px 0;
}

.overlay-panel input {
    background-color: rgba(255, 255, 255, 0.9);
}

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

.social-container a {
    border: 1px solid #dddddd;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    height: 40px;
    width: 40px;
}

.text-forgot-password {
    color: white;
    font-size: 11px;
    font-weight: bold;
    align-self: flex-start;
}

footer.enhanced-footer {
    background: rgba(34, 34, 34, 0.8); /* Semi-transparent dark */
    backdrop-filter: blur(10px); /* Modern blur effect */
    color: #fff;
    padding: 15px 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 13px;
    opacity: 0.8;
}

.footer-links a {
    color: #fff;
    margin: 0 10px;
    font-size: 13px;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.separator {
    opacity: 0.3;
}

.ms-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #262262; /* Navy Blue */
    color: #ffffff;
    border: none;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 50px; /* Makes it pill-shaped */
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Hover Effect */
.ms-login-btn:hover {
    background-color: #1d1949ff; /* Darker Navy on hover */
    box-shadow: 0 6px 8px rgba(19, 16, 16, 0.15);
}

/* Active/Click Effect */
.ms-login-btn:active {
    transform: scale(0.95);
}

/* Icon Styling */
.ms-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    background-color: white; /* Optional: ensures logo pops against navy */
    padding: 3px; /* Optional: padding inside the white box */
    border-radius: 3px; /* Slightly rounded corners for the icon bg */
}

.img-logo {
    width: 220px;
    margin: 15px 0;
}

.register-text {
    color: white;
    margin: 0;
    font-size: 13px;
}
.register-link {
    color: white;
    font-weight: 800;
    text-decoration: underline;
    cursor: pointer;
    display: inline;
}

/* --- Wide Image Fix for 16:9 --- */
.wide-logo-container {
    height: 15%;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.63);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 15px;
}

.wide-logo-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 40px;
    border-top: 3px solid #699f2cff;
    border-left: 3px solid #6a9f2cff;
    border-top-left-radius: 15px;
}

.wide-logo-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-bottom: 3px solid #262262be;
    border-right: 3px solid #262262be;
    border-bottom-right-radius: 15px;
}

.img-external-wide {
    width: 80%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* Styling the 'a' tag to look like your ghost button */
a.ghost {
    display: inline-block; /* Allows padding and width to work */
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid #ff4b2b; /* Tripatra Red */
    background-color: transparent;
    color: #ff4b2b;
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in, background-color 0.2s;
    cursor: pointer;
    margin-top: 15px;
    text-align: center;
}

/* Hover effect to make it feel interactive */
a.ghost:hover {
    background-color: rgba(255, 75, 43, 0.05); /* Very light red tint */
}

a.ghost:active {
    transform: scale(0.95);
}

/* Specific logout styling to ensure it fits the form layout */
.btn-logout {
    width: auto;
    min-width: 150px;
}

/* =========================================
   5. MOBILE RESPONSIVE (THE FIX)
   ========================================= */
@media (max-width: 768px) {
    body {
        padding-bottom: 60px; /* Space for footer */
        height: auto; /* Allow scrolling */
    }

    h1.text-title {
        font-size: 18px;
        margin: 20px 0;
    }

    .container {
        width: 100%;
        min-height: auto; /* Allow container to grow */
        height: auto;
        display: flex;
        flex-direction: column;
        overflow: visible; /* Penting agar overlay tidak terpotong */
    }

    /* Reset Absolute Positioning -> Flow Layout */
    .form-container {
        position: relative;
        width: 100%;
        height: auto;
        top: auto;
        left: auto;
        padding: 30px 20px;
        transition: none;
    }

    /* LOGIC: Show/Hide based on class instead of sliding */

    /* State 1: Default (Show Sign In, Hide Sign Up) */
    .sign-in-container {
        display: block;
    }
    .sign-up-container {
        display: none;
        opacity: 1;
        transform: none;
    }

    /* State 2: Active (Show Sign Up, Hide Sign In) */
    .container.right-panel-active .sign-in-container {
        display: none;
        transform: none;
    }
    .container.right-panel-active .sign-up-container {
        display: block;
        transform: none;
        animation: none;
    }

    /* OVERLAY / TOGGLE SECTION ON MOBILE */
    .overlay-container {
        position: relative;
        width: 100%;
        height: auto;
        left: auto;
        top: auto;
        transform: none !important;
    }

    .overlay {
        position: relative;
        width: 100%;
        left: auto;
        height: auto;
        transform: none !important;
        background: var(
            --green-dark
        ); /* Solid color, no complex gradient mess */
        padding: 20px 0;
    }

    .overlay-panel {
        position: relative;
        width: 100%;
        height: auto;
        top: auto;
        transform: none !important;
        padding: 20px;
    }

    /* Logic Overlay Mobile:
     Jika sedang Sign-In Mode (Default) -> Tampilkan Overlay Right (Navigasi Register/Client)
     Jika sedang Sign-Up Mode (Active) -> Tampilkan Overlay Left (Navigasi Login)
  */

    .overlay-left {
        display: none;
    } /* Default hide */
    .overlay-right {
        display: flex;
    } /* Default show */

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

    /* Adjustment for form inputs on mobile */
    form {
        padding: 0 15px;
    }
    input,
    select {
        font-size: 16px; /* Prevents iOS Zoom */
    }

    /* Footer Adjustment */
    .enhanced-footer {
        position: relative;
        margin-top: 20px;
        background: transparent;
    }
}
