/* =========================================================
   FEEDBACK — APPLICATION MOBILE
   Harmonisé avec mobile-app.css
   resources/assets/mobile/css/mobile-feedback.css
   ========================================================= */

.mobile-feedback-page {
    min-height: 100vh;
    min-height: 100dvh;

    background:
        radial-gradient(
            circle at top left,
            rgba(22, 163, 145, 0.14),
            transparent 32%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(255, 196, 84, 0.12),
            transparent 30%
        ),
        var(--mobile-background, #f3f6f5);

    color: var(--mobile-text, #152421);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 16px;
    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
}

.mobile-feedback-page *,
.mobile-feedback-page *::before,
.mobile-feedback-page *::after {
    box-sizing: border-box;
}

.mobile-feedback-page button,
.mobile-feedback-page input,
.mobile-feedback-page textarea,
.mobile-feedback-page select {
    font: inherit;
}

/* =========================================================
   CONTENEUR PRINCIPAL
   ========================================================= */

.feedback-wrap {
    width: 100%;
    max-width: 760px;

    margin: 0 auto;

    padding:
        20px
        16px
        calc(var(--mobile-bottom-nav-height, 76px) + 36px);
}

/* =========================================================
   EN-TÊTE
   Même échelle que .mobile-page-heading
   ========================================================= */

.feedback-header {
    padding: 21px;
     margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--mobile-border, #dfe8e5);
    border-radius: var(--mobile-radius-lg, 28px);
    background: var(--mobile-surface, #ffffff);
    box-shadow:
        var(--mobile-shadow-sm, 0 4px 15px rgba(20, 51, 45, 0.06));
}

.feedback-header-icon {
    width: 52px;
    height: 52px;

    flex: 0 0 52px;

    display: grid;
    place-items: center;
    border-radius: 20px;

    background:
        var(--mobile-primary, #063f38);

    color: #ffffff;
    font-size: 1.5rem;

    box-shadow:
        0 10px 25px rgba(6, 63, 56, 0.20);
}

.feedback-header > div:last-child {
    min-width: 0;
}

.feedback-header h1 {
    margin: 0;

    color: var(--mobile-text, #152421);
    font-size: 1.35rem;
    font-weight: 850;
    line-height: 1.15;

    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

.feedback-header p {
    margin: 6px 0 0;

    color: var(--mobile-text-soft, #64736f);
    font-size: 0.84rem;
    line-height: 1.5;
}

/* =========================================================
   FORMULAIRE
   ========================================================= */

.feedback-form {
    margin-top: 16px;

    display: grid;
    gap: 16px;
}

.feedback-section {
    padding: 18px;

    border: 1px solid var(--mobile-border, #dfe8e5);
    border-radius: var(--mobile-radius, 20px);

    background: var(--mobile-surface, #ffffff);

    box-shadow:
        var(--mobile-shadow-sm, 0 4px 15px rgba(20, 51, 45, 0.06));
}

/* =========================================================
   TITRES DES ÉTAPES
   ========================================================= */

.feedback-section-title {
    margin-bottom: 16px;

    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.feedback-step {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--mobile-primary-light, #e6f5f1);

    color: var(--mobile-primary, #063f38);
    font-size: 0.82rem;
    font-weight: 850;
}

.feedback-section-title > div {
    min-width: 0;
}

.feedback-section-title h2 {
    margin: 0;

    color: var(--mobile-text, #152421);
    font-size: 1.05rem;
    font-weight: 830;
    line-height: 1.25;

    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.feedback-section-title p {
    margin: 5px 0 0;

    color: var(--mobile-text-soft, #64736f);
    font-size: 0.78rem;
    line-height: 1.45;
}

/* =========================================================
   TYPES DE RETOUR
   ========================================================= */

.feedback-types {
    display: grid;
    grid-template-columns: 1fr;
    gap: 11px;
}

.feedback-type-card {
    display: block;
    margin: 0;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.feedback-type-card input,
.feedback-rating input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}

.feedback-type-content {
    position: relative;

    min-height: 78px;

    padding: 13px 44px 13px 13px;

    display: flex;
    align-items: center;
    gap: 13px;

    border: 2px solid transparent;
    border-radius: 18px;

    background: var(--mobile-surface-soft, #f8faf9);

    transition:
        transform var(--mobile-transition, 160ms ease),
        border-color var(--mobile-transition, 160ms ease),
        background var(--mobile-transition, 160ms ease),
        box-shadow var(--mobile-transition, 160ms ease);
}

[dir="rtl"] .feedback-type-content {
    padding-right: 13px;
    padding-left: 44px;
}

.feedback-type-card:active .feedback-type-content {
    transform: scale(0.985);
}

.feedback-type-card input:focus-visible + .feedback-type-content {
    outline: 3px solid rgba(6, 63, 56, 0.18);
    outline-offset: 2px;
}

.feedback-type-card input:checked + .feedback-type-content {
    border-color: var(--mobile-primary, #063f38);
    background: var(--mobile-primary-light, #e6f5f1);

    box-shadow:
        0 8px 20px rgba(6, 63, 56, 0.11);
}

.feedback-type-icon {
    width: 46px;
    height: 46px;

    flex: 0 0 46px;

    display: grid;
    place-items: center;

    border-radius: 15px;

    font-size: 1.15rem;
}

.satisfaction-icon {
    color: #9b6504;
    background: #fff0c4;
}

.problem-icon {
    color: #b74336;
    background: #ffe3df;
}

.suggestion-icon {
    color: #7756af;
    background: #eee5ff;
}

.feedback-type-text {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.feedback-type-text strong {
    color: var(--mobile-text, #152421);
    font-size: 0.91rem;
    font-weight: 780;
    line-height: 1.25;
}

.feedback-type-text small {
    margin-top: 3px;

    color: var(--mobile-text-soft, #64736f);
    font-size: 0.75rem;
    line-height: 1.35;
}

.feedback-check {
    position: absolute;
    top: 50%;
    right: 13px;

    width: 24px;
    height: 24px;

    display: grid;
    place-items: center;

    transform: translateY(-50%) scale(0.7);

    border-radius: 50%;

    background: var(--mobile-primary, #063f38);

    color: #ffffff;
    font-size: 0.68rem;

    opacity: 0;

    transition:
        opacity var(--mobile-transition, 160ms ease),
        transform var(--mobile-transition, 160ms ease);
}

[dir="rtl"] .feedback-check {
    right: auto;
    left: 13px;
}

.feedback-type-card input:checked
    + .feedback-type-content
    .feedback-check {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* =========================================================
   ÉVALUATIONS
   ========================================================= */

.feedback-ratings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.feedback-rating {
    display: block;
    margin: 0;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.feedback-rating-content {
    min-height: 104px;
    height: 100%;

    padding: 12px 8px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border: 2px solid transparent;
    border-radius: 18px;

    background: var(--mobile-surface-soft, #f8faf9);

    text-align: center;

    transition:
        transform var(--mobile-transition, 160ms ease),
        border-color var(--mobile-transition, 160ms ease),
        background var(--mobile-transition, 160ms ease),
        box-shadow var(--mobile-transition, 160ms ease);
}

.feedback-rating:active .feedback-rating-content {
    transform: scale(0.97);
}

.feedback-rating input:focus-visible + .feedback-rating-content {
    outline: 3px solid rgba(6, 63, 56, 0.18);
    outline-offset: 2px;
}

.feedback-rating input:checked + .feedback-rating-content {
    border-color: var(--mobile-primary, #063f38);
    background: var(--mobile-primary-light, #e6f5f1);

    box-shadow:
        0 8px 18px rgba(6, 63, 56, 0.11);
}

.feedback-emoji {
    font-size: 2rem;
    line-height: 1;
}

.feedback-rating strong {
    color: var(--mobile-text, #152421);
    font-size: 0.85rem;
    font-weight: 760;
    line-height: 1.2;
}

/* =========================================================
   CHAMPS
   ========================================================= */

.feedback-field {
    position: relative;
    min-width: 0;
}

.feedback-field label {
    display: block;

    margin-bottom: 7px;

    color: var(--mobile-text, #152421);
    font-size: 0.84rem;
    font-weight: 760;
}

.feedback-field textarea,
.feedback-field input {
    width: 100%;
    max-width: 100%;

    border: 1px solid var(--mobile-border, #dfe8e5);
    border-radius: 16px;

    background: var(--mobile-surface-soft, #f8faf9);

    color: var(--mobile-text, #152421);
    font-family: inherit;
    font-size: 1rem;

    outline: none;
    appearance: none;
    -webkit-appearance: none;

    transition:
        border-color var(--mobile-transition, 160ms ease),
        box-shadow var(--mobile-transition, 160ms ease),
        background var(--mobile-transition, 160ms ease);
}

/*
 * 16 px minimum pour éviter le zoom automatique d’iOS.
 */
.feedback-field textarea {
    min-height: 138px;

    padding: 15px 15px 36px;

    resize: vertical;
    line-height: 1.5;
}

.feedback-field input {
    min-height: 52px;
    padding: 0 15px;
}

.feedback-field textarea::placeholder,
.feedback-field input::placeholder {
    color: #8a9b97;
    opacity: 1;
}

.feedback-field textarea:focus,
.feedback-field input:focus {
    border-color: var(--mobile-primary, #063f38);
    background: #ffffff;

    box-shadow:
        0 0 0 4px rgba(6, 63, 56, 0.09);
}

.feedback-character-count {
    position: absolute;
    right: 13px;
    bottom: 10px;

    color: var(--mobile-text-soft, #64736f);
    font-size: 0.72rem;
    font-weight: 700;

    pointer-events: none;
}

[dir="rtl"] .feedback-character-count {
    right: auto;
    left: 13px;
}

/* =========================================================
   COORDONNÉES FACULTATIVES
   ========================================================= */

.feedback-contact-details {
    overflow: hidden;

    border: 1px solid var(--mobile-border, #dfe8e5);
    border-radius: var(--mobile-radius, 20px);

    background: var(--mobile-surface, #ffffff);

    box-shadow:
        var(--mobile-shadow-sm, 0 4px 15px rgba(20, 51, 45, 0.06));
}

.feedback-contact-details summary {
    min-height: 64px;

    padding: 15px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    list-style: none;

    color: var(--mobile-text, #152421);
    font-size: 0.84rem;
    font-weight: 800;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.feedback-contact-details summary::-webkit-details-marker {
    display: none;
}

.feedback-contact-details summary::after {
    flex: 0 0 auto;

    color: var(--mobile-primary, #063f38);
    font-family: "bootstrap-icons";
    font-size: 0.75rem;

    content: "\F282";

    transition:
        transform var(--mobile-transition, 160ms ease);
}

.feedback-contact-details[open] summary::after {
    transform: rotate(180deg);
}

.feedback-contact-details summary span {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 9px;
}

.feedback-contact-details summary i {
    flex: 0 0 auto;

    color: var(--mobile-primary, #063f38);
    font-size: 1rem;
    line-height: 1;
}

.feedback-contact-details summary small {
    flex: 0 0 auto;

    padding: 5px 8px;

    border-radius: 999px;

    background: var(--mobile-primary-light, #e6f5f1);

    color: var(--mobile-text-soft, #64736f);
    font-size: 0.67rem;
    font-weight: 700;
}

.feedback-contact-grid {
    padding: 0 15px 17px;

    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

/* =========================================================
   BOUTONS
   Même échelle que .mobile-primary-button
   ========================================================= */

.feedback-actions {
    padding-bottom: env(safe-area-inset-bottom);

    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}

.feedback-button {
    width: 100%;
    min-width: 0;
    min-height: 52px;

    padding: 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border-radius: 17px;

    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
    text-decoration: none;

    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;

    transition:
        transform var(--mobile-transition, 160ms ease),
        box-shadow var(--mobile-transition, 160ms ease),
        opacity var(--mobile-transition, 160ms ease);
}

.feedback-button i {
    font-size: 1rem;
    line-height: 1;
}

.feedback-button:active {
    transform: scale(0.985);
}

.feedback-button-secondary {
    border: 1px solid var(--mobile-border, #dfe8e5);

    background: var(--mobile-surface, #ffffff);

    color: var(--mobile-primary, #063f38);
}

.feedback-button-primary {
    border: 0;

    background: var(--mobile-primary, #063f38);

    box-shadow:
        0 10px 25px rgba(6, 63, 56, 0.20);

    color: #ffffff;
}

.feedback-button:focus-visible {
    outline: 3px solid rgba(6, 63, 56, 0.20);
    outline-offset: 2px;
}

.feedback-button:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

/* =========================================================
   ERREURS
   ========================================================= */

.feedback-alert {
    margin-bottom: 16px;
    padding: 13px 14px;

    display: flex;
    align-items: flex-start;
    gap: 10px;

    border: 1px solid rgba(185, 54, 54, 0.18);
    border-radius: 16px;

    background: #fff0f0;

    box-shadow:
        var(--mobile-shadow-sm, 0 4px 15px rgba(20, 51, 45, 0.06));

    color: var(--mobile-danger, #b93636);
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.45;
}

.feedback-alert i {
    flex: 0 0 auto;

    margin-top: 2px;

    font-size: 1rem;
    line-height: 1;
}

.feedback-alert p {
    margin: 0 0 4px;
}

.feedback-alert p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   CONFIRMATION
   ========================================================= */

.feedback-success {
    width: 100%;

    margin: 22px auto;
    padding: 34px 20px;

    border: 1px solid var(--mobile-border, #dfe8e5);
    border-radius: var(--mobile-radius-lg, 28px);

    background: var(--mobile-surface, #ffffff);

    box-shadow:
        var(--mobile-shadow, 0 12px 35px rgba(20, 51, 45, 0.10));

    text-align: center;
}

.feedback-success-icon {
    width: 62px;
    height: 62px;

    margin: 0 auto 19px;

    display: grid;
    place-items: center;

    border-radius: 20px;

    background: var(--mobile-primary, #063f38);

    box-shadow:
        0 10px 25px rgba(6, 63, 56, 0.20);

    color: #ffffff;
    font-size: 1.7rem;
}

.feedback-success h2 {
    margin: 0;

    color: var(--mobile-text, #152421);
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1.2;

    letter-spacing: -0.03em;
}

.feedback-success > p {
    max-width: 520px;

    margin: 11px auto 14px;

    color: var(--mobile-text-soft, #64736f);
    font-size: 0.84rem;
    line-height: 1.55;
}

.feedback-countdown {
    color: var(--mobile-text-soft, #64736f);
    font-size: 0.78rem;
}

.feedback-countdown strong {
    color: var(--mobile-primary, #063f38);
    font-size: 1rem;
}

.feedback-home-button {
    width: 100%;
    min-height: 52px;

    margin-top: 10px;
    padding: 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border-radius: 17px;

    background: var(--mobile-primary, #063f38);

    box-shadow:
        0 10px 25px rgba(6, 63, 56, 0.20);

    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
}

.feedback-home-button i {
    font-size: 1rem;
    line-height: 1;
}

/* =========================================================
   ANTI-SPAM
   ========================================================= */

.feedback-honeypot {
    position: fixed;
    top: -10000px;
    left: -10000px;

    width: 1px;
    height: 1px;

    overflow: hidden;
}

/* =========================================================
   TABLETTES
   ========================================================= */

@media (min-width: 620px) {
    .feedback-wrap {
        padding-right: 22px;
        padding-left: 22px;
    }

    .feedback-section {
        padding: 21px;
    }

    .feedback-contact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feedback-actions {
        flex-direction: row;
    }

    .feedback-button-secondary {
        width: 38%;
    }

    .feedback-button-primary {
        width: 62%;
    }
}

/* =========================================================
   TRÈS PETITS ÉCRANS
   ========================================================= */

@media (max-width: 370px) {
    .feedback-wrap {
        padding-right: 12px;
        padding-left: 12px;
    }

    .feedback-header {
        padding: 17px;
        gap: 12px;
    }

    .feedback-header-icon {
        width: 52px;
        height: 52px;
        flex-basis: 52px;

        border-radius: 17px;

        font-size: 1.45rem;
    }

    .feedback-header h1 {
        font-size: 1.2rem;
    }

    .feedback-section {
        padding-right: 14px;
        padding-left: 14px;
    }

    .feedback-ratings {
        gap: 8px;
    }

    .feedback-rating-content {
        min-height: 98px;
        padding-right: 5px;
        padding-left: 5px;
    }

    .feedback-emoji {
        font-size: 1.8rem;
    }

    .feedback-rating strong {
        font-size: 0.78rem;
    }

    .feedback-contact-details summary {
        font-size: 0.8rem;
    }
}

/* =========================================================
   ACCESSIBILITÉ
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .feedback-type-content,
    .feedback-rating-content,
    .feedback-check,
    .feedback-button,
    .feedback-contact-details summary::after {
        transition: none;
    }
}