@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Inter:wght@400;600&display=swap');

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background-color: #87CEEB;
}

#animatedBackgroundCanvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: transparent;
}

.content-wrapper {
    position: relative;
    z-index: 1;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 0 20px;
    background: linear-gradient(to bottom right, #ffe9e9, #fff5f5);
}

.hero-content {
    text-align: center;
    max-width: 650px;
    background: rgba(255, 255, 255, 0.85);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 600;
    color: #c94f7c;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #5a5a5a;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(to right, #ff6b81, #ff9aa2);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 129, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(to right, #ff5e74, #ff7e91);
}

.btn-secondary {
    background: white;
    color: #ff6b81;
    border: 2px solid #ff6b81;
}

.btn-secondary:hover {
    background-color: #ff6b81;
    color: white;
}

.hero-links {
    margin-top: 1.5rem;
}

.hero-links a {
    margin: 0 15px;
    color: #aa6f8f;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.hero-links a:hover {
    color: #c94f7c;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    min-height: 100vh;
    background: linear-gradient(to right, #ffe9f0, #fff4f7);
}

.auth-card {
    background-color: #ffffff;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.auth-title {
    font-size: 2rem;
    color: #c94f7c;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.auth-footer {
    font-size: 1rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.btn-back {
    background-color: #ff6b81;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-back:hover {
    background-color: #ff4e6b;
}

@media screen and (max-width: 768px) {
    .hero-container {
        padding: 0 15px;
    }

    .hero-content {
        padding: 2.5rem 1.5rem;
        border-radius: 12px;
    }

    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 0.8rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .hero-links {
        margin-top: 1rem;
    }

    .hero-links a {
        margin: 0 10px;
        font-size: 0.9rem;
    }

    .auth-container {
        padding: 40px 15px;
    }

    .auth-card {
        padding: 30px;
        border-radius: 15px;
    }

    .auth-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .auth-footer {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .btn-back {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    /* IMPORTANT: Hide the overlay container on mobile */
    .overlay-container {
        display: none;
    }

    /* Ensure mobile switch buttons are visible and styled on mobile */
    .mobile-switch-button {
        display: block; /* Make sure it's visible */
        width: 100%; /* Make it full width for better touch targets */
        margin-top: 15px; /* Add some space above it */
        background-color: transparent; /* Style like a ghost button */
        border-color: #FF4B2B;
        color: #FF4B2B;
    }

    /* Adjust form containers for mobile */
    .form-container {
        position: relative; /* Remove absolute positioning on mobile */
        width: 100%; /* Full width */
        height: auto; /* Auto height */
        padding: 40px 20px; /* Adjust padding */
        box-shadow: none; /* Remove box shadow if preferred for mobile forms */
        border-radius: 0; /* Remove border-radius if preferred for full-width forms */
    }

    .sign-up-container,
    .sign-in-container {
        position: relative; /* Crucial for proper display on mobile */
        width: 100%; /* Full width */
        transition: none; /* Disable transition for simple show/hide */
        opacity: 1; /* Always visible when active */
        z-index: 1; /* Reset z-index */
        transform: none; /* Remove transforms */
        left: auto; /* Reset left */
    }

    /* Control visibility of forms via JS, so these are starting states */
    .sign-up-container {
        display: none; /* Hidden by default on mobile, will be shown by JS */
    }
}

@media screen and (max-width: 480px) {
    .hero-content {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        gap: 0.6rem;
    }

    .hero-links a {
        display: block;
        margin: 5px 0;
        font-size: 0.85rem;
    }

    .auth-card {
        padding: 20px;
    }

    .auth-title {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 320px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .btn-primary,
    .btn-secondary {
        font-size: 0.85rem;
        padding: 0.7rem 0.8rem;
    }

    .auth-title {
        font-size: 1.3rem;
    }
}

@media screen and (min-width: 769px) {
    /* Ensure the overlay and desktop form behavior is active for larger screens */
    .overlay-container {
        display: block; /* Show overlay on desktop */
    }

    .sign-in-container {
        left: 0;
        width: 50%;
        z-index: 2;
        display: block; /* Ensure it's displayed on desktop */
    }

    .container.right-panel-active .sign-in-container {
        transform: translateX(100%);
    }

    .sign-up-container {
        left: 0;
        width: 50%;
        opacity: 0;
        z-index: 1;
        display: block; /* Ensure it's displayed on desktop (opacity handles visibility) */
    }

    .container.right-panel-active .sign-up-container {
        transform: translateX(100%);
        opacity: 1;
        z-index: 5;
        animation: show 0.6s;
    }

    .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: #FF416C;
        background: -webkit-linear-gradient(to right, #FF4B2B, #FF416C);
        background: linear-gradient(to right, #FF4B2B, #FF416C);
        background-repeat: no-repeat;
        background-size: cover;
        background-position: 0 0;
        color: #FFFFFF;
        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%);
    }

    /* Hide mobile switch buttons on desktop */
    .mobile-switch-button {
        display: none !important;
    }
}