/**
 * ORDI'Hub - Styles frontend (espace partenaire + fiches publiques)
 * Association CONCEPTIC
 * Palette : bleu foncé #1d3557, teal #2a9d8f, rouge #e63946, sable #f1faee / #a8dadc
 * Mobile-first, responsive. Préfixe : .ohub-
 */

/* ----- Conteneur portail ----- */
.ohub-portal {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 16px 48px;
    color: #1d3557;
    box-sizing: border-box;
}

.ohub-portal * {
    box-sizing: border-box;
}

/* ----- Cartes ----- */
.ohub-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 16px 0;
}

.ohub-card {
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(29, 53, 87, 0.12);
    padding: 18px 20px;
    border-radius: 10px;
    text-align: center;
    flex: 1 1 150px;
    min-width: 140px;
}

.ohub-card-highlight {
    background: #e8f5f2;
    border: 1px solid #a8dadc;
}

.ohub-card-num {
    font-size: 30px;
    font-weight: 700;
    color: #1d3557;
    line-height: 1.1;
}

.ohub-card-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* ----- Badges (identiques à l'admin) ----- */
.ohub-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 500;
    background: #eceff1;
    color: #37474f;
}

.ohub-badge-green  { background: #d7f0e4; color: #1b7a54; }
.ohub-badge-red    { background: #fbdcde; color: #b02a37; }
.ohub-badge-orange { background: #fde8cf; color: #b26a00; }
.ohub-badge-blue   { background: #d7e3f4; color: #1d3557; }
.ohub-badge-teal   { background: #d4efe9; color: #1f7d6f; }
.ohub-badge-gray   { background: #e5e7eb; color: #4b5563; }

/* ----- Notices ----- */
.ohub-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 14px 0;
    border-left: 4px solid transparent;
    font-size: 14px;
    line-height: 1.5;
}

.ohub-notice-success {
    background: #e6f6ee;
    border-left-color: #2a9d8f;
    color: #1b7a54;
}

.ohub-notice-error {
    background: #fdeaec;
    border-left-color: #e63946;
    color: #b02a37;
}

.ohub-notice-warning {
    background: #fdf3e3;
    border-left-color: #f0a500;
    color: #96620a;
}

.ohub-notice-info {
    background: #eaf1fa;
    border-left-color: #1d3557;
    color: #1d3557;
}

/* ----- Formulaires ----- */
.ohub-form {
    margin: 16px 0;
}

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

.ohub-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1d3557;
}

.ohub-field input[type="text"],
.ohub-field input[type="email"],
.ohub-field input[type="tel"],
.ohub-field input[type="number"],
.ohub-field input[type="date"],
.ohub-field input[type="password"],
.ohub-field input[type="search"],
.ohub-field select,
.ohub-field textarea,
.ohub-form input[type="text"],
.ohub-form input[type="email"],
.ohub-form input[type="tel"],
.ohub-form input[type="number"],
.ohub-form select,
.ohub-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    color: #1d3557;
}

.ohub-field textarea,
.ohub-form textarea {
    min-height: 100px;
    resize: vertical;
}

.ohub-field input:focus,
.ohub-field select:focus,
.ohub-field textarea:focus {
    outline: none;
    border-color: #2a9d8f;
    box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.2);
}

/* ----- Boutons ----- */
.ohub-btn {
    display: inline-block;
    background: #2a9d8f;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}

.ohub-btn:hover {
    background: #23867a;
    color: #ffffff;
}

.ohub-btn-primary {
    background: #1d3557;
}

.ohub-btn-primary:hover {
    background: #16283f;
}

/* ----- Formulaire multi-étapes ----- */
.ohub-step {
    display: none;
}

.ohub-step.is-active {
    display: block;
}

.ohub-steps-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 12px 0 20px;
    font-size: 13px;
    color: #6b7280;
}

.ohub-steps-nav .ohub-step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 700;
}

.ohub-steps-nav .ohub-step-dot.is-active {
    background: #2a9d8f;
    color: #fff;
}

/* ----- Cartes de type ----- */
.ohub-type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin: 14px 0;
}

.ohub-type-card {
    display: block;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ohub-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ohub-type-card.is-selected {
    border-color: #2a9d8f;
    background: #e8f5f2;
}

.ohub-type-card .ohub-type-emoji {
    font-size: 40px;
    line-height: 1;
    display: block;
    margin-bottom: 8px;
}

.ohub-type-card .ohub-type-label {
    font-weight: 600;
    color: #1d3557;
}

/* ----- Blocs spécifiques ----- */
.ohub-specific {
    display: none;
}

/* ----- Fil de messages ----- */
.ohub-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 14px 0;
}

.ohub-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.ohub-msg-partenaire {
    background: #f1f3f5;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

.ohub-msg-conceptic {
    background: #e8f5f2;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

.ohub-msg-meta {
    font-size: 11px;
    color: #8a94a3;
    margin-top: 4px;
}

/* ----- Étoiles de notation ----- */
.ohub-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.ohub-stars input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ohub-stars label {
    font-size: 32px;
    line-height: 1;
    color: #cbd5e0;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.1s ease;
}

.ohub-stars label::before {
    content: "\2605"; /* ★ */
}

/* Survol : l'étoile survolée et toutes celles qui suivent (à droite en DOM) */
.ohub-stars label:hover,
.ohub-stars label:hover ~ label {
    color: #f1c40f;
}

/* Sélection : l'étoile cochée et les suivantes en DOM (à gauche visuellement) */
.ohub-stars input[type="radio"]:checked ~ label {
    color: #f1c40f;
}

/* ----- Fiche publique ----- */
.ohub-public-card {
    background: #ffffff;
    max-width: 640px;
    margin: 24px auto;
    box-shadow: 0 2px 10px rgba(29, 53, 87, 0.12);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
}

.ohub-public-header {
    text-align: center;
    margin-bottom: 20px;
}

.ohub-public-header img {
    max-width: 140px;
    height: auto;
    margin: 0 auto 10px;
    display: block;
}

.ohub-public-title {
    font-size: 22px;
    font-weight: 700;
    color: #1d3557;
    margin: 6px 0;
}

.ohub-specs {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    text-align: left;
}

.ohub-specs th,
.ohub-specs td {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e6ed;
    font-size: 14px;
    vertical-align: top;
}

.ohub-specs th {
    width: 40%;
    color: #6b7280;
    font-weight: 600;
}

.ohub-specs td {
    color: #1d3557;
}

/* ----- Impression ----- */
@media print {
    .ohub-no-print {
        display: none !important;
    }

    /* Masquer header/footer du thème si possible */
    header,
    footer,
    .site-header,
    .site-footer,
    #masthead,
    #colophon,
    nav {
        display: none !important;
    }

    .ohub-public-card,
    .ohub-portal {
        box-shadow: none;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    body {
        background: #fff;
    }
}

/* ----- Responsive : empiler sous 600px ----- */
@media (max-width: 600px) {
    .ohub-cards {
        flex-direction: column;
    }

    .ohub-card {
        flex-basis: auto;
        width: 100%;
    }

    .ohub-type-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .ohub-public-card {
        padding: 20px 16px;
    }

    .ohub-msg {
        max-width: 92%;
    }
}
