@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body{
    background-color: #c9d6ff;
    background: linear-gradient(to right, #e2e2e2, #c9d6ff);
    background: url('Grapes-Photoroom.jpg') no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: 100vh;
}

/* ===========================
   DESKTOP STYLING
=========================== */
@media (min-width: 769px) {
    
    .container{
        background-color: #fff;
        border-radius: 30px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35);
        position: relative;
        overflow: hidden;
        width: 768px;
        max-width: 100%;
        min-height: 480px;

        display: flex; /* ✅ ensures left and right panels stay side-by-side */
    }
    
    .container p{
        font-size: 14px;
        line-height: 20px;
        letter-spacing: 0.3px;
        margin: 20px 0;
    }
    
    .container span{
        font-size: 12px;
    }
    
    .container a{
        color: #333;
        font-size: 13px;
        text-decoration: none;
        margin: 15px 0 10px;
    }
    
    button:hover {
        background: #f0f0f0;
    }
    
    .container form{
        background-color: #fff;
        display: flex;
        justify-content: center;
        flex-direction: column;
        padding: 3px 19px;
        height: 100%;
    }
    
    /* === Fix layout overlap === */
    .form-container {
        flex: 1; /* ✅ Takes half of .container */
        position: relative; /* ✅ remove absolute to prevent overlap */
        padding: 40px 30px;
        overflow-y: auto; /* ✅ prevents Save button from hiding */
    }

    .toggle-container {
        flex: 1; /* ✅ Takes the other half */
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(to right, #5c6bc0, #292939);
        color: white;
        text-align: center;
        padding: 30px;
        box-sizing: border-box;
        border-radius: 0 30px 30px 0;
    }

    /* You no longer need absolute positioning on toggle-panel */
    .toggle-panel {
        width: 100%;
    }

    .toggle-panel h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .toggle-panel p {
        font-size: 15px;
        line-height: 1.6;
    }

    .form-group {
        margin: 15px 0;
    }
    
    .container input{
        background-color: #eee;
        border: 1px solid #5b8ddf;
        margin: 8px 0;
        padding: 10px 15px;
        font-size: 13px;
        border-radius: 8px;
        width: 100%; /* ✅ fill form container nicely */
        outline: none;
    }

    /* ✅ Fix hidden Save Profile button issue */
    #usernameGroup {
        overflow-y: auto;
        max-height: 70vh;
    }

    form button {
        background-color: #5b8ddf;
        color: white;
        border: none;
        border-radius: 20px;
        padding: 10px 20px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        margin-top: 10px;
        align-self: center;
        transition: all 0.3s ease;
    }

    form button:hover {
        transform: scale(1.05);
        background-color: #dedede;
    }
}

/* ===========================
   MOBILE STYLING
=========================== */
@media (max-width: 768px) {
    .container {
        background: #fff;
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        text-align: center;
        width: 90%;
        max-width: 350px;
        display: block; /* ✅ stack panels vertically */
    }
    
    h1 {
        color: #cbcbf5;
        font-size: 22px;
    }
    
    .form-group {
        margin: 15px 0;
    }
    
    input[type="text"] {
        width: 90%;
        padding: 10px;
        border: 1px solid #5b8ddf;
        border-radius: 5px;
        font-size: 14px;
        margin-top: 10px;
    }

    form button {
        background-color: #5b8ddf;
        color: white;
        border: none;
        border-radius: 20px;
        padding: 10px 25px;
        margin-top: 15px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
    }
    
    .toggle-container {
        background: linear-gradient(to top, #383b47, #3e419a);
        border-radius: 20px;
        padding: 15px;
        text-align: center;
        color: white;
        margin-top: 10px;
    }
}
