/**
 * DACTYLO Questions Publiques — front styles (based on provided mockup).
 *
 * @since 1.0.0
 */

:root {
    --dqp-red: #d9403f;
    --dqp-red-dark: #c23636;
    --dqp-navy: #1f3763;
    --dqp-blue: #4a6fa5;
    --dqp-card-bg: #ffffff;
    --dqp-radius: 16px;
}

/* ---------- Bouton ---------- */

.dqp-open-btn {
    display: inline-block;
    background: var(--dqp-red);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dqp-open-btn:hover,
.dqp-open-btn:focus {
    background: var(--dqp-red-dark);
    color: #fff;
}

/* ---------- Grille de cartes ---------- */

.dqp-grid {
    column-count: 3;
    column-gap: 24px;
    margin: 24px 0;
}

@media (max-width: 900px) {
    .dqp-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .dqp-grid {
        column-count: 1;
    }
}

.dqp-card {
    background: var(--dqp-card-bg);
    border-radius: var(--dqp-radius);
    box-shadow: 0 6px 24px rgba(31, 55, 99, 0.08);
    padding: 28px;
    margin: 0 0 24px;
    break-inside: avoid;
}

/* Reset : écrase les tailles/marges que le thème impose aux h3 et p des cartes. */
.dqp-card h3,
.dqp-card p,
.dqp-card div {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
}

.dqp-card-label {
    color: var(--dqp-red) !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    margin: 0 0 6px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.dqp-card-meta + .dqp-card-label,
.dqp-card-question + .dqp-card-label {
    margin-top: 18px !important;
}

.dqp-card-question {
    color: var(--dqp-navy) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    margin: 0 0 4px !important;
}

.dqp-card-meta {
    color: var(--dqp-blue) !important;
    font-size: 13px !important;
    margin: 0 !important;
}

.dqp-card-answer {
    color: var(--dqp-navy) !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
}

.dqp-card-answer p {
    font-size: 15px !important;
    margin: 0 0 10px !important;
}

.dqp-card-answer p:last-child {
    margin-bottom: 0 !important;
}

/* ---------- Modal ---------- */

.dqp-no-scroll {
    overflow: hidden;
}

.dqp-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483647; /* Premier plan absolu, au-dessus de tout élément du thème. */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dqp-modal[hidden] {
    display: none;
}

.dqp-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 25, 40, 0.55);
}

.dqp-modal-panel {
    position: relative;
    background: #fff;
    border-radius: var(--dqp-radius);
    max-width: 50%;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
    .dqp-modal-panel {
        max-width: 95%;
    }
}

/* Reset agressif : écrase les marges/paddings que le thème impose
   aux p, labels et champs de formulaire à l'intérieur du modal. */
.dqp-modal-panel p,
.dqp-modal-panel label,
.dqp-modal-panel h2,
.dqp-modal-panel input,
.dqp-modal-panel select,
.dqp-modal-panel textarea {
    margin: 0 0 10px !important;
    line-height: 1.35 !important;
}

.dqp-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--dqp-navy);
    cursor: pointer;
    padding: 4px;
}

.dqp-modal-title {
    color: var(--dqp-navy);
    font-size: 20px;
    margin: 0 0 16px !important;
}

/* ---------- Formulaire ---------- */

.dqp-field {
    margin: 0 0 12px !important;
    padding: 0 !important;
}

.dqp-field-row {
    display: flex;
    gap: 10px;
}

.dqp-field-row .dqp-field {
    flex: 1;
}

@media (max-width: 480px) {
    .dqp-field-row {
        flex-direction: column;
        gap: 0;
    }
}

.dqp-field label {
    display: block;
    color: var(--dqp-navy);
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 4px !important;
    padding: 0 !important;
}

.dqp-field input[type="text"],
.dqp-field input[type="email"],
.dqp-field select,
.dqp-field textarea {
    width: 100%;
    border: 1px solid #d5dbe7;
    border-radius: 8px;
    padding: 7px 10px !important;
    margin: 0 !important;
    font-size: 14px;
    color: var(--dqp-navy);
    background: #fff;
    box-sizing: border-box;
    min-height: 0 !important;
    height: auto !important;
}

.dqp-field textarea {
    resize: vertical;
}

.dqp-field input:focus,
.dqp-field select:focus,
.dqp-field textarea:focus {
    outline: 2px solid var(--dqp-red);
    outline-offset: 0;
    border-color: var(--dqp-red);
}

.dqp-field-check {
    margin: 0 0 8px !important;
    padding: 0 !important;
}

.dqp-field + .dqp-field-check {
    margin-top: 4px !important;
}

.dqp-field-check label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.35 !important;
    cursor: pointer;
    margin: 0 !important;
}

.dqp-field-check input {
    margin: 2px 0 0 !important;
    flex-shrink: 0;
    accent-color: var(--dqp-red);
    width: auto !important;
}

.dqp-hp {
    position: absolute !important;
    left: -9999px !important;
    height: 0;
    overflow: hidden;
}

.dqp-form-error {
    color: var(--dqp-red);
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px !important;
}

.dqp-field-submit {
    margin: 12px 0 0 !important;
    padding: 0 !important;
}

.dqp-submit-btn {
    background: var(--dqp-red);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dqp-submit-btn:hover:not(:disabled) {
    background: var(--dqp-red-dark);
}

.dqp-submit-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.dqp-form-success p {
    color: var(--dqp-navy);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.dqp-privacy-note {
    color: var(--dqp-blue);
    font-size: 12px;
    line-height: 1.4 !important;
    margin: 8px 0 0 !important;
}

.dqp-privacy-note a {
    color: var(--dqp-blue);
    text-decoration: underline;
}

.dqp-privacy-note a:hover {
    color: var(--dqp-navy);
}
