/* ═══════════════════════════════════════════════════════════════════
   Mieux Donner – Fundraiser Registration Form
   Uses only .mdf-* classes to avoid any conflict with the theme.
═══════════════════════════════════════════════════════════════════ */

/* ── Wrapper ──────────────────────────────────────────────────────── */

.mdf-register-wrap {
    max-width: 720px;
    margin: 0 auto;
    font-family: inherit;
    color: #1a1a1a;
}

/* ── Section cards ────────────────────────────────────────────────── */

.mdf-section {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.mdf-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 24px;
    color: #1a1a1a;
}

.mdf-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2d7dd2;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.mdf-section-intro {
    margin: -12px 0 20px;
    color: #555;
    font-size: 0.95rem !important;
    line-height: 1.5;
}

/* ── Fields ───────────────────────────────────────────────────────── */

.mdf-field {
    margin-bottom: 20px;
}

.mdf-field:last-child {
    margin-bottom: 0;
}

.mdf-field label,
.mdf-label-block {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: #333;
}

.mdf-required {
    color: #c0392b;
    margin-left: 2px;
}

.mdf-field input[type="text"],
.mdf-field input[type="email"],
.mdf-field input[type="url"],
.mdf-field input[type="number"],
.mdf-field input[type="date"],
.mdf-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1a1a1a;
    background: #fafafa;
    transition: border-color 0.2s, background 0.15s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.mdf-field input:focus,
.mdf-field textarea:focus {
    outline: none;
    border-color: #2d7dd2;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.12);
}

.mdf-field textarea {
    resize: vertical;
    min-height: 90px;
}

.mdf-hint {
    margin: 5px 0 0;
    font-size: 0.84rem !important;
    color: #777;
    line-height: 1.4;
}

.mdf-char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #aaa;
    margin: 4px 0 0;
}

/* ── Photo upload zone ────────────────────────────────────────────── */

.mdf-upload-zone {
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafafa;
    user-select: none;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mdf-upload-zone:hover {
    border-color: #2d7dd2;
    background: #f0f6ff;
}

.mdf-upload-zone--drag {
    border-color: #2d7dd2;
    background: #e8f0fb;
}

.mdf-upload-zone--has-file {
    border-style: solid;
    border-color: #2d8a4e;
    background: #f5fff8;
}

/* Input invisible — déclenché via JS */
.mdf-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Placeholder */
.mdf-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.mdf-upload-placeholder svg {
    width: 40px;
    height: 40px;
    color: #bbb;
    margin-bottom: 4px;
}

.mdf-upload-placeholder span:not( .mdf-hint ) {
    font-weight: 600;
    font-size: 0.92rem;
    color: #555;
}

/* Prévisualisation */
.mdf-upload-preview {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mdf-upload-avatar {
    position: relative;
    display: inline-block;
}

.mdf-upload-avatar img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #2d8a4e;
    display: block;
}

.mdf-upload-remove {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate( 25%, -25% );
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #c0392b;
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
    z-index: 1;
}

.mdf-upload-remove:hover {
    background: #a93226;
}

.mdf-upload-change {
    font-size: 0.82rem;
    color: #2d7dd2;
    margin: 0;
    text-decoration: underline;
    pointer-events: none;
}

/* ── Cover image upload (paysage) ─────────────────────────────────── */

.mdf-upload-zone--cover {
    min-height: 160px;
    padding: 0;
    overflow: hidden;
}

.mdf-upload-zone--cover .mdf-upload-placeholder {
    min-height: 160px;
    padding: 24px;
}

.mdf-upload-preview--cover {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
}

.mdf-cover-thumb-wrap {
    position: relative;
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    border-radius: 8px;
}

.mdf-cover-thumb {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.mdf-cover-thumb-wrap .mdf-upload-remove {
    top: 6px;
    right: 6px;
}

/* ── Cover reframe controls ──────────────────────────────────────── */

.mdf-reframe {
    margin-top: 10px;
    background: #f5f7fb;
    border: 1px solid #d0d8e8;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mdf-reframe-preview {
    width: 100%;
    padding-bottom: 32%;
    background-size: cover;
    background-position: center center;
    background-color: #1a3a6b;
    border-radius: 6px;
    position: relative;
    transition: background-position 0.25s ease, background-size 0.25s ease;
}

.mdf-reframe-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mdf-reframe-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mdf-reframe-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    min-width: 58px;
    flex-shrink: 0;
}

.mdf-reframe-pos {
    display: flex;
    gap: 4px;
}

.mdf-reframe-btn {
    padding: 4px 14px;
    font-size: 0.8rem;
    font-family: inherit;
    border: 1px solid #c8d0e0;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: #555;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mdf-reframe-btn:hover {
    background: #e8eef8;
    border-color: #a0b0c8;
}

.mdf-reframe-btn--active {
    background: #1a3a6b;
    border-color: #1a3a6b;
    color: #fff;
}

.mdf-reframe-slider {
    flex: 1;
    accent-color: #1a3a6b;
    cursor: pointer;
    max-width: 200px;
}

.mdf-reframe-zoom-val {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    min-width: 38px;
    text-align: right;
}

/* ── 2D nudge position control ───────────────────────────────────── */

.mdf-reframe-nudge {
    display: grid;
    grid-template-areas:
        ". up ."
        "left . right"
        ". down .";
    grid-template-columns: 30px 30px 30px;
    grid-template-rows: 26px 26px 26px;
    gap: 2px;
}

.mdf-nudge-btn[data-axis="y"][data-step="-5"] { grid-area: up; }
.mdf-nudge-btn[data-axis="x"][data-step="-5"] { grid-area: left; }
.mdf-nudge-btn[data-axis="x"][data-step="5"]  { grid-area: right; }
.mdf-nudge-btn[data-axis="y"][data-step="5"]  { grid-area: down; }

.mdf-nudge-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.85rem;
    font-family: inherit;
    border: 1px solid #c8d0e0;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: #555;
    transition: background 0.12s, border-color 0.12s;
    user-select: none;
    line-height: 1;
}

.mdf-nudge-btn:hover {
    background: #e8eef8;
    border-color: #a0b0c8;
}

.mdf-nudge-btn:active {
    background: #1a3a6b;
    color: #fff;
    border-color: #1a3a6b;
}

/* ── Reframe remove button ───────────────────────────────────────── */

.mdf-reframe-remove {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8rem;
    color: #c0392b;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
    margin-top: 2px;
}

.mdf-reframe-remove:hover {
    color: #922b21;
}

/* ── Profile photo circle reframe ────────────────────────────────── */

.mdf-reframe-circle-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

.mdf-reframe-preview--circle {
    width: 100px;
    height: 100px;
    padding-bottom: 0;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #e0e0e0;
    background-color: #f0f0f0;
    background-size: cover;
}

/* ── Two-column row ───────────────────────────────────────────────── */

.mdf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mdf-field--half {
    max-width: 220px;
}

/* ── Slug field ───────────────────────────────────────────────────── */

.mdf-slug-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mdf-slug-wrap:focus-within {
    border-color: #2d7dd2;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.12);
}

.mdf-slug-base {
    padding: 10px 12px;
    background: #f0f0f0;
    color: #666;
    font-size: 0.82rem;
    white-space: nowrap;
    border-right: 1.5px solid #d0d0d0;
    flex-shrink: 0;
}

.mdf-slug-wrap input[type="text"] {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    flex: 1;
    padding: 10px 12px !important;
    font-size: 0.9rem !important;
    min-width: 0;
}

.mdf-slug-status {
    font-size: 0.85rem;
    margin: 6px 0 0;
    min-height: 18px;
    line-height: 1.4;
}

.mdf-slug-available { color: #2d8a4e; font-weight: 600; }
.mdf-slug-taken     { color: #c0392b; font-weight: 600; }
.mdf-slug-checking  { color: #888; }

/* ── Goal amount ──────────────────────────────────────────────────── */

.mdf-goal-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 10px;
}

.mdf-goal-preset {
    padding: 5px 13px;
    border: 1.5px solid #d0d0d0;
    border-radius: 20px;
    background: #f5f5f5;
    font-size: 0.83rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.4;
}

.mdf-goal-preset:hover {
    border-color: #2d7dd2;
    background: #f0f6ff;
    color: #2d7dd2;
}

.mdf-goal-preset--active {
    border-color: #2d7dd2;
    background: #2d7dd2;
    color: #fff;
}

.mdf-goal-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mdf-goal-wrap input {
    max-width: 260px;
}

.mdf-goal-currency {
    font-weight: 700;
    font-size: 1.1rem;
    color: #444;
}

/* ── Charity list ─────────────────────────────────────────────────── */

.mdf-charities {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mdf-charity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
    gap: 12px;
    flex-wrap: wrap;
}

/* Highlight selected row — works on modern browsers */
.mdf-charity-item:has(.mdf-charity-check:checked) {
    border-color: #2d7dd2;
    background: #f0f6ff;
}

.mdf-charity-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
    margin: 0 !important;
    font-weight: 500 !important;
    color: #1a1a1a;
}

.mdf-charity-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2d7dd2;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.mdf-charity-name {
    line-height: 1.3;
}

.mdf-charity-split {
    display: none;
    align-items: center;
    gap: 6px;
}

.mdf-split-input {
    width: 72px !important;
    padding: 6px 10px !important;
    border: 1.5px solid #d0d0d0 !important;
    border-radius: 6px !important;
    font-size: 0.9rem !important;
    text-align: center;
    font-weight: 600;
}

.mdf-split-pct {
    font-weight: 700;
    color: #555;
    font-size: 0.9rem;
}

/* Split total bar */
.mdf-split-total {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #f5f5f5;
    font-size: 0.92rem;
    border: 1px solid #e8e8e8;
}

.mdf-split-ok  { color: #2d8a4e; font-weight: 700; }
.mdf-split-err { color: #c0392b; font-size: 0.85rem; }

/* ── Charity mode cards ───────────────────────────────────────────── */

.mdf-mode-cards {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.mdf-mode-card {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: #fafafa;
    margin: 0 !important;
    font-weight: 400 !important;
}

.mdf-mode-card input[type="radio"] {
    display: none; /* hidden — visual state via border */
}

.mdf-mode-card strong {
    font-size: 0.97rem;
    color: #1a1a1a;
}

.mdf-mode-card small {
    font-size: 0.83rem;
    color: #666;
    line-height: 1.4;
}

.mdf-mode-card--active,
.mdf-mode-card:has(input:checked) {
    border-color: #2d7dd2;
    background: #f0f6ff;
}

.mdf-mode-card:hover {
    border-color: #2d7dd2;
}

@media ( max-width: 540px ) {
    .mdf-mode-cards { flex-direction: column; }
}

/* ── Radio group ──────────────────────────────────────────────────── */

.mdf-radio-group {
    display: flex;
    gap: 24px;
    margin-top: 6px;
}

.mdf-radio-group label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500 !important;
    margin: 0 !important;
    color: #333;
}

.mdf-radio-group input[type="radio"] {
    accent-color: #2d7dd2;
    width: 17px;
    height: 17px;
    cursor: pointer;
}

/* ── Consent checkbox ─────────────────────────────────────────────── */

.mdf-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 400 !important;
    color: #444;
    line-height: 1.5;
}

.mdf-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2d7dd2;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.mdf-checkbox-label a {
    color: #2d7dd2;
    text-decoration: underline;
}

/* ── Submit area ──────────────────────────────────────────────────── */

.mdf-submit-wrap {
    text-align: center;
    margin-top: 8px;
    padding: 0 4px;
}

.mdf-form-error {
    background: #fdf0f0;
    border: 1px solid #e8b4b4;
    border-radius: 8px;
    padding: 12px 16px;
    color: #c0392b;
    font-size: 0.95rem;
    margin-bottom: 16px;
    text-align: left;
    line-height: 1.5;
}

.mdf-btn-submit {
    display: inline-block;
    background: #2d7dd2;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 14px 40px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none !important;
    line-height: 1.3;
    font-family: inherit;
}

.mdf-btn-submit:hover {
    background: #1f5ea8;
    color: #fff !important;
}

.mdf-btn-submit:active {
    transform: scale( 0.98 );
}

.mdf-btn-submit:disabled {
    background: #a0b8d4;
    cursor: not-allowed;
    transform: none;
}

.mdf-btn-secondary {
    display: inline-block;
    background: transparent;
    color: #2d7dd2;
    border: 2px solid #2d7dd2;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.mdf-btn-secondary:hover {
    background: #f0f6ff;
}

/* ── Success state ────────────────────────────────────────────────── */

.mdf-success {
    text-align: center;
    padding: 48px 32px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
}

.mdf-success-icon {
    width: 64px;
    height: 64px;
    background: #2d8a4e;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 20px;
}

.mdf-success h2 {
    font-size: 1.5rem;
    margin: 0 0 12px;
    color: #1a1a1a;
}

.mdf-success p {
    color: #555;
    margin: 0 0 4px;
}

.mdf-success-url {
    display: inline-block;
    margin: 4px 0 28px;
    font-size: 1rem;
    color: #2d7dd2;
    word-break: break-all;
    font-weight: 700;
    text-decoration: underline;
}

.mdf-success-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.mdf-success-hint {
    font-size: 0.88rem;
    color: #888;
    margin: 0;
}

/* ── No-tax badge ─────────────────────────────────────────────────── */

.mdf-no-tax {
    font-size: 0.78rem;
    color: #888;
    font-weight: 400;
}

/* ── Mobile ───────────────────────────────────────────────────────── */

@media ( max-width: 600px ) {
    /* Break out of Elementor's container padding so sections go truly edge-to-edge */
    .mdf-register-wrap {
        padding: 0;
        width: 100vw;
        max-width: 100vw;
        position: relative;
        left: 50%;
        transform: translateX( -50% );
    }

    .mdf-section {
        padding: 20px 16px;
        border-radius: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .mdf-row {
        grid-template-columns: 1fr;
    }

    .mdf-field--half {
        max-width: 100%;
    }

    .mdf-charity-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .mdf-charity-split {
        padding-left: 28px;
    }

    .mdf-success {
        padding: 32px 16px;
    }

    .mdf-success-actions {
        flex-direction: column;
    }

    .mdf-btn-submit,
    .mdf-btn-secondary {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .mdf-slug-base {
        display: none; /* Too long on small screens — URL still works */
    }

    /* Goal amount input + currency: stack vertically on narrow screens */
    .mdf-goal-wrap {
        flex-wrap: wrap;
    }

    .mdf-goal-wrap input {
        max-width: 100%;
        flex: 1;
        min-width: 0;
    }
}
