/* ======================= */
/* Feedback Form Styles    */
/* ======================= */
.feedback-form {
    display: flex;
    flex-direction: column;
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--card-border-color);
    /* max-width: 600px; Set a max-width for the form */
    margin: 3rem auto 0; /* Add top margin and center horizontally */
}

.form-title {
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.feedback-form label {
    font-weight: 600;
    text-align: left;
    padding-top: 0.75rem; /* Align with input text */
}

.feedback-form input,
.feedback-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--card-border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--primary-bg-color);
    color: var(--primary-text-color);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.2);
}

.form-full-width {
    grid-column: 1 / -1; /* Span full width */
}

.consent-container {
    margin-top: 1rem;
}

.consent {
    position: relative; /* For custom checkbox positioning */
    display: inline-flex; /* Use inline-flex */
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: normal;
    cursor: pointer;
}

.consent-text {
    white-space: nowrap;
}

/* Hide default checkbox */
.consent input[type="checkbox"] {
    position: fixed;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom checkbox style */
.consent .consent-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--secondary-text-color);
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.2s, border-color 0.2s;
}

/* Custom checkbox checkmark */
.consent .consent-checkbox::after {
    content: '';
    display: block;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg) translate(-50%, -50%);
    position: relative;
    left: 30%;
    top: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Style when checked */
.consent input[type="checkbox"]:checked + .consent-checkbox {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.consent input[type="checkbox"]:checked + .consent-checkbox::after {
    opacity: 1;
}

.form-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 1rem;
}

.feedback-form .submit-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.feedback-form .submit-btn:hover {
    background-color: #28a745; /* Green color for success/hover */
    transform: translateY(-2px);
}

.form-field-group {
    position: relative; /* New positioning context */
    padding-top: 1.5em; /* Make space for the error message */
    margin-bottom: 1rem;
}

.consent-field-group {
    padding-top: 0;
    margin-bottom: 0;
}

.consent-field-group .error-message {
    top: -1.5em; /* Adjust position for checkbox */
}

.error-message {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #a94442;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: normal;
    z-index: 10;
    display: none; /* Hidden by default, shown by JS */
    white-space: nowrap;
}

.error-message::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    border-width: 5px;
    border-style: solid;
    border-color: #a94442 transparent transparent transparent;
}

.msg {
    margin-top: 1rem;
    font-weight: 600;
}

.msg.success {
    color: #28a745;
}

.msg.error {
    color: #dc3545;
}

/* ======================= */
/* Feedback Modal Styles   */
/* ======================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 2rem 3rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s;
}

.modal-overlay.visible .modal-content {
    transform: translateY(0);
}

#modal-message {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--secondary-text-color);
    cursor: pointer;
    padding: 0;
}

/* Desktop Grid Layout */
@media (min-width: 769px) {
    .feedback-form {
        grid-template-columns: 150px 1fr; /* Label column and field column */
        align-items: left;
    }

    .form-title,
    .form-full-width {
        grid-column: 1 / -1; /* Span full width */
    }

    .feedback-form label[for='info'] {
        align-self: start; /* Align 'info' label to top */
    }
}