:root {
    --bg-main: #0b0b0f;
    --bg-card: #121216;
    --bg-input: #1a1a22;
    --accent-red: #e51b23;
    --accent-hover: #b31017;
    --text-white: #ffffff;
    --text-gray: #8f929d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}

body {
    background: var(--bg-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Auth Container Grid / Positions */
.auth-container {
    background: var(--bg-card);
    width: 850px;
    max-width: 100%;
    height: 550px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
}

.form-box {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
    width: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 45px;
}

/* Desktop absolute alignments fixed */
.sign-in-box {
    left: 0;
    z-index: 2;
    opacity: 1;
}

.sign-up-box {
    left: 0; /* Background overlay eka issarahata transition wenna set karanne */
    opacity: 0;
    z-index: 1;
}

/* Animations for Desktop transition (Fixed logic) */
.auth-container.active .sign-in-box {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
}

.auth-container.active .sign-up-box {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
}

/* Form Inner Styling */
form {
    width: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
}

h2 {
    color: var(--text-white);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-gray);
    font-size: 13px;
    margin-bottom: 20px;
}

.social-login {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.social-login a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-white);
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
}

.social-login a:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    transform: translateY(-2px);
}

.divider {
    color: var(--text-gray);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 15px;
    display: block;
}

/* Inputs Structure */
.input-group {
    position: relative;
    margin-bottom: 12px;
    width: 100%;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 14px;
    transition: 0.3s;
}

.input-group input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    background: var(--bg-input);
    border: 1px solid transparent;
    outline: none;
    border-radius: 8px;
    color: var(--text-white);
    font-size: 14px;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--accent-red);
}

.input-group input:focus ~ i {
    color: var(--accent-red);
}

.forgot-pass {
    color: var(--text-gray);
    font-size: 13px;
    text-decoration: none;
    text-align: right;
    margin: 5px 0 15px;
    transition: 0.3s;
}

.forgot-pass:hover {
    color: var(--accent-red);
}

/* Main Crimson Action Button */
.auth-btn {
    background: var(--accent-red);
    color: var(--text-white);
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: 0.3s;
}

.auth-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 15px rgba(229, 27, 35, 0.4);
}

/* Desktop Only Sliding Overlay Panels */
.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.auth-container.active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: linear-gradient(135deg, #2b0608 0%, #121216 100%);
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--text-white);
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
    border-left: 2px solid var(--accent-red);
}

.auth-container.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-panel h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-white);
}

.overlay-panel p {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 25px;
}

.left-panel {
    transform: translateX(-20%);
}

.auth-container.active .left-panel {
    transform: translateX(0);
}

.right-panel {
    right: 0;
    transform: translateX(0);
}

.auth-container.active .right-panel {
    transform: translateX(20%);
}

.ghost-btn {
    background: transparent;
    color: var(--text-white);
    border: 2px solid var(--text-white);
    padding: 10px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.ghost-btn:hover {
    background: var(--text-white);
    color: var(--bg-main);
}

/* Mobile View Mode Swapper */
.toggle-text-mobile {
    display: none;
    color: var(--text-gray);
    font-size: 13px;
    margin-top: 20px;
}

.toggle-text-mobile span {
    color: var(--accent-red);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* -------------------------------------------------------------
   RESPONSIVE MEDIA QUERIES (Mobile & Tablet fixes)
------------------------------------------------------------- */
@media (max-width: 768px) {
    .auth-container {
        width: 100%;
        max-width: 420px;
        height: auto;
        min-height: 580px;
    }

    .overlay-container {
        display: none !important;
    }

    .form-box {
        width: 100%;
        padding: 40px 24px;
        position: relative;
        left: 0 !important;
        transform: none !important;
        opacity: 1 !important;
    }

    /* Mobile responsive display states toggle */
    .auth-container .sign-up-box {
        display: none;
    }

    .auth-container .sign-in-box {
        display: flex;
    }

    .auth-container.active .sign-in-box {
        display: none !important;
    }

    .auth-container.active .sign-up-box {
        display: flex !important;
    }

    .toggle-text-mobile {
        display: block;
    }
}