/* ========================================
   QUESTION FORM — Enhanced
   ======================================== */

/* Question modal sizing */
.question-modal-content {
    max-width: 640px !important;
    padding: 36px 32px !important;
    position: relative;
}

.question-modal-content > .modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
}

.question-form {
    padding: 0;
    margin-top: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2d5a3d;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group .req {
    color: #e53e3e;
}

.form-group .form-hint {
    font-weight: 400;
    color: #999;
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--emerald);
    background: white;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--emerald) 10%, transparent);
}

.form-group input.input-error,
.form-group textarea.input-error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.error-message {
    display: block;
    color: #e53e3e;
    font-size: 0.82rem;
    margin-top: 5px;
    min-height: 0;
}

/* ---- Honeypot (invisible) ---- */
.q-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ---- File Drop Zone ---- */
.file-drop-zone {
    position: relative;
    border: 2px dashed #d0d5dd;
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fafbfc;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--emerald);
    background: var(--emerald-50);
}

.file-drop-zone.drag-over {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--emerald) 12%, transparent);
}

.file-input-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    border: none !important;
}

.file-drop-content {
    pointer-events: none;
}

.file-drop-icon {
    color: #b0b8c4;
    margin-bottom: 8px;
    transition: color 0.25s;
}

.file-drop-zone:hover .file-drop-icon,
.file-drop-zone.drag-over .file-drop-icon {
    color: var(--emerald);
}

.file-drop-text {
    font-size: 0.95rem;
    color: #555;
    margin: 0 0 4px;
}

.file-drop-link {
    color: var(--emerald);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.file-drop-hint {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}

/* ---- File List (attached files) ---- */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.file-list:empty {
    margin-top: 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f5f6f8;
    border-radius: 10px;
    font-size: 0.88rem;
    animation: fileSlideIn 0.25s ease both;
}

@keyframes fileSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.file-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

.file-item-icon.type-image  { background: #6366f1; }
.file-item-icon.type-pdf    { background: #ef4444; }
.file-item-icon.type-doc    { background: #3b82f6; }
.file-item-icon.type-video  { background: #8b5cf6; }
.file-item-icon.type-audio  { background: #f59e0b; }
.file-item-icon.type-other  { background: #6b7280; }

.file-item-preview {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.file-item-info {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    color: #999;
    font-size: 0.78rem;
}

.file-item-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #b0b0b0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    padding: 0;
}

.file-item-remove:hover {
    background: #fee2e2;
    color: #e53e3e;
}

.file-item-error {
    border: 1px solid #fca5a5;
    background: #fef2f2;
}

.file-item-error .file-item-name {
    color: #dc2626;
}

/* ---- Captcha ---- */
.captcha-group {
    margin-bottom: 24px;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-question {
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a472a;
    background: #eef7f1;
    padding: 10px 16px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    user-select: none;
    min-width: 100px;
    text-align: center;
    border: 1px solid #d1e7d7;
}

.captcha-row input {
    width: 80px !important;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.captcha-refresh {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    transition: all 0.2s;
    padding: 0;
}

.captcha-refresh:hover {
    background: var(--emerald-50);
    border-color: var(--emerald);
    color: var(--emerald);
}

/* ---- Submit Button ---- */
.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--emerald);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.submit-btn:hover {
    background: var(--emerald-dark);
    box-shadow: 0 5px 15px color-mix(in srgb, var(--emerald) 30%, transparent);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn .submit-icon {
    flex-shrink: 0;
}

.submit-btn.submitting .submit-icon {
    animation: sendFly 0.8s ease infinite;
}

@keyframes sendFly {
    0%, 100% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(3px) translateY(-3px); }
}

/* ---- Success Message ---- */
.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-message svg {
    margin-bottom: 16px;
}

.success-message p {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a472a;
    margin: 0;
}

.success-message .success-sub {
    font-size: 0.95rem;
    font-weight: 400;
    color: #666;
    margin-top: 6px;
}

/* ---- Modal title/desc (scoped to question modal) ---- */
.question-modal-content .modal-title {
    font-size: 1.8rem;
    color: #1a472a;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 700;
}

.question-modal-content .modal-description {
    text-align: center;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .question-modal-content {
        padding: 24px 18px !important;
    }
    .captcha-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .captcha-question {
        min-width: unset;
        font-size: 1rem;
        padding: 8px 12px;
    }
    .captcha-row input {
        width: 70px !important;
    }
    .file-drop-zone {
        padding: 18px 12px;
    }
}