* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Root Var's*/
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-medium: #6b7280;
    --text-light: #9ca3af;
    --bg-light: #f9fafb;
    --bg-gray: #f3f4f6;
    --border-color: #e5e7eb;
    --error-color: #ef4444;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --overlay-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Dark theme variables */
[data-theme="dark"] {
    --white: #1f2937;
    --bg-light: #111827;
    --bg-gray: #1f2937;
    --text-dark: #f9fafb;
    --text-medium: #d1d5db;
    --text-light: #9ca3af;
    --border-color: #374151;
}

/* Login Wrapper */
.login-wrapper {
    min-height: calc(100vh - 80px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    background: var(--white);
    position: relative;
}

/* Main Container */
.container {
    background-color: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    width: 1000px;
    max-width: 100%;
    min-height: 600px;
    display: flex;
}

/* Form Containers */
.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign-in-container {
    left: 0;
    z-index: 2;
    opacity: 1;
}

.sign-up-container {
    left: 0;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.container.right-panel-active .sign-in-container {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

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

@keyframes show {
    0%, 49.99% {
        opacity: 0;
        z-index: 1;
    }
    50%, 100% {
        opacity: 1;
        z-index: 5;
    }
}

/* Form Styling */
form {
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 60px;
    width: 100%;
    text-align: center;
}

form h1 {
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
    font-size: 36px;
    letter-spacing: -0.5px;
}

form span {
    font-size: 15px;
    color: var(--text-medium);
    margin-bottom: 35px;
    font-weight: 400;
}

/* Input Fields */
.input-field {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 12px 0;
}

.input-field input {
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    padding: 16px 20px 16px 50px;
    width: 100%;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    color: var(--text-dark);
    font-weight: 400;
}

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

.input-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Icon positioning - lock and envelope icons */
.input-field .fa-envelope,
.input-field .fa-lock {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-medium);
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}

/* Password field specific */
.password-field {
    position: relative;
}

/* Toggle password icon */
.toggle-password {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-medium);
    transition: color 0.3s;
    font-size: 18px;
    z-index: 10;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* Error Messages */
.form-error {
    color: var(--error-color);
    font-size: 14px;
    margin: 8px 0 0 0;
    text-align: left;
    width: 100%;
    max-width: 380px;
    font-weight: 500;
    min-height: 20px;
}

/* Links */
form a {
    color: var(--text-medium);
    font-size: 14px;
    text-decoration: none;
    margin: 20px 0 10px 0;
    transition: color 0.3s;
    font-weight: 500;
}

form a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Buttons */
button {
    font-family: 'Roboto', sans-serif;
}

button[type="submit"] {
    border-radius: 12px;
    border: none;
    background: var(--primary-color);
    color: var(--white);
    font-size: 15px;
    font-weight: 700;
    padding: 16px 60px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

button[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

button[type="submit"]:active {
    transform: translateY(0);
}

button.ghost {
    background: transparent;
    border: 3px solid var(--white);
    color: var(--white);
    padding: 14px 50px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
}

button.ghost:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: scale(1.05);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button:disabled:hover {
    transform: none;
    box-shadow: none;
}

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

.overlay-container button {
    pointer-events: auto;
}

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

.overlay {
    background: var(--overlay-gradient);
    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 50px;
    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 h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--white);
    letter-spacing: -1px;
}

.overlay-panel p {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.95);
}

/* Mobile Form Toggle - Hidden by default on desktop */
.mobile-form-toggle {
    display: none;
    justify-content: center;
    gap: 12px;
    padding: 24px 20px;
    background-color: transparent;
    border-radius: 24px 24px 0 0;
}

.mobile-form-toggle button {
    flex: 1;
    padding: 14px 24px;
    margin: 0;
    background-color: transparent;
    color: var(--text-medium);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.mobile-form-toggle button.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.mobile-form-toggle button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.mobile-form-toggle button.active:hover {
    background: var(--primary-dark);
    color: var(--white);
}

/* Transitions */
.login-wrapper,
.container,
form,
.input-field input,
button {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Mobile responsiveness - Stack forms vertically */
@media screen and (max-width: 968px) {
    .login-wrapper {
        padding: 20px 15px;
        min-height: calc(100vh - 70px);
        background: var(--bg-gray);
    }

    .container {
        width: 100%;
        max-width: 500px;
        min-height: auto;
        border-radius: 20px;
        display: block;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    /* Hide mobile form toggle buttons */
    .mobile-form-toggle {
        display: none !important;
    }

    .form-container {
        position: static;
        width: 100%;
        height: auto;
        min-height: auto;
        transition: none;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        display: block !important;
    }

    .sign-in-container,
    .sign-up-container {
        position: static;
        left: auto;
        transform: none !important;
        animation: none;
        z-index: auto;
    }
    
    /* Show both forms stacked vertically */
    .sign-in-container {
        display: block !important;
        border-bottom: 2px solid var(--border-color);
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    
    .sign-up-container {
        display: block !important;
    }

    form {
        padding: 40px 30px 50px;
    }

    form h1 {
        font-size: 32px;
    }

    .overlay-container {
        display: none !important;
        visibility: hidden;
        pointer-events: none;
        opacity: 0;
    }
}

@media screen and (max-width: 480px) {
    .login-wrapper {
        padding: 15px 10px;
    }

    .container {
        border-radius: 16px;
    }

    form {
        padding: 35px 25px 45px;
    }

    form h1 {
        font-size: 28px;
        margin-bottom: 10px;
    }

    form span {
        font-size: 14px;
        margin-bottom: 30px;
    }

    .input-field {
        margin: 10px 0;
    }

    .input-field input {
        padding: 14px 18px 14px 45px;
        font-size: 14px;
        border-radius: 10px;
    }

    .input-field .fa-envelope,
    .input-field .fa-lock {
        left: 16px;
        font-size: 16px;
    }

    .toggle-password {
        right: 16px;
        font-size: 16px;
    }

    button[type="submit"] {
        padding: 14px 50px;
        font-size: 14px;
        border-radius: 10px;
    }

    /* Add more visual separation between forms on smaller screens */
    .sign-in-container {
        padding-bottom: 30px !important;
        margin-bottom: 30px !important;
    }

    form a {
        font-size: 13px;
        margin: 16px 0 8px 0;
    }
}