/* --- 1. UTILITY AND BASE STYLES --- */

:root {
    /* Custom Colors - Tumhare original design se liye gaye rang */
    --color-light-bg: #f3f4f6;
    /* Creamy White */
    --color-dark-bg: #101e3b;
    /* Blackish Blue (Used in info panel) */
    --color-accent: #f59e0b;
    /* Yellow/Orange */
    --color-light-text: #1f2937;
    --color-dark-text: #e5e7eb;
    --color-sticky-bg: rgba(253, 230, 138, 0.7);
    /* Transparent Yellowish */
    --color-border: #d1d5db;
    /* Gray-300 */

    /* Background Colors - RESTORED ORIGINAL BLUE TONES */
    --color-bg-base: #0A192F;
    /* Deep Blue */
    --color-bg-grad1: #1A4E78;
    /* Mid Blue */
    --color-bg-grad2: #2A6890;
    /* Lighter Blue */

    /* NEW: Light Cream/Particle Color */
    --color-particle: rgba(255, 250, 240, 0.25);
    /* Very light cream with transparency */
    --color-particle-shadow: rgba(255, 250, 240, 0.1);
}

/* --- 2. BASE & BACKGROUND ANIMATION: CREAM PARTICLES --- */

/* Keyframes for particles rising */
@keyframes particles {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    50% {
        opacity: 1;
        /* Max visibility in the middle */
    }

    100% {
        transform: translateY(-100vh) scale(1.5);
        /* Rise up and fade out */
        opacity: 0;
    }
}

/* Helper Keyframes for the base gradient */
@keyframes flowing-waves {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

/* --- Global Reset and Body Styling --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.animated-background {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    overflow: hidden;

    /* Base background color set to deep blue */
    background-color: var(--color-bg-base);
    background-image: linear-gradient(135deg, var(--color-bg-base), var(--color-bg-grad1));
    background-size: 400% 400%;
    animation: flowing-waves 30s ease infinite alternate;
    /* Very slow movement for base gradient */

    color: var(--color-light-text);
    padding: 0;
    /* <<< CHANGED - Full width on mobile */
}

/* Particle Container/Generator */
.animated-background::after {
    content: '';
    position: absolute;
    top: 100vh;
    /* Start just below the screen */
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -3;
    pointer-events: none;

    /* Generating the particles using box-shadow */
    box-shadow:
        /* Particle Group 1 (small, less visible) */
        10vw 10vh 1px 1px var(--color-particle-shadow),
        20vw 30vh 1px 1px var(--color-particle-shadow),
        35vw 50vh 1px 1px var(--color-particle-shadow),
        50vw 20vh 1px 1px var(--color-particle-shadow),
        60vw 80vh 1px 1px var(--color-particle-shadow),
        75vw 40vh 1px 1px var(--color-particle-shadow),
        90vw 60vh 1px 1px var(--color-particle-shadow),

        /* Particle Group 2 (medium, more visible cream) */
        5vw 5vh 2px 2px var(--color-particle),
        25vw 70vh 2px 2px var(--color-particle),
        45vw 15vh 2px 2px var(--color-particle),
        70vw 90vh 2px 2px var(--color-particle),
        85vw 25vh 2px 2px var(--color-particle),

        /* Particle Group 3 (larger, brightest) */
        15vw 90vh 3px 3px var(--color-particle),
        40vw 5vh 3px 3px var(--color-particle),
        80vw 50vh 3px 3px var(--color-particle);

    border-radius: 50%;
    width: 5px;
    height: 5px;
    background: var(--color-particle);

    /* Applying the rising particles animation */
    animation: particles 30s linear infinite;
}


/* --- 3. MAIN LAYOUT & SWAP ANIMATION --- */

.main-container {
    width: 100%;
    /* <<< CHANGED - Full width on mobile */
    max-width: 1000px;
    height: auto;
    border-radius: 0;
    /* <<< CHANGED - Full width on mobile */
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

.content-wrapper {
    display: flex;
    width: 200%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-wrapper.swap-right {
    transform: translateX(-50%);
}

.content-section {
    width: 50%;
    /* <<< CHANGED (This was the main bug) */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 90vh;
}

.login-panel,
.info-panel {
    flex: 1 1 auto;
    padding: 2rem 1.5rem;
    /* <<< CHANGED - Better padding for mobile */
}

.login-panel {
    overflow: hidden;
}

.info-panel {
    padding: 1.5rem;
    overflow-y: auto;
    display: none;
    /* <<< ADDED - Hides info panel on mobile */
}

@media (min-width: 1024px) {

    /* <<< ADDED - Restores desktop padding & layout >>> */
    .animated-background {
        padding: 20px;
    }

    .main-container {
        width: 95%;
        border-radius: 1rem;
    }

    .login-panel,
    .info-panel {
        padding: 2rem 2.5rem;
    }

    /* <<< END OF ADDED RULES >>> */

    .main-container {
        height: 90vh;
    }

    /* <<< Restores 50% width and row direction on desktop */
    .content-section {
        width: 50%;
        flex-direction: row;
        /* <<< MERGED */
    }

    /* <<< Restores info panel on desktop */
    .info-panel {
        display: flex;
        /* Use flex to match its parent */
        flex-direction: column;
        /* Ensure it stacks vertically */
    }

    .content-section:first-child>div:first-child {
        width: 40%;
    }

    .content-section:first-child>div:last-child {
        width: 60%;
    }

    .content-section:last-child>div:first-child {
        width: 60%;
    }

    .content-section:last-child>div:last-child {
        width: 40%;
    }
}


/* --- 4. FORM PANEL STYLING --- */

.form-container {
    background-color: var(--color-light-bg);
    position: relative;
    height: 100%;
}

.form-content-wrapper {
    padding-bottom: 5rem;
    max-width: 400px;
    margin: 0 auto;
}

.heading-container {
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.heading-container h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0;
}

.form-content-wrapper>p {
    margin-bottom: 1rem;
    /* <<< CHANGED (was 1.5rem) - Reduces space */
    color: #4b5563;
    font-size: 1rem;
}

.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
    /* <<< CHANGED (was 0.5rem) - Reduces space */
}

.form-group input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border);
    background-color: white;
    color: var(--color-light-text);
    transition: all 150ms ease-in-out;
}

.form-group-stack>div+div {
    margin-top: 1rem;
    /* <<< CHANGED (was 1.25rem) - Reduces space */
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    padding-right: 0.75rem;
    color: #9ca3af;
    cursor: pointer;
}

.button-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    /* <<< CHANGED (was 1rem) - Fine-tuning space */
}

.button-row button {
    width: 48%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    background-color: var(--color-accent);
    color: white;
    font-weight: 700;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    transition: all 300ms ease-in-out;
}

.button-row a {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: color 150ms ease-in-out;
}

.button-row a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.sticky-footer-link {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 0;
    background-color: var(--color-sticky-bg);
    border-top: 1px solid var(--color-accent);
    text-align: center;
    font-size: 0.875rem;
    color: #374151;
    z-index: 10;
}

.sticky-footer-link a {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
}

.sticky-footer-link a:hover {
    text-decoration: underline;
}


/* --- 5. INFO PANEL STYLING --- */

.info-panel hr {
    border: 0;
    height: 1px;
    background-color: #374151;
    margin: 0.75rem 0;
}

.info-panel {
    background-color: var(--color-dark-bg);
    color: var(--color-dark-text);
    overflow: hidden;
    /* <<< CHANGED (was hidden) - Allows scrolling on desktop if needed */
}

.info-panel-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.info-panel-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.info-panel-header .stats-row {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.info-panel-header .stats-row span {
    color: var(--color-accent);
    font-weight: 700;
}

.icons-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;

    margin-bottom: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-accent);
    display: block;
    width: 100%;
}

.icons-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

#icon-container-login,
#icon-container-signup {
    margin-top: 0.75rem;
}

.icon-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
}

.icon-logo {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.icon-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.25rem;
}

.icon-text {
    flex-grow: 1;
    line-height: 1.2;
    padding: 0;
    min-width: 0;
}

.icon-text p:first-child {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-dark-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.icon-text p:last-child {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}