/* =========================================================================
   DIMO Booking — Styles
   Primary: #0284c7   WhatsApp: #25D366
   ========================================================================= */

:root {
    --dimo-primary:    #0284c7;
    --dimo-primary-d:  #0369a1;
    --dimo-wa:         #25D366;
    --dimo-wa-d:       #1ebe5d;
    --dimo-text:       #1e293b;
    --dimo-muted:      #64748b;
    --dimo-border:     #e2e8f0;
    --dimo-surface:    #f8fafc;
    --dimo-radius:     10px;
    --dimo-shadow:     0 2px 12px rgba(0,0,0,.08);
}

/* Utility */
.dimo-hidden { display: none !important; }

/* -------------------------------------------------------------------------
   RDV App wrapper
   ---------------------------------------------------------------------- */
.dimo-rdv-app {
    font-family: inherit;
    color: var(--dimo-text);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

/* -------------------------------------------------------------------------
   Hero
   ---------------------------------------------------------------------- */
.dimo-hero {
    background: linear-gradient(135deg, var(--dimo-primary) 0%, #0ea5e9 100%);
    border-radius: var(--dimo-radius);
    padding: 40px 24px;
    text-align: center;
    color: #fff;
    margin-bottom: 28px;
}
.dimo-hero__title {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.25;
}
.dimo-hero__sub {
    font-size: 15px;
    opacity: .88;
    margin: 0 0 24px;
}
.dimo-hero__search {
    display: flex;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto;
}
.dimo-hero__search input {
    flex: 1;
    padding: 13px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    min-width: 0;
}
.dimo-hero__search input:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,.4);
}
#dimo-search-btn {
    padding: 13px 22px;
    background: #fff;
    color: var(--dimo-primary);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
#dimo-search-btn:hover { background: #e0f2fe; }

/* -------------------------------------------------------------------------
   Controls: tabs + filters
   ---------------------------------------------------------------------- */
.dimo-controls {
    margin-bottom: 24px;
}
.dimo-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.dimo-tab {
    padding: 9px 20px;
    border: 2px solid var(--dimo-border);
    border-radius: 50px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    color: var(--dimo-muted);
}
.dimo-tab.active,
.dimo-tab:hover {
    border-color: var(--dimo-primary);
    color: var(--dimo-primary);
    background: #e0f2fe;
}
.dimo-tab.active {
    background: var(--dimo-primary);
    color: #fff;
}
.dimo-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.dimo-select {
    padding: 8px 12px;
    border: 1px solid var(--dimo-border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: var(--dimo-text);
    cursor: pointer;
    min-width: 180px;
    outline: none;
}
.dimo-select:focus {
    border-color: var(--dimo-primary);
    box-shadow: 0 0 0 2px rgba(2,132,199,.15);
}

/* -------------------------------------------------------------------------
   Card grid
   ---------------------------------------------------------------------- */
.dimo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.dimo-loading {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: var(--dimo-muted);
    font-size: 15px;
}
.dimo-no-results {
    grid-column: 1/-1;
    text-align: center;
    padding: 48px;
    color: var(--dimo-muted);
}
.dimo-no-results h3 { margin: 0 0 8px; font-size: 18px; }

/* Card */
.dimo-card {
    background: #fff;
    border: 1px solid var(--dimo-border);
    border-radius: var(--dimo-radius);
    padding: 20px;
    box-shadow: var(--dimo-shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .15s, box-shadow .15s;
}
.dimo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.dimo-card__head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.dimo-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--dimo-surface);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 2px solid var(--dimo-border);
}
.dimo-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dimo-card__info { flex: 1; min-width: 0; }
.dimo-card__name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 3px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dimo-card__titre {
    font-size: 12px;
    color: var(--dimo-primary);
    font-weight: 600;
    margin: 0 0 4px;
}
.dimo-card__detail {
    font-size: 13px;
    color: var(--dimo-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dimo-card__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dimo-card__meta-item {
    font-size: 13px;
    color: var(--dimo-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.dimo-card__actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

/* -------------------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------------- */
.dimo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background .15s, transform .1s;
    width: 100%;
}
.dimo-btn:active { transform: scale(.98); }
.dimo-btn--primary {
    background: var(--dimo-primary);
    color: #fff;
}
.dimo-btn--primary:hover { background: var(--dimo-primary-d); }
.dimo-btn--wa {
    background: var(--dimo-wa);
    color: #fff;
}
.dimo-btn--wa:hover { background: var(--dimo-wa-d); }
.dimo-btn--outline {
    background: #fff;
    color: var(--dimo-primary);
    border: 2px solid var(--dimo-primary);
}
.dimo-btn--outline:hover { background: #e0f2fe; }

/* -------------------------------------------------------------------------
   Pagination
   ---------------------------------------------------------------------- */
.dimo-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
}
.dimo-page-btn {
    padding: 8px 14px;
    border: 1px solid var(--dimo-border);
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
    color: var(--dimo-text);
}
.dimo-page-btn:hover,
.dimo-page-btn.active {
    background: var(--dimo-primary);
    color: #fff;
    border-color: var(--dimo-primary);
}

/* -------------------------------------------------------------------------
   Modal
   ---------------------------------------------------------------------- */
.dimo-modal-overlay {
    display: none;  /* Caché par défaut — JS ouvre avec display:flex */
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(2px);
    animation: dimo-fade-in .2s ease;
}
@media (min-width: 600px) {
    .dimo-modal-overlay {
        align-items: center;
        padding: 16px;
    }
}
@keyframes dimo-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.dimo-modal {
    background: #fff;
    width: 100%;
    max-width: 520px;
    border-radius: 16px 16px 0 0;
    padding: 24px 20px 32px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: dimo-slide-up .25s ease;
}
@media (min-width: 600px) {
    .dimo-modal {
        border-radius: 16px;
        padding: 32px;
    }
}
@keyframes dimo-slide-up {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.dimo-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--dimo-surface);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dimo-muted);
    transition: background .15s;
}
.dimo-modal__close:hover { background: var(--dimo-border); }

.dimo-modal__header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 20px;
}
.dimo-modal__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--dimo-surface);
    border: 2px solid var(--dimo-border);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.dimo-modal__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dimo-modal__title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px;
}
.dimo-modal__detail {
    font-size: 13px;
    color: var(--dimo-primary);
    font-weight: 600;
    margin: 0 0 2px;
}
.dimo-modal__city {
    font-size: 13px;
    color: var(--dimo-muted);
    margin: 0;
}

.dimo-modal__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--dimo-muted);
    font-size: 13px;
}
.dimo-modal__divider::before,
.dimo-modal__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--dimo-border);
}

/* Form fields */
.dimo-field {
    margin-bottom: 16px;
}
.dimo-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dimo-text);
}
.dimo-field label span { color: var(--dimo-primary); }
.dimo-field input[type="text"],
.dimo-field input[type="tel"],
.dimo-field input[type="email"],
.dimo-field select,
.dimo-field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--dimo-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--dimo-text);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.dimo-field input:focus,
.dimo-field select:focus,
.dimo-field textarea:focus {
    border-color: var(--dimo-primary);
    box-shadow: 0 0 0 3px rgba(2,132,199,.12);
}
.dimo-field input.dimo-invalid,
.dimo-field textarea.dimo-invalid {
    border-color: #ef4444;
}
/* Téléphone : la bordure visible est sur le wrapper (l'input a border:none) → on colore le wrapper. */
.dimo-phone-wrap.dimo-invalid {
    border-color: #ef4444;
}
/* Bouton en cours d'envoi (anti double-clic). */
.dimo-btn.dimo-disabled {
    opacity: .6;
    cursor: not-allowed;
}
.dimo-field textarea { resize: vertical; }

.dimo-phone-wrap {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--dimo-border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.dimo-phone-wrap:focus-within {
    border-color: var(--dimo-primary);
    box-shadow: 0 0 0 3px rgba(2,132,199,.12);
}
.dimo-phone-prefix {
    padding: 11px 12px;
    background: var(--dimo-surface);
    font-size: 14px;
    font-weight: 600;
    border-right: 1px solid var(--dimo-border);
    white-space: nowrap;
    color: var(--dimo-text);
}
.dimo-phone-wrap input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    flex: 1;
}

/* Date chips */
.dimo-date-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.dimo-chip {
    padding: 7px 14px;
    border: 1.5px solid var(--dimo-border);
    border-radius: 50px;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    user-select: none;
    background: #fff;
    color: var(--dimo-text);
}
.dimo-chip:hover { border-color: var(--dimo-primary); color: var(--dimo-primary); }
.dimo-chip.selected {
    background: var(--dimo-primary);
    color: #fff;
    border-color: var(--dimo-primary);
}
.dimo-chip--flexible {
    background: #f0fdf4;
    border-color: var(--dimo-wa);
    color: #166534;
}
.dimo-chip--flexible.selected {
    background: var(--dimo-wa);
    color: #fff;
    border-color: var(--dimo-wa);
}

/* Form messages */
.dimo-form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
.dimo-form-message--success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.dimo-form-message--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Success state */
.dimo-form-success {
    text-align: center;
    padding: 24px;
}
.dimo-form-success__icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.dimo-form-success h3 {
    font-size: 18px;
    margin: 0 0 8px;
    color: #166534;
}
.dimo-form-success p {
    font-size: 14px;
    color: var(--dimo-muted);
    margin: 0;
}

/* Note d'aide form-first sous le bouton WhatsApp */
.dimo-wa-hint{display:flex;gap:8px;align-items:flex-start;margin:10px 2px 0;padding:10px 12px;font-size:.85rem;line-height:1.45;color:#1e3a5f;background:#eff6ff;border:1px solid #dbeafe;border-radius:10px;}
.dimo-wa-hint__ico{flex:0 0 auto;}
.dimo-wa-hint strong{color:#0b3b8c;}
.dimo-wa-hint--alert{color:#9a3412;background:#fff7ed;border-color:#fed7aa;animation:dimoWaPulse 1.2s ease;}
@keyframes dimoWaPulse{0%{box-shadow:0 0 0 0 rgba(234,88,12,.40);}70%{box-shadow:0 0 0 8px rgba(234,88,12,0);}100%{box-shadow:0 0 0 0 rgba(234,88,12,0);}}

/* ── Bloc découverte compte patient (v1.2.0) ── */
.dimo-discover{margin-top:18px;padding:16px;background:#f0fdfa;border:1px solid #99f6e4;border-radius:12px;text-align:left}
.dimo-discover h4{margin:0 0 8px;font-size:15px;color:#0f766e}
.dimo-discover ul{margin:0 0 12px;padding-left:18px;color:#374151;font-size:13.5px;line-height:1.5}
.dimo-discover ul li{margin:2px 0}
.dimo-discover-btn{display:block;text-align:center;background:#0f766e;color:#fff!important;font-weight:600;padding:11px 16px;border-radius:8px;text-decoration:none!important;font-size:14.5px;cursor:pointer}
.dimo-discover-btn:hover{background:#0b5a54}
.dimo-discover-note{display:block;text-align:center;margin-top:6px;font-size:11.5px;color:#6b7280}
