:root {
    --primary-color-dark: #5c3a9e;
    --primary-color-light: #7b4ad6;
    --secondary-color: #f4f1fa;
    --text-color-dark: #333;
    --text-color-light: #f1f1f1;
    --text-color-muted: #6c757d;
    --border-radius: 12px;
    --font-family: 'Nunito', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-container {
    display: flex;
    width: 900px;
    max-width: 100%;
    min-height: 650px;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Branding Panel (Left Side) */
.branding-panel {
    width: 45%;
    background: linear-gradient(135deg, var(--primary-color-light), var(--primary-color-dark));
    color: var(--text-color-light);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 2rem;
}

.branding-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: inherit;
    filter: blur(5px);
    z-index: 1;
}

.branding-content {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    margin-bottom: 1.5rem;
}

.branding-content h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.branding-content p {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.9;
}


/* Form Panel (Right Side) */
.form-panel {
    width: 55%;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    perspective: 1000px; /* Essential for 3D effect */
}

.flipper {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.flipper.is-flipped {
    transform: rotateY(180deg);
}

.form-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Hides the back of the element when flipped */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-back {
    transform: rotateY(180deg);
}

form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

form h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.social-logins {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    color: var(--text-color-muted);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--primary-color-light);
    color: #fff;
    border-color: var(--primary-color-light);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-color-muted);
    margin: 1rem 0;
    font-size: 0.8rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.divider span {
    padding: 0 1rem;
}

.input-group {
    position: relative;
    margin-bottom: 0.8rem;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fafafa;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color-light);
}

.input-group label {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--text-color-muted);
    background-color: #fafafa;
    padding: 0 5px;
    transition: all 0.2s ease;
    pointer-events: none;
}

.input-group input:focus + label,
.input-group input:valid + label {
    top: 0;
    font-size: 0.8rem;
    color: var(--primary-color-dark);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.forgot-password {
    color: var(--primary-color-dark);
    text-decoration: none;
}
.forgot-password:hover {
    text-decoration: underline;
}

form button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(to right, var(--primary-color-light), var(--primary-color-dark));
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.switch-form {
    text-align: center;
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-color-muted);
}

.switch-form a {
    color: var(--primary-color-dark);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 920px) {
    .login-container {
        flex-direction: column;
        width: 100%;
        max-width: 450px;
        min-height: auto;
    }
    .branding-panel, .form-panel {
        width: 100%;
    }
    .branding-panel {
        min-height: 250px;
    }
    .form-panel {
        padding: 2rem;
        min-height: 500px; /* Ensure enough space for the form */
    }
}