/* Force le calcul correct des largeurs incluant le padding */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Assure que l'input ne dépasse jamais son parent */
.input-container input {
    width: 100% !important; /* Force la largeur */
    max-width: 100%;        /* Sécurité supplémentaire */
    display: block;         /* Évite les comportements inline */
}

:root {
    --primary: #FF6B00;
    --orange: #FF6B00;
    --orange-dark: #e65c00;
    --primary-dark: #e65c00;
    --blue: #0066CC;
    --blue-dark: #004d99;
    --success: #10b981;
	--success-dark: #198754;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --gray-light: #f7f7f7;
    --gray-medium: #888888;
    --transition: 0.25s ease;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* Padding lateral harmonise a 16px, comme les autres conteneurs de
   page de l'espace artisan (.agenda-wrap, .devis-page, .factures-page,
   .assurance-wrap, .avis-wrap...) -- c'etait 10px avant, ce qui
   decalait legerement tout le contenu de cette page (et le bandeau de
   rappel de facture impayee) par rapport aux autres. */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
	align-items: anchor-center;
	justify-content: center;
	gap: 15px;
}

/* Menu deroulant "Bonjour, <nom>" -- point d'entree discret vers les
   reglages du compte (aujourd'hui : fermeture du compte). */
.user-greeting-menu { position: relative; }
.user-greeting {
    display: flex; flex-direction: row; align-items: center; gap: 6px;
    background: none; border: none; padding: 8px 10px; margin: -4px -8px; border-radius: 8px;
    cursor: pointer; font-family: inherit; text-align: left; transition: background .15s ease, color .15s ease;
    color: #334155;
}
.user-greeting:hover { background: #fff3ea; color: #ff6b00; }
.welcome-text { font-size: 14px; font-weight: 600; color: inherit; }
.user-name { font-size: 14px; font-weight: 600; color: inherit; }
.user-greeting-chevron { flex-shrink: 0; transition: transform .15s ease; color: inherit; }
.user-greeting-menu.is-open .user-greeting-chevron { transform: rotate(180deg); }

.user-greeting-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; left: auto; min-width: 230px;
    max-width: calc(100vw - 24px);
    background: #fff; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.15);
    padding: 6px; z-index: 200; opacity: 0; pointer-events: none; transform: translateY(-14px);
    transform-origin: top right;
    transition: opacity .25s ease, transform .25s cubic-bezier(.16,1,.3,1);
}
.user-greeting-menu.is-open .user-greeting-dropdown { opacity: 1; pointer-events: auto; transform: translateY(0); }
/* IMPORTANT : cible UNIQUEMENT .dropdown-lien, jamais "a" en general --
   les boutons de partage (.btn-partage) sont aussi des <a> a l'interieur
   de ce menu, et heriter de ce display:block/padding les deformait
   completement (cercles ecrases en bandes). */
/* Menu "Bonjour" -- design volontairement sobre : une seule couleur de
   base (#334155) pour tout le texte et toutes les icones, une seule
   couleur d'accent (orange, meme famille que le reste du site) au survol.
   Chaque ligne a la meme taille et le meme poids de police, et une
   colonne d'icone a largeur fixe pour que tous les libelles commencent
   exactement a la meme position (alignement vertical parfait). */
.user-greeting-dropdown a.dropdown-lien,
.user-greeting-dropdown button.dropdown-lien-bouton {
    display: flex; align-items: center; gap: 10px;
    width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 7px;
    font-size: 13.5px; font-weight: 600; font-family: inherit;
    color: #334155; background: none; border: none; cursor: pointer;
    text-decoration: none; white-space: nowrap; text-align: left;
    transition: background .15s ease, color .15s ease;
}
.dropdown-lien-icone {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; flex-shrink: 0; color: inherit;
}
.dropdown-lien-texte { flex: 1; overflow: hidden; text-overflow: ellipsis; }
/* Pastille de niveau (Bronze/Argent/Or/Platine/Diamant) affichee devant
   "Espace comptable" -- couleurs dynamiques posees en inline (memes
   teintes que sur export_comptable.php), la classe ne fixe que la forme. */
/* Largeur de colonne identique aux autres icones (16px) pour rester
   aligne verticalement avec elles -- le medaillon (20px) deborde tres
   legerement de part et d'autre, centre, sans decaler la colonne. */
.dropdown-lien-icone.dropdown-lien-badge-niveau { overflow: visible; }
.user-greeting-dropdown a.dropdown-lien:hover,
.user-greeting-dropdown button.dropdown-lien-bouton:hover { background: #fff3ea; color: #ff6b00; }
/* Deconnexion -- meme survol rouge pale que "Fermer mon compte" (voir
   .tour-aide-item-quitter:hover dans tour.js), jamais l'orange des
   autres liens : quitter le compte n'est pas une action neutre. */
.user-greeting-dropdown button.dropdown-lien-bouton-quitter:hover { background: #fef2f2; color: #dc2626; }
.dropdown-lien-form { margin: 0; padding: 0; }
.dropdown-lien-bulle {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
    border-radius: 999px; background: #dc2626; color: #fff; font-size: 10.5px; font-weight: 800; padding: 0 5px;
}
/* Titre de section + ligne de separation -- distingue "Fiche publique"
   (outil pratique) des vrais liens de menu au-dessus/en-dessous. */
.dropdown-section-label {
    padding: 6px 12px 2px; font-size: 10.5px; font-weight: 700; color: #9ca3af;
    text-transform: uppercase; letter-spacing: .5px;
}
.dropdown-separateur { height: 1px; background: #f1f3f5; margin: 5px 6px; }
/* Le groupe de partage reprend .fiche-publique-groupe (memes boutons
   ronds) mais dans une ligne pleine largeur du menu, avec un peu plus
   d'air qu'en bandeau discret sous les tuiles. */
.fiche-publique-groupe-menu { padding: 4px 12px 8px; }

.btn-icon-logout {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}
.btn-icon-logout:hover {
    background: var(--danger);
    color: #fff;
}

/* Card Style */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
	border-top: 5px solid var(--orange);
}

.page-title { margin: 15px 15px 15px; color: var(--blue); font-size: 22px; display: flex; align-items: center; justify-content: center; gap: 10px;


}

/* Navigation par date -- meme esprit que agenda.php */
.date-nav {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 0 15px 15px;
}
.date-nav-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    background: #f0f2f5; color: var(--blue); text-decoration: none;
    font-size: 18px; font-weight: 700;
}
.date-nav-btn:hover { background: #e2e6ec; }
.date-nav-form { display: inline-block; }
.date-nav-form input[type="date"] {
    padding: 7px 10px; border: 1px solid #ccc; border-radius: 8px;
    font-size: 13.5px; font-weight: 600; color: var(--gray-dark);
}
.date-nav-today {
    padding: 7px 12px; border-radius: 8px; background: var(--orange);
    color: #fff; text-decoration: none; font-size: 12.5px; font-weight: 700;
}

.banniere-mode-test {
    background: #fffbeb; border-bottom: 2px solid #fbbf24;
    color: #92400e; text-align: center; font-size: 12.5px; font-weight: 700;
    padding: 8px 12px;
}

/* Map Legend */
.map-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 12px;
    font-size: 13px;
    background: white;
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-todo { background: var(--blue) }
.dot-route { background: var(--primary); }
.dot-done { background: var(--success); }

/* Appointment Cards */
.appointment-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border-left: 5px solid #e2e8f0;
    transition: transform 0.2s;
}

.appointment-card.validated, .appointment-card.assigned { border-left-color: var(--blue); }

/* Surbrillance de la carte ciblee en arrivant depuis un clic sur un
   creneau non confirme dans agenda.php (?rdv=<id>) -- meme code
   couleur/style que .agenda-slot-non-confirme dans agenda.css (contour
   pointille rouge), pour que l'artisan reconnaisse immediatement le
   meme repere visuel d'une page a l'autre. Retiree automatiquement
   apres l'animation (voir le script en bas de index.php). */
@keyframes carte-cible-surbrillance-pulse {
    0%, 100% { outline-color: #e03131; }
    50% { outline-color: #ff6b6b; }
}
.appointment-card.carte-cible-surbrillance {
    outline: 3px dashed #e03131;
    outline-offset: 2px;
    animation: carte-cible-surbrillance-pulse 1.2s ease-in-out 3;
}
.appointment-card-personnel { border-left-color: #cbd5e1 !important; background: #fafbfc; }
.appointment-card-personnel .status-badge { background: #e2e8f0; color: #64748b; }
.appointment-card.en_route { border-left-color: var(--primary); background: #fffcf0; }
/*.appointment-card.done { border-left-color: var(--success); opacity: 0.8; }*/
.appointment-card.urgent-border { border-left-color: var(--danger); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.time-badge {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    color: var(--blue);
	 display: flex; 
	 align-items: anchor-center; 
	 justify-content: center; 
	 gap: 8px;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

.badge-en_route { background: #ffedd5; color: #9a3412; }
/*.badge-done { background: #dcfce7; color: #166534; }*/

.client-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.tag-urgent { color: var(--danger); font-size: 12px; font-weight: 800; margin-left: 8px; }

.info-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin: 6px 0; color: var(--text-muted); }
.icon { width: 18px; height: 18px; flex-shrink: 0; }

.notes-box {
    margin-top: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    border-left: 3px solid #cbd5e1;
	 display: flex; 
	 align-items: anchor-center; 
	 gap: 8px;
}

/* Actions */
.card-footer {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.btn-outline { background: white; border: 1px solid #e2e8f0; color: var(--text-dark); display: flex; align-items: anchor-center; justify-content: center; gap: 8px;}
/* border:none -- sans ca, un <button class="btn-primary"> garde la
   bordure par defaut du navigateur (grisatre, en relief), invisible
   sur un <a> (qui n'en a jamais), mais qui mange sur la largeur
   interieure d'un vrai <button> et donne l'impression d'un ecart
   entre le bouton et le bord de son conteneur. */
.btn-primary { background: var(--primary); color: white; border: none; }
.btn-success { background: var(--success); color: white; }
.full-width { width: 100%; margin-top: 4px; }

.btn.btn-outline.btn-call:hover,
.btn.btn-outline.btn-gps:hover,
/* "Modifier ce RDV" -- meme contour au survol que Appeler/GPS,
   uniquement le contour, rien d'autre. */
.btn.btn-outline.btn-modifier-rdv:hover { border: 1px solid var(--primary); }
/* "Refuser -- hors de mon secteur" -- etat de base (deplace ici
   depuis un style inline, pour que le survol ci-dessous puisse le
   surcharger normalement) + fond rouge pale au survol, meme teinte
   que "Fermer mon compte" dans le menu Aide (voir
   .tour-aide-item-quitter:hover, technician/tour.js). */
.btn-refuser-secteur { background: #fff; color: #b91c1c; border: 1.5px solid #fecaca; }
.btn-refuser-secteur:hover { background: #fef2f2; }
.btn.btn-success:hover { background: var(--success-dark); }


.btn:active { transform: scale(0.98); }

.btn-primary:hover {
  background-color: var(--orange-dark);
}
@media (max-width: 600px) {
    .app-container { padding: 20px 16px; }
    .card-footer { flex-direction: row; }
    .btn-call, .btn-gps, .btn-modifier-rdv { flex: 1; }
	.btn-success, .btn-primary { min-width: 100%; }
}

/* ------------------------------------------------------------ */
/* LOGIN SPECIFIC STYLES                                        */
/* ------------------------------------------------------------ */

.bg-login {
    /*background: linear-gradient(135deg, #0066CC 0%, #004a99 100%);*/
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-card {
    /* Vague de couleur tres douce et lente en arriere-plan -- degrade
       large (400% de la carte) dont seule la position glisse, tres
       lentement (18s), entre blanc et deux teintes pastel de la charte
       (bleu, orange) : discret, jamais au detriment de la lisibilite
       du formulaire. */
    background: linear-gradient(120deg, #ffffff, #f2f7ff, #fff6ec, #ffffff);
    background-size: 400% 400%;
    animation: sobasoLoginVague 18s ease-in-out infinite;
    border-radius: 20px;
    padding: 30px; /* Réduit un peu le padding sur les côtés pour laisser de la place */
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}
@keyframes sobasoLoginVague {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-header h2 {
    margin: 20px 0 10px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.logo-circle {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 10px 15px -3px rgba(255, 107, 0, 0.3);
}

/* Form Styling */
.form-group {
    text-align: left;
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.input-container input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px; /* Évite le zoom auto sur iPhone */
    transition: all 0.2s;
    background: #f8fafc;
}

.input-container input:focus {
    border-color: var(--blue);
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.btn-block {
    width: 100%;
    height: 54px;
    font-size: 16px;
    box-shadow: 0 4px 6px -1px rgba(255, 107, 0, 0.2);
}

/* Error Alert */
/* Alertes generiques (agenda et autres pages qui ne chargent pas
   add_technician.css) -- icone en pastille ronde, texte aligne, meme
   langage que les .icon-circle du parcours de reservation. */
.alert {
    padding: 14px 16px; border-radius: 8px; margin-bottom: 20px;
    font-size: 14px; border: 1px solid transparent;
    display: flex; align-items: center; gap: 12px;
}
.alert-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.alert-icon svg { stroke: #fff; }
.alert.success { background: #d1e7dd; color: #0f5132; border-color: #badbcc; }
.alert.success .alert-icon { background: #2ecc71; }
.alert.error { background: #f8d7da; color: #842029; border-color: #f5c2c7; }
.alert.error .alert-icon { background: #e74c3c; }
.alert ul { margin: 0; padding-left: 18px; }

.alert-error {
    background: #fff1f2;
    color: var(--danger);
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #fee2e2;
}

.login-footer {
    margin-top: 30px;
    font-size: 12px;
    color: #94a3b8;
}

/* Animation entrée */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card {
    /* Deux animations combinees (virgule) -- sinon cette regle, plus bas
       dans la cascade, ecraserait entierement la vague de couleur posee
       plus haut avec la meme propriete "animation". */
    animation: slideUp 0.5s ease-out, sobasoLoginVague 18s ease-in-out infinite;
}
/* Placee APRES la regle ci-dessus (meme specificite) pour etre certaine
   de l'emporter dans la cascade -- une regle media placee plus haut
   dans le fichier serait sinon ecrasee par cette regle .login-card
   normale qui vient apres elle. */
@media (prefers-reduced-motion: reduce) {
    .login-card { animation: slideUp 0.5s ease-out; background: #fff; }
}

/* État terminé : On grise et on réduit l'importance visuelle */
.appointment-card.done {
    background-color: #f1f5f9; /* Fond gris très clair */
    border-left-color: var(--success);
    filter: grayscale(0.5);     /* Désature légèrement les couleurs */
}

/* On change aussi la couleur du badge horaire et du texte pour le contraste */
.appointment-card.done .time-badge {
    background: #e2e8f0;
    color: #64748b;
}

.appointment-card.done .client-name {
    color: #64748b;
}

/* Optionnel : cacher les boutons d'action si c'est fini */
.appointment-card.done .card-footer {
    display: none; 
}

a {
  text-decoration: none;
  color: var(--orange);
}
/* HEADER & DROPDOWNS */
.header { height: 69px; background: #FFF; padding: 0 max(30px, calc((100% - 1200px) / 2)); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); position: sticky; top:0; z-index:1000; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.header img { height: 45px; }
.header-center { display: flex; gap: 10px; }
/* RACCOURCIS RAPIDES (agenda, secteur, boosts, photo) -- une seule
   ligne compacte plutot que 4 bandeaux empiles verticalement. */
.technician-quicklinks {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
.technician-quicklinks a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--ql-couleur);
    color: #fff;
    text-decoration: none;
    padding: 14px 8px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,.12);
    transition: transform .15s ease, box-shadow .15s ease;
    text-align: center;
}
.technician-quicklinks a:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.technician-quicklinks .ql-icon-cercle { display: contents; }
.technician-quicklinks .ql-icon { font-size: 20px; line-height: 1; }
.technician-quicklinks .ql-label { font-size: 12px; font-weight: 700; line-height: 1.25; }
.technician-quicklinks .ql-label-court { display: none; }
/* Bulle de notification facon Facebook : petit rond orange avec un
   chiffre, en haut a droite de la carte, pour signaler qu'un point
   necessite l'attention de l'artisan sur cette page. */
.technician-quicklinks .ql-bulle {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #e03131;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,.25);
    z-index: 2;
}

@media (max-width: 640px) {
    /* Sur mobile, les 5 cartes empilees prenaient trop de hauteur
       (3 lignes de 2 colonnes) -- remplacees par une vraie icone
       compacte (petit cercle colore, pas toute la carte) avec un
       court libelle en dessous, hors de la couleur -- comme une
       icone d'application mobile plutot qu'un gros bouton plat. */
    .technician-quicklinks {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }
    .technician-quicklinks a {
        background: none;
        box-shadow: none;
        padding: 0;
        gap: 4px;
        color: var(--text-dark, #1e293b);
    }
    .technician-quicklinks a:hover { transform: none; box-shadow: none; }
    .technician-quicklinks .ql-icon-cercle {
        display: flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; border-radius: 50%;
        background: var(--ql-couleur);
        box-shadow: 0 2px 6px rgba(0,0,0,.15);
    }
    .technician-quicklinks .ql-icon { font-size: 17px; color: #fff; }
    .technician-quicklinks .ql-label { display: none; }
    .technician-quicklinks .ql-label-court { display: block; font-size: 10px; font-weight: 700; line-height: 1.1; }
}

/* Carte "Votre fiche publique" -- lien(s) vers la page SEO publique de
   l'artisan, avec des boutons de partage direct vers les reseaux
   sociaux -- inspire des sites d'annuaires/comparateurs qui proposent
   ce partage en un clic plutot qu'un simple lien a copier-coller.
   Volontairement DISCRET : une simple ligne fine, sans carte ni gros
   titre, pour ne jamais rivaliser visuellement avec l'agenda du jour
   -- un outil pratique mis a disposition, pas une mise en avant. */
.fiche-publique-discrete {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 4px; margin-bottom: 14px; font-size: 12px;
}
.fiche-publique-discrete-label { color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.fiche-publique-groupe { display: flex; align-items: center; gap: 5px; }
.fiche-publique-mini-label { font-size: 11px; color: var(--text-muted); margin-right: 2px; }
.btn-partage {
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; color: #fff;
    border: none; cursor: pointer; opacity: .75; transition: opacity .15s ease;
}
.btn-partage:hover { opacity: 1; }
.btn-partage-whatsapp { background: #25D366; }
.btn-partage-facebook { background: #1877F2; }
.btn-partage-x { background: #000000; }
.btn-partage-linkedin { background: #0A66C2; }
.btn-partage-lien { background: #94a3b8; }
.btn-partage-lien.copie { background: #27ae60; }
