/* contact.css (Modified and Extended) */

.form {
    border: 1px solid black;
    width: 100%;
    max-width: 600px;
    background-color: #dddddd;
    border-radius: 8px;
    padding: 15px;
    margin: 0 auto;
}

.section {
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    border-radius: 8px;
}

.name-section,
.emailphone-section {
    flex-direction: row;
}

.name-section .input,
.emailphone-section .input {
    width: 50%;
}

.name-section .input:first-child,
.emailphone-section .input:first-child {
    margin-right: 5px;
}

.name-section .input:last-child,
.emailphone-section .input:last-child {
    margin-left: 5px;
}

.input {
    width: 100%;
    margin: 5px 0;
    position: relative;
}

.input input,
.input textarea {
    height: 40px;
    width: 100%;
    font-size: 18px;
    padding: 5px;
    border: 1px solid #999;
    border-radius: 4px;
    box-sizing: border-box;
    transition: color 0.2s ease-in-out;
}

.input input::placeholder,
.input textarea::placeholder {
    color: transparent;
    transition: color 0.2s ease-in-out;
}

.input input.show-placeholder::placeholder,
.input textarea.show-placeholder::placeholder {
    color: #999;
}

.input textarea {
    height: 150px;
    resize: vertical;
}

.input label {
    position: absolute;
    padding: 2px;
    top: 10px;
    left: 10px;
    pointer-events: none;
    transition: all 0.2s ease-in-out;
}

.input input:focus,
.input textarea:focus {
    outline: none;
    border-color: black;
}

.input input:focus~label,
.input input:not(:placeholder-shown)~label,
.input textarea:focus~label,
.input textarea:not(:placeholder-shown)~label {
    transform: translate(-15px, -20px) scale(0.8);
    background-color: #dddddd;
    padding: 0 5px;
}

.input input.touched:invalid,
.input textarea.touched:invalid {
    border-color: red;
}

.submit-button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
}

.req-indicator {
    color: red;
    margin-left: 2px;
}

.required {
    font-weight: bold;
}

/* New CSS to hide the indicator on focus */
.input input:focus~label .req-indicator,
.input textarea:focus~label .req-indicator {
    display: none;
}
