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

/* ---------- Base / Mobile (default) ---------- */

body{
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 100dvh;
    background-color: white;
    font-family: "Roboto", sans-serif;
}

/* Only the mobile illustration shows by default */
.desktop-img{
    display: none;
}
.tablet-img{
    display: none;
}
.mobile-img{
    display: block;
    width: 100%;
    height: auto;
}

/* Full-bleed card that fills the viewport on phones */
#main{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: 100dvh;
    background-color: white;
    padding: 0 0 1.5rem;
}

.form-section{
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

h1{
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: hsl(234, 29%, 20%);
    font-weight: 700;
}
.form-section p{
    color: hsl(234, 29%, 20%);
    margin-bottom: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}
ul{
    list-style: none;
}
li{
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: hsl(234, 29%, 20%);
}

.form{
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
}
.input-container{
    display: flex;
    justify-content: space-between;
}
.error{
    color: hsl(4, 100%, 67%);
    font-size: 0.8rem;
    font-weight: 700;
    display: none;
}
.input-container label{
    color: hsl(234, 29%, 20%);
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
}
input.error-placeholder::placeholder{
    color: hsl(4, 100%, 67%) !important;
    opacity: 1 !important;
}
.form input{
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid;
    height: 2.5rem;
    cursor: pointer;
    outline: none;
}
.form button{
    background-color: hsl(234, 29%, 20%);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    height: 2.5rem;
}
.form input:hover{
    border: 1px solid hsl(234, 29%, 20%);
}
.form input:focus{
    outline: none;
    border: 1px solid hsl(234, 29%, 20%);
}
.form button:hover{
    background-color: hsl(4, 100%, 67%);
    color: white;
}

/* Success message: full-screen on mobile, button anchored to bottom */
.success-message{
    display: none;              /* JS toggles this to flex */
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    min-height: 100dvh;
    background-color: white;
    padding: 2.5rem 1.5rem 2rem;
    margin-top: 60px;
}
.success-message img{
    width: 50px;
    height: 50px;
}
.success-message h1{
    font-size: 2.7rem;
    margin-top: 1rem;
    color: hsl(234, 29%, 20%);
    font-weight: 700;
}
.success-message p{
    color: hsl(234, 29%, 20%);
    font-size: 1rem;
    font-weight: 500;
}
.success-message button{
    background-color: hsl(234, 29%, 20%);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    height: 2.5rem;
    width: 100%;          /* push button to the bottom of the screen */
}
.success-message button:hover{
    background-color: hsl(4, 100%, 67%);
    color: white;
}
#user-email{
    color: hsl(234, 29%, 20%);
    font-weight: 700;
}
footer{
    margin-top: 280px;
}

/* ---------- Tablet (≥ 601px): centered rounded card ---------- */

@media screen and (min-width: 601px) {
    body{
        align-items: center;
        padding: 1.5rem;
        background-color: hsl(234, 29%, 20%);
    }

    #main{
        min-height: auto;
        max-width: 480px;
        border-radius: 1rem;
        padding: 1rem;
        overflow: hidden;
    }

    .mobile-img{
        display: none;
    }
    .tablet-img{
        display: block;
        width: 100%;
        height: auto;
        border-radius: 0.5rem;
    }

    .form-section{
        padding: 1.5rem;
    }
    h1{
        font-size: 2rem;
    }

    .success-message{
        width: 360px;
        min-height: auto;
        border-radius: 1rem;
        padding: 2rem;
    }
    .success-message h1{
        font-size: 1.8rem;
        margin-top: 0;
    }
    .success-message p{
        font-size: 0.8rem;
    }
    .success-message button{
        margin-top: 1rem;       /* normal flow inside the card */
    }
    footer{
        margin-top: 0;
    }
}

/* ---------- Desktop (≥ 769px): side-by-side layout ---------- */

@media screen and (min-width: 769px) {
    #main{
        flex-direction: row-reverse;
        align-items: center;
        max-width: 700px;
    }

    .tablet-img{
        display: none;
    }
    .desktop-img{
        display: block;
        height: 400px;
        width: auto;
        border-radius: 0.5rem;
    }

    .form-section{
        padding: 2rem;
    }
}