*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    font-family: Arial, sans-serif;
}

.service-head {
    text-align: center;
    font-size: 3em;
    padding: 30px 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 95vw;
    margin: 0 auto;
}

.personal-details,
.product-details {
    max-width: 1200px;
    width: 95vw;
    margin: 80px auto 40px auto;
    padding: 50px 20px 20px 20px;
    border-radius: 20px;
    background-color: white;
    box-shadow: -3px 3px 5px gray;
    position: relative;
    overflow-x: hidden;
}

.personal-details-title,
.product-details-title {
    position: absolute;
    top: 10px;
    left: 20px;
    background-color: white;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: -3px 3px 2px lightgray;
    z-index: 10;
    white-space: nowrap;
    max-width: calc(100vw - 60px);
    box-sizing: border-box;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
    justify-content: space-between;
    max-width: 100%;
    overflow-x: hidden;
}

.form-group,
.form-group-entire {
    flex: 1 1 47%;
    min-width: 250px;
    max-width: 100%;
    display: flex;
    align-items: center;
    border-radius: 10px;
    position: relative;
}

.form-group input,
.form-group select,
.form-group-entire input,
.form-group-entire select {
    width: 100%;
    height: 40px;
    border-radius: 10px;
    border: 1px solid black;
    padding-left: 10px;
    font-size: 1em;
    outline: none;
}

.form-group label,
.form-group-entire label {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: gray;
    font-size: 1em;
    background: white;
    padding: 0 5px;
    pointer-events: none;
    transition: 0.2s ease all;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:valid + label,
.form-group-entire input:focus + label,
.form-group-entire input:not(:placeholder-shown) + label,
.form-group-entire select:focus + label,
.form-group-entire select:valid + label {
    top: -8px;
    font-size: 0.8em;
    color: #555;
}

.redStar {
    color: red;
}

.submission {
    width: 95vw;
    max-width: 1200px;
    margin: 30px auto 0 auto;
    display: flex;
    justify-content: flex-end;
    overflow-x: hidden;
    box-sizing: border-box;
}

.submitBtn {
    font-size: 1.5em;
    color: white;
    background-color: hsl(195, 79%, 74%);
    padding: 10px 25px;
    border: none;
    border-radius: 10px;
    box-shadow: -2px 2px 4px gray;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    max-width: 100%;
}

.submitBtn:hover {
    background-color: hsl(195, 79%, 44%);
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .form-group,
    .form-group-entire {
        width: 95vw;
        max-width: 100%;
        flex: none;
    }

    .submitBtn {
        font-size: 1.2em;
        width: 100%;
        text-align: center;
        margin-top: 20px;
    }

    .submission {
        justify-content: center;
    }

    .personal-details-title,
    .product-details-title {
        left: 15px;
        font-size: 1em;
        white-space: normal;
        max-width: calc(100vw - 30px);
    }

    .service-head {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .form-group,
    .form-group-entire {
        width: 98vw;
    }

    .submitBtn {
        font-size: 1.1em;
    }
}