body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top for long forms */
    min-height: 100vh;
    margin: 0;
    padding: 30px 15px;
    box-sizing: border-box;
    color: #333;
}

.fgen-form-wrapper {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px; /* По-широка за въпросите */
    overflow: hidden; /* For step animations */
}

.fgen-form-wrapper h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.fgen-form {
    position: relative;
}

.fgen-field {
    display: none; /* Скриваме всички стъпки по подразбиране */
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
    margin-bottom: 25px;
}

.fgen-field.active-step {
    display: block; /* Показваме активната стъпка */
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fgen-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #34495e;
    font-size: 16px;
    line-height: 1.4;
}

.fgen-input,
.fgen-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 15px;
    color: #2c3e50;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.fgen-input:focus,
.fgen-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.fgen-textarea {
    resize: vertical;
    min-height: 100px;
}

.fgen-input.invalid,
.fgen-textarea.invalid {
    border-color: #e74c3c; /* Red border for invalid fields */
}

.fgen-error-message {
    display: none;
    color: #e74c3c;
    font-size: 0.875em;
    margin-top: 5px;
}

.fgen-input.invalid + .fgen-error-message,
.fgen-textarea.invalid + .fgen-error-message {
    display: block;
}


.fgen-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    margin-bottom: 20px;
}

.fgen-button,
.fgen-submit {
    background-color: #3498db;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.1s ease;
    min-width: 100px; /* Ensure buttons have some minimum width */
}

.fgen-button:hover,
.fgen-submit:hover {
    background-color: #2980b9;
}

.fgen-button:active,
.fgen-submit:active {
    transform: translateY(1px);
}

.fgen-button#prevBtn {
    background-color: #7f8c8d;
}
.fgen-button#prevBtn:hover {
    background-color: #6c7a7b;
}


.fgen-submit {
    background-color: #2ecc71; /* Green for submit */
}
.fgen-submit:hover {
    background-color: #27ae60;
}

.fgen-button:disabled,
.fgen-submit:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.fgen-progress-container {
    width: 100%;
    background-color: #ecf0f1;
    border-radius: 4px;
    margin-bottom: 20px;
    height: 20px; /* Height for progress bar container */
    position: relative;
}

.fgen-progress-bar {
    height: 100%;
    width: 0%; /* Initial width */
    background-color: #3498db;
    border-radius: 4px;
    transition: width 0.4s ease-in-out;
}
.fgen-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8em;
    color: #2c3e50;
    font-weight: bold;
}
.fgen-progress-bar.completed + .fgen-progress-text {
    color: white; /* Change text color when bar is full or nearly full for contrast */
}


.fgen-status {
    margin-top: 20px;
    text-align: center;
    font-size: 1em;
    padding: 10px;
    border-radius: 5px;
}
.fgen-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.fgen-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.fgen-status.sending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Hide elements initially */
#prevBtn, #submitBtn {
    display: none;
}