:root {
    --primary: #38bdf8;
    --primary-dark: #0ea5e9;
    --primary-deep: #0284c7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

nav { position: relative; z-index: 9999 !important; }

/* ── PARTICULES BACKGROUND ── */
.medical-particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.particle { position: absolute; font-size: 1.5rem; color: rgba(56,189,248,.45); animation: float 20s infinite; }
@keyframes float {
    0%,100%{ transform:translateY(0) rotate(0deg); opacity:0; }
    10%{ opacity:.3; } 90%{ opacity:.3; }
    100%{ transform:translateY(-100vh) rotate(360deg); opacity:0; }
}

/* ── HERO ── */
.specialty-hero { background: linear-gradient(to right, var(--primary), var(--primary-dark)); padding: 3rem 0; position: relative; overflow: hidden; z-index: 1; }
.section-particles { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; opacity: .30; }
.section-particles .section-particle { position: absolute; color: rgba(255,255,255,1); animation: floatSection 7s ease-in-out infinite; }
@keyframes floatSection { 0%,100%{transform:translateY(0) rotate(0deg);opacity:.2} 50%{transform:translateY(-18px) rotate(6deg);opacity:.6} }

/* ── BARRE DE RECHERCHE ── */
.search-bar-section { background: white; padding: 20px 16px; border-bottom: 1px solid #e2e8f0; position: relative; z-index: 10; box-shadow: 0 2px 12px rgba(56,189,248,.1); }
.search-bar-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 16px; padding: 12px 16px; transition: border-color .2s; }
.search-bar-card:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
.search-input-wrap { display: flex; align-items: center; gap: 10px; flex: 2; min-width: 200px; }
.search-icon { color: var(--primary-dark); font-size: .95rem; flex-shrink: 0; }
.search-input-wrap input { border: none; background: none; outline: none; font-size: .9rem; font-family: 'Poppins', sans-serif; color: #1e293b; width: 100%; }
.search-input-wrap input::placeholder { color: #94a3b8; }
.search-select-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 160px; border-left: 1px solid #e2e8f0; padding-left: 12px; }
.select-icon { color: var(--primary-dark); font-size: .85rem; flex-shrink: 0; }
.search-select-wrap select { border: none; background: none; outline: none; font-size: .88rem; font-family: inherit; color: #1e293b; cursor: pointer; flex: 1; }
.search-btn { background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: white; border: none; border-radius: 10px; padding: 10px 20px; font-size: .88rem; font-weight: 700; font-family: inherit; cursor: pointer; display: flex; align-items: center; gap: 7px; transition: all .25s; white-space: nowrap; }
.search-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(56,189,248,.35); }

/* ── CARTES SPÉCIALITÉS ── */
.specialty-card { position: relative; background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.08); overflow: hidden; cursor: pointer; transition: all .3s ease; border: 2px solid transparent; }
.specialty-card:hover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(56,189,248,.18); border-color: var(--primary); }
.specialty-card.active { border-color: var(--primary); background: linear-gradient(135deg,#f0f9ff,#fff); }
.specialty-card .icon-container { width: 100%; height: 160px; display: flex; align-items: center; justify-content: center; position: relative; }
.specialty-card .icon-container i { font-size: 4rem; color: white; transition: transform .3s ease; }
.specialty-card:hover .icon-container i { transform: scale(1.1); }
.specialty-card .specialty-name { padding: 1.2rem; text-align: center; font-size: 1rem; font-weight: 700; color: #1f2937; }
.specialty-card .specialty-count { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.95); color: var(--primary-deep); padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 700; box-shadow: 0 2px 4px rgba(0,0,0,.1); }

/* ── CARTES MÉDECINS ── */
.doctor-card { background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.08); overflow: hidden; transition: all .3s ease; }
.doctor-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,.1); }
.doctor-card .doctor-image { position: relative; padding-bottom: 65%; overflow: hidden; background: linear-gradient(135deg,#e0f2fe,#bae6fd); }
.doctor-card .doctor-image img { position: absolute; top:0; left:0; width:100%; height:100%; object-fit: cover; }
.doctor-card .doctor-image .no-photo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4rem; color: #7dd3fc; }
.doctor-card .doctor-info { padding: 1.5rem; }
.doctor-card .specialty-badge { display: inline-flex; align-items: center; padding: .35rem .75rem; border-radius: 9999px; font-size: .82rem; font-weight: 600; margin-bottom: .75rem; }
.doctor-card .doctor-name { font-size: 1.15rem; font-weight: 700; color: #1f2937; margin-bottom: .5rem; }
.doctor-card .doctor-description { color: #6b7280; margin-bottom: 1rem; line-height: 1.6; font-size: .88rem; }
.doctor-card .doctor-details { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1rem; }
.doctor-card .detail-item { display: flex; align-items: center; color: #6b7280; font-size: .85rem; }
.doctor-card .detail-item i { margin-right: .5rem; color: #9ca3af; width: 14px; }
.doctor-card .appointment-btn { width: 100%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; padding: .75rem 1rem; border-radius: .5rem; font-weight: 600; border: none; cursor: pointer; transition: all .3s ease; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; font-size: .9rem; }
.doctor-card .appointment-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(56,189,248,.35); }

/* ── FOOTER PARTICLES ── */
.footer-particles { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; opacity: .20; }
.footer-particles .footer-particle { position: absolute; color: rgba(56,189,248,.75); animation: footerFloat 9s ease-in-out infinite; }
@keyframes footerFloat { 0%,100%{transform:translateY(0) rotate(0deg);opacity:.15} 50%{transform:translateY(-22px) rotate(-8deg);opacity:.45} }

/* ── ANIMATIONS ── */
.fade-in { animation: fadeIn .5s ease-in-out; }
@keyframes fadeIn { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.slide-in { animation: slideIn .6s ease-out; }
@keyframes slideIn { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)} }

/* ── MODAL AUTH ── */
.auth-modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(4px); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .2s ease; }
.auth-modal-overlay.hidden { display: none; }
.auth-modal { background: white; border-radius: 20px; padding: 36px 32px; width: 100%; max-width: 440px; text-align: center; box-shadow: 0 25px 60px rgba(0,0,0,.2); position: relative; animation: slideIn .3s ease; }
.auth-modal-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 8px; border: none; background: #f1f5f9; color: #64748b; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .9rem; transition: all .2s; }
.auth-modal-close:hover { background: #fee2e2; color: #dc2626; }
.auth-modal-icon { width: 70px; height: 70px; border-radius: 50%; background: linear-gradient(135deg,#e0f2fe,#bae6fd); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--primary-deep); margin: 0 auto 18px; }
.auth-modal-title { font-size: 1.3rem; font-weight: 800; color: #1e293b; margin-bottom: 10px; }
.auth-modal-sub { font-size: .88rem; color: #64748b; line-height: 1.6; margin-bottom: 24px; }
.auth-modal-actions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.auth-btn-register { display: flex; align-items: center; justify-content: center; padding: 13px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: white; font-size: .95rem; font-weight: 700; text-decoration: none; transition: all .25s; }
.auth-btn-register:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(56,189,248,.4); }
.auth-btn-login { display: flex; align-items: center; justify-content: center; padding: 13px; border-radius: 12px; background: white; color: var(--primary-deep); border: 2px solid #bae6fd; font-size: .95rem; font-weight: 700; text-decoration: none; transition: all .25s; }
.auth-btn-login:hover { background: #f0f9ff; border-color: var(--primary); }
.auth-modal-note { font-size: .75rem; color: #94a3b8; }

@media (max-width: 640px) {
    .search-bar-card { flex-direction: column; align-items: stretch; }
    .search-select-wrap { border-left: none; border-top: 1px solid #e2e8f0; padding-left: 0; padding-top: 12px; }
    .search-btn { width: 100%; justify-content: center; }
    .specialty-card .icon-container { height: 120px; }
    .specialty-card .icon-container i { font-size: 3rem; }
}