html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', 'Helvetica', 'Arial', sans-serif;
    background-color: #EAF3FA; 
}

body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    overflow-y: auto;
}

form {
    background-color: #F5FAFD;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 700px;
    width: 90%; /* Responsive width */
    height: 100%;
}

h1 {
    margin-bottom: 18px;
    color: #2B4A63; 
}

p {
    margin-bottom: 8px;
    color: #5A6978; 
}

p.copyright {
    padding-bottom: 20px;
    font-size: 0.75rem; /* Responsive font size */
}

label {
    display: block;
    margin-bottom: 10px;
    color: #3A5872; 
    font-size: 1.2rem; /* Increased font size for better readability */
}

input, select, textarea {
    max-width: 100%;
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 20px;
    border: 1px solid #D0D7E2; 
    border-radius: 4px;
    font-size: 1rem; /* Increased font size for better readability */
    background-color: #EAF3FA; 
    box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
    border-color: #739FC7; 
    outline: none;
    box-shadow: 0 0 5px rgba(115, 159, 199, 0.5); 
}

input[type="radio"], input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

button {
    width: calc(25% - 10px); /* Adjust button width */
    padding: 10px 20px;
    background-color: #739FC7;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

button:hover {
    background-color: #5B89AE; 
    box-shadow: 0 4px 8px rgba(91, 137, 174, 0.2); 
}

button:active {
    background-color: #4A7596;
}

.input-error {
    border: 1px solid #FFB3CC; /* Light pink */
    background: linear-gradient(135deg, #FFEAF2, #FFD4DF); /* Light pink gradient */
}

.input-error:focus {
    border-color: #FF80AA; /* Bright pink for focus */
    outline: none;
    box-shadow: 0 0 8px rgba(255, 128, 170, 0.5); /* Мягкое розовое свечение */
    background: linear-gradient(135deg, #FFE6F0, #FFCFE2); /* Подсветка розового градиента */
}

.error-message {
    font-size: 0.8rem;
    margin-top: 5px;
    margin-bottom: 5px;
    color: #FF4D75; /* Bright pink for error text */
    display: none;
}

.info-message {
    font-size: 1rem;
    margin-top: 5px;
    margin-bottom: 5px;
}

#button-container {
    display: flex;
    justify-content: space-between;
}

#back-btn {
    margin-right: auto; 
}

#next-btn, #submit-btn {
    margin-left: auto; 
}

#next-btn, #submit-btn, #back-btn {
   width: calc(25% - 10px); /* For even distribution of buttons */
}

#back-btn {
   display: none; /* Hide back button by default */
}

/* Media Queries for Mobile Devices */
@media (max-width: 767px) { /* Mobile styles */
   form {
        width: 90%;
        padding: 14px; /* Adjust padding for smaller screens */
   }

   input, select, textarea {
       width: 100%;
       font-size: 1.2rem; /* Maintain readable input size on mobile */
       padding: 10px; /* Increase padding for touch targets */
       box-sizing: border-box;
   }

   button {
       width: calc(40% - 10px); /* Adjust button width for mobile */
       font-size: 1.2rem; /* Smaller button text */
   }

   h1 {
       font-size: 1.3rem; /* Responsive heading size */
   }

   p, label {
       font-size: 1.3rem; /* Responsive text size */
   }

   p.copyright {
       font-size: 0.75rem; /* Responsive font size */
   }
   #next-btn, #submit-btn, #back-btn {
       width: calc(40% - 10px);
       font-size: 1.2rem;
       padding: 10px;
       margin-top: 10px;
   }
}
