/* ==========================================================================
   Assistant Road Trip — styles
   Utilise les variables de charte graphique existantes du site quand
   elles sont disponibles (--charte_blue, --charte_red), avec un repli
   sur des couleurs proches si le contexte du template n'est pas chargé.
   ========================================================================== */

#rt-assistant {
    --rt-blue: var(--charte_blue, #0b3167);
    --rt-red: var(--charte_red, #970217);
    --rt-bg-soft: #f7f5f1;
    --rt-border: #ddd6cb;
    --rt-text: #2b2b2b;
    position: relative;
    width: 100%;
    margin: 0 auto;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    color: var(--rt-text);
}

#rt-kodi-logo {
    position: absolute;
    top: -25px;
    right: 2px;
    z-index: 5;
    width: 50px;
    height: 50px;
    background-color: var(--rt-red);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

#rt-kodi-logo svg {
    height: 28px;
    width: 28px;
    display: block;
}

#rt-assistant * {
    box-sizing: border-box;
}

/* ---------- Barre d'étapes ---------- */

#rt-steps {
    display: flex;
    justify-content: space-between;
    margin: 20px 0 30px;
    list-style: none;
    padding: 0;
    gap: 6px;
}

#rt-steps li {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    border-bottom: 3px solid var(--rt-border);
    color: #999;
    transition: all 0.2s;
    background-color: #dfdfdf;
}

#rt-steps li.rt-step-active {
    border-bottom-color: var(--rt-red);
    color: var(--rt-blue);
    font-weight: bold;
}

#rt-steps li.rt-step-done {
    border-bottom-color: var(--rt-blue);
    color: var(--rt-blue);
}

/* ---------- Panneaux d'étape ---------- */

.rt-panel {
    display: none;
    border: 1px solid var(--rt-border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}

.rt-panel.rt-panel-active {
    display: block;
}

/* Le panneau de résultat regroupe déjà des blocs distincts (en-tête,
   récap, carte, jours) qui ont chacun leur propre cadre : on retire donc
   le cadre englobant pour ne pas doubler l'effet "boîte dans la boîte". */
#rt-panel-resultat {
    border: none;
    border-radius: 0;
    padding: 0;
}

.rt-panel h2 {
    margin-top: 0;
    font-size: 20px;
}

/* ---------- Formulaire ---------- */

.rt-field {
    margin-bottom: 18px;
}

.rt-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 14px;
}

.rt-field input[type="number"],
.rt-field input[type="date"],
.rt-field input[type="text"],
.rt-field select,
.rt-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--rt-border);
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    height: 42px;
}

.rt-field input[type="number"]{border-radius: 0;border-left: none;border-right: none;}

.rt-field textarea {
    resize: vertical;
    min-height: 70px;
}

.rt-field input:disabled {
    background: var(--rt-bg-soft);
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ---------- Stepper (nombre de personnes, durée) ---------- */

.stepper {
    display: flex;
    align-items: stretch;
}

.stepper input[type="number"] {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    -moz-appearance: textfield;
}

.stepper input[type="number"]::-webkit-outer-spin-button,
.stepper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stepper-bouton {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: 1px solid var(--rt-border);
    background: var(--rt-bg-soft);
    color: var(--rt-blue);
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, border-color 0.15s;
}

.stepper-moins{border-radius: 6px 0 0 6px;}
.stepper-plus{border-radius: 0 6px 6px 0;}

.stepper-bouton:hover {
    background: #fff;
    border-color: var(--rt-blue);
}

.stepper-bouton:active {
    background: var(--rt-blue);
    color: #fff;
}

.stepper-bouton:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--rt-bg-soft);
    border-color: var(--rt-border);
    color: var(--rt-blue);
}

.rt-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.rt-row > .rt-field {
    flex: 1;
    min-width: 180px;
}

/* ---------- Choix visuels (profil, rythme) ---------- */

.rt-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}

.rt-choice-card {
    --rt-green: #2e7d46;
    border: 2px solid #d8d8d8;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.15s;
    background: #f4f4f4;
}

.rt-choice-card:hover {
    border-color: var(--rt-green);
}

.rt-choice-card.rt-selected {
    border-color: var(--rt-green);
    background: #eef7f0;
}

.rt-choice-card .rt-choice-title {
    display: block;
    font-weight: bold;
    color: #777;
    margin-bottom: 4px;
    font-size: 15px;
}

.rt-choice-card.rt-selected .rt-choice-title {
    color: var(--rt-green);
}

.rt-choice-card .rt-choice-desc {
    display: block;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.rt-choice-card input[type="radio"],
.rt-choice-card input[type="checkbox"] {
    display: none;
}

/* ---------- Mur de photos (sites) ---------- */

#rt-sites-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

#rt-sites-filters select,
#rt-sites-filters input[type="search"] {
    padding: 8px 10px;
    border: 1px solid var(--rt-border);
    border-radius: 6px;
    font-size: 13px;
}

#rt-sites-count {
    font-size: 13px;
    color: var(--rt-blue);
    font-weight: bold;
    margin-left: auto;
}

#rt-sites-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 560px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--rt-border);
    border-radius: 8px;
    background: var(--rt-bg-soft);
}

.rt-site-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    background: #fff;
    transition: border-color 0.15s, transform 0.1s;
}

.rt-site-card:hover {
    transform: translateY(-2px);
}

.rt-site-card.rt-site-star {
    border: 2px solid #ffb238;
}

.rt-site-card.rt-site-selected {
    border-color: var(--rt-red);
}

.rt-site-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    background: #e5e0d5;
}

.rt-site-card .rt-site-label {
    font-size: 12px;
    padding: 6px 8px;
    line-height: 1.25;
    font-weight: 600;
    text-align: left;
}

.rt-site-card .rt-site-state {
    font-size: 10px;
    color: #888;
    padding: 0 8px 6px;
    letter-spacing: 0.03em;
    line-height: normal;
}

.rt-site-card .rt-site-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.rt-site-card.rt-site-selected .rt-site-check {
    opacity: 1;
    background: var(--rt-red);
    color: #fff;
}


/* ---------- Boutons de navigation ---------- */

.rt-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

.rt-btn {
    padding: 12px 24px;
    border-radius: 24px;
    border: none;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.rt-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rt-btn-primary {
    background: var(--rt-red);
    color: #fff;
}

.rt-btn-primary:hover:not(:disabled) {
    opacity: 0.9;
}

.rt-btn-secondary {
    background: #eee;
    color: var(--rt-text);
}

.rt-btn-secondary:hover:not(:disabled) {
    opacity: 0.85;
}

/* ---------- Chargement ---------- */

#rt-loading {
    text-align: center;
    padding: 50px 20px;
}

#rt-loading .rt-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid var(--rt-border);
    border-top-color: var(--rt-red);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: rt-spin 0.9s linear infinite;
}

@keyframes rt-spin {
    to { transform: rotate(360deg); }
}

#rt-loading p {
    color: #666;
    font-style: italic;
}

/* ---------- Résultat / itinéraire ---------- */

#rt-result-header {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    border: 3px solid var(--rt-blue);
}

#rt-result-header h2 {
    margin: 0px 0px 20px;
    font-size: 24px;
    padding: 10px;
}

#rt-result-header .rt-result-meta {
    margin-bottom: 12px;
    text-align: center;
    font-weight: bold;
}

/* ---------- Tableau récapitulatif des étapes ---------- */

#rt-recap {
    background: #fff;
    border: 1px solid var(--rt-border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 20px;
    page-break-inside: avoid;
}

.rt-recap-title {
    color: var(--rt-blue);
    font-size: 17px;
    margin: 0 0 10px 0!important;
    padding: 0!important;
}

.rt-recap-table-wrap {
    overflow-x: auto;
}

.rt-recap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.rt-recap-table th {
    background: var(--rt-bg-soft);
    color: var(--rt-blue);
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--rt-border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.rt-recap-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--rt-border);
    vertical-align: top;
}

.rt-recap-table tbody tr:hover {
    background: var(--rt-bg-soft);
}

.rt-recap-table td:first-child {
    font-weight: bold;
    color: var(--rt-red);
    width: 32px;
}

.rt-recap-table td.rt-recap-date {
    white-space: nowrap;
    color: #555;
    text-transform: capitalize;
}

.rt-recap-table td.rt-recap-trajet,
.rt-recap-table td.rt-recap-duree {
    white-space: nowrap;
    color: #555;
}

.rt-recap-total {
    text-align: center;
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--rt-blue);
    font-weight: bold;
}

/* ---------- Carte interactive (Leaflet / OpenStreetMap) ---------- */

#rt-map-wrap {
    background: #fff;
    border: 1px solid var(--rt-border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 20px;
    page-break-inside: avoid;
}

/* ---------- Estimation de budget (formulaire partagé avec les pages parcours-type) ---------- */

#rt-budget-wrap {
    margin-top: 20px;
    page-break-inside: avoid;
}

#rt-budget-wrap .rt-map-title {
    margin-bottom: 14px;
}

.rt-map-title {
    color: var(--rt-blue);
    font-size: 17px;
    margin: 0 0 10px 0!important;
    padding: 0!important;
}

#rt-map {
    height: 650px;
    width: 650px;
    margin: auto;
    border-radius: 8px;
    border: 1px solid var(--rt-border);
    background: var(--rt-bg-soft);
    z-index: 0;
}

/* ---------- Avertissement IA (bas de page résultat) ---------- */

#rt-avertissement-ia {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #f0d9a8;
    border-radius: 8px;
    background: #fdf6e8;
    color: #6b5320;
    font-size: 13px;
    line-height: 1.5;
    page-break-inside: avoid;
}

#rt-avertissement-ia i {
    color: #b8860b;
    margin-right: 8px;
}

.rt-map-loading {
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rt-text);
    opacity: 0.6;
    font-size: 14px;
}

.rt-map-marker {
    background: var(--rt-red);
    color: #fff;
    border-radius: 13px;
    min-width: 26px;
    height: 26px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
    white-space: nowrap;
}

.rt-map-marker span {
    line-height: 1;
}

.rt-day {
    border: 1px solid var(--rt-border);
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
    page-break-inside: avoid;
}

.rt-day-header {
    background: var(--rt-bg-soft);
    padding: 14px 20px;
    align-items: center;
    border-bottom: 1px solid var(--rt-border);
}

.rt-day-header .rt-day-number {
    background: var(--rt-red);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
}

.rt-day-header .rt-day-title {
    font-weight: bold;
    color: var(--rt-blue);
    font-size: 16px;
}

.rt-day-header .rt-day-date {
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: #888;
    text-transform: capitalize;
}

.rt-day-header .rt-day-route {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    display: inline-block;
    text-align: right;
    width: 100%;
}

.rt-day-body {
    padding: 16px 20px;
    font-size: 14px;
}

.rt-activity {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.rt-activity .rt-activity-time {
    flex-shrink: 0;
    width: 60px;
    font-size: 14px;
    color: var(--rt-red);
    font-weight: bold;
    padding-top: 2px;
}

.rt-activity .rt-activity-content .rt-activity-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
}

.rt-activity .rt-activity-content .rt-activity-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

.rt-day-extras {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--rt-border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    font-size: 14px;
    text-align: left;
}

.rt-day-extras .rt-extra-label {
    font-weight: bold;
    color: var(--rt-blue);
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.rt-day-notes {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--rt-border);
    font-size: 14px;
    font-style: italic;
    color: #777;
}

.rt-day-notes .rt-notes-label {
    display: block;
    font-weight: bold;
    font-style: normal;
    color: var(--rt-blue);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

#rt-conseils {
    background: var(--rt-bg-soft);
    border-radius: 10px;
    padding: 20px;
    margin-top: 10px;
}

#rt-conseils h3 {
    color: var(--rt-blue);
    margin-top: 0;
}

#rt-conseils ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
}

#rt-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
    flex-wrap: wrap;
}

.rt-error-box {
    background: #fdf1f2;
    border: 1px solid var(--rt-red);
    color: var(--rt-red);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ---------- Impression ---------- */

@media print {
    #rt-kodi-logo,
    #rt-steps,
    .rt-nav-buttons,
    #rt-result-actions,
    #_entete,
    #_basdepage,
    .fil_ariane,
    #bandeau_p_desktop_bas {
        display: none !important;
    }

    .rt-day,
    #rt-recap,
    #rt-conseils {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .rt-recap-title {
        break-after: avoid;
        page-break-after: avoid;
    }

    .rt-recap-table-wrap {
        break-before: avoid;
        page-break-before: avoid;
    }

    #rt-result-header {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000;
    }

    
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
    #rt-steps li {
        font-size: 10px;
    }

    .rt-panel {
        padding: 16px;
    }

    #rt-panel-resultat {
        padding: 0;
    }

    #rt-sites-wall {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        max-height: 480px;
    }

    .rt-site-card img {
        height: 80px;
    }

    #rt-map {
        height: 280px;
    }
}
