/* harper-theme — chrome inspiré du thème WordPress bravada (Cryout)
   utilisé sur harper-school.com : bandeau image plein écran, titres
   condensés, cartes arrondies, accent chaud sur fond ardoise. */

:root {
    --accent: #e8604c;      /* accent bravada */
    --dark: #1c2733;        /* ardoise du header/footer */
    --dark-soft: #2e3d4d;
    --text: #333c45;
    --muted: #6b7683;
    --bg: #f5f6f7;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/* ---- header ---- */

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.6rem 5vw;
    background: var(--dark);
}

.branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.site-logo { height: 48px; width: 48px; border-radius: 50%; background: #fff; }

.branding-text { display: flex; flex-direction: column; }

.site-title {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-tagline { color: #aeb8c2; font-size: 0.8rem; }

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-nav a {
    display: block;
    padding: 0.55rem 0.8rem;
    color: #dde3e8;
    text-decoration: none;
    font-size: 0.92rem;
    border-radius: var(--radius);
    transition: background 0.15s, color 0.15s;
}

.main-nav a:hover { background: var(--accent); color: #fff; }

/* ---- bandeau (header image bravada) ---- */

.hero {
    background-size: cover;
    background-position: center;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    background: rgba(28, 39, 51, 0.65);
    color: #fff;
    text-align: center;
    padding: 2.5rem 3rem;
    border-radius: var(--radius);
    max-width: 640px;
    margin: 2rem;
}

.hero-overlay h1 {
    margin: 0 0 0.5rem;
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-overlay p { margin: 0; color: #dde3e8; }

/* ---- contenu ---- */

.site-content { max-width: 1100px; margin: 0 auto; padding: 2.5rem 5vw; }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: 0 2px 10px rgba(28, 39, 51, 0.08);
}

.card h2 { margin-top: 0; color: var(--dark); font-size: 1.2rem; }

.button {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.55rem 1.2rem;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
}

.button:hover { background: #d14e3b; }

.page h1 { color: var(--dark); }

.placeholder { color: var(--muted); font-style: italic; }

/* ---- footer ---- */

.site-footer { background: var(--dark); margin-top: 3rem; }

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 5vw;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    color: #aeb8c2;
    font-size: 0.88rem;
}

.footer-inner a { color: #dde3e8; text-decoration: none; margin-left: 1rem; }
.footer-inner a:hover { color: var(--accent); }

@media (max-width: 700px) {
    .header-bar { justify-content: center; }
    .hero-overlay h1 { font-size: 1.5rem; }
}

/* ---- Phase 2 : contenu WP, formulaires, progression ---- */

.wp-content { background: #fff; border-radius: var(--radius); padding: 1.75rem; box-shadow: 0 2px 10px rgba(28,39,51,0.08); }
.wp-content img { max-width: 100%; height: auto; }
.wp-content.intro { margin-bottom: 2rem; }

.flash { background: #e6f6ea; color: #1d6b34; padding: 0.75rem 5vw; text-align: center; }
.alert { background: #fdecea; color: #b3261e; padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }

.badge { display: inline-block; background: var(--dark-soft); color: #fff; font-size: 0.75rem; padding: 0.15rem 0.6rem; border-radius: 999px; margin-right: 0.4rem; }
.price { color: var(--accent); }
.post-date { color: var(--muted); font-size: 0.85rem; }

.auth-card { max-width: 460px; }
.auth-card form { display: flex; flex-direction: column; gap: 0.4rem; background: #fff; padding: 1.5rem; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(28,39,51,0.08); }
.auth-card label { font-weight: 600; font-size: 0.9rem; margin-top: 0.5rem; }
.auth-card input:not([type=checkbox]) { padding: 0.55rem 0.7rem; border: 1px solid #cdd5dc; border-radius: var(--radius); font-size: 1rem; }
.auth-card .checkbox { font-weight: 400; }
.auth-card .button { margin-top: 1rem; border: none; cursor: pointer; font-size: 1rem; }

.nav-cta { background: var(--accent); }
.nav-logout { background: none; border: 1px solid #4a5a6a; color: #dde3e8; padding: 0.5rem 0.8rem; border-radius: var(--radius); cursor: pointer; }
.nav-logout:hover { background: var(--dark-soft); }

.lesson-list { background: #fff; border-radius: var(--radius); padding: 1rem 1rem 1rem 2.5rem; box-shadow: 0 2px 10px rgba(28,39,51,0.08); }
.lesson-list li { padding: 0.45rem 0; border-bottom: 1px solid #eef1f3; }
.lesson-list li:last-child { border-bottom: none; }
.locked { color: var(--muted); }

.progress { background: #e6eaee; border-radius: 999px; height: 10px; overflow: hidden; }
.progress-bar { background: var(--accent); height: 100%; border-radius: 999px; transition: width 0.3s; }
.progress-label { color: var(--muted); font-size: 0.85rem; margin-top: 0.3rem; }

.video-frame { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; margin: 1rem 0; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

button.button[disabled] { background: var(--muted); cursor: not-allowed; }

/* ---- Espace étudiant (dashboard preskool porté) ---- */

.student-area { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; align-items: start; }
.student-main { min-width: 0; }
.student-main > h1:first-child { margin-top: 0; }

.student-nav { position: sticky; top: 1rem; }
.student-nav nav { display: flex; flex-direction: column; gap: 2px; background: #fff; border-radius: var(--radius); padding: 0.5rem; box-shadow: 0 2px 10px rgba(28,39,51,0.08); }
.student-nav a { padding: 0.55rem 0.8rem; border-radius: var(--radius); color: var(--text); text-decoration: none; font-size: 0.92rem; }
.student-nav a:hover { background: var(--bg); }
.student-nav a.active { background: var(--dark); color: #fff; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: 0 2px 10px rgba(28,39,51,0.08); display: flex; flex-direction: column; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--dark); }
.stat-label { color: var(--muted); font-size: 0.85rem; }

.resume-card { border-left: 4px solid var(--accent); margin-bottom: 1.5rem; }

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }

.activity-chart { width: 100%; height: auto; display: block; }
.activity-chart .chart-label { font-size: 11px; fill: var(--muted); }
.activity-chart .chart-value { font-size: 12px; font-weight: 600; fill: var(--text); }
.activity-chart g:hover path { filter: brightness(0.9); }

.session-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid #eef1f3; }
.session-line:last-of-type { border-bottom: none; }
.session-date { color: var(--accent); font-weight: 600; font-size: 0.9rem; min-width: 90px; }

.sheet-line form { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.sheet-form { max-width: 640px; }
.sheet-form textarea { padding: 0.55rem 0.7rem; border: 1px solid #cdd5dc; border-radius: var(--radius); font: inherit; }
.button-danger { background: #b3261e; border: none; cursor: pointer; }
.button-danger:hover { background: #8f1d17; }

/* ---- Facture ---- */

.invoice-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.invoice-paper { max-width: 720px; }
.invoice-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--dark); padding-bottom: 1rem; margin-bottom: 1rem; }
.invoice-brand { text-align: right; color: var(--muted); }
.invoice-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.invoice-table th, .invoice-table td { text-align: left; padding: 0.6rem 0.4rem; border-bottom: 1px solid #eef1f3; }
.invoice-table .num { text-align: right; }
.invoice-table tfoot th { border-top: 2px solid var(--dark); font-size: 1.05rem; }

@media print {
    .site-header, .site-footer, .invoice-actions, .student-nav { display: none !important; }
    .invoice-paper { box-shadow: none; }
    body { background: #fff; }
}

@media (max-width: 800px) {
    .student-area { grid-template-columns: 1fr; }
    .student-nav { position: static; }
    .student-nav nav { flex-direction: row; flex-wrap: wrap; }
}

/* ---- Calendrier (grille mois + créneaux jour) ---- */

.calendar-header { display: flex; align-items: center; gap: 1rem; }
.credits-badge { background: var(--accent); font-size: 0.9rem; }

.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin: 1rem 0; }
.calendar-nav h2 { margin: 0; }

.calendar-grid { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(28,39,51,0.08); table-layout: fixed; }
.calendar-grid th { background: var(--dark); color: #fff; padding: 0.5rem; font-size: 0.85rem; }
.calendar-grid td { vertical-align: top; border: 1px solid #eef1f3; height: 84px; padding: 0.3rem; }
.calendar-grid td.other-month { background: #f7f8f9; color: var(--muted); }
.calendar-grid td.closed { background: #f2f4f6; }
.calendar-grid td.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.day-number { font-weight: 600; font-size: 0.9rem; color: var(--dark); text-decoration: none; display: inline-block; margin-bottom: 0.2rem; }
a.day-number:hover { color: var(--accent); }

.cal-chip { display: block; font-size: 0.72rem; padding: 0.1rem 0.35rem; border-radius: 4px; margin-top: 2px; color: #fff; text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-chip-appointment { background: var(--accent); }
.cal-chip-session { background: var(--dark-soft); }
span.cal-chip { display: inline-block; }

.slot-free { background: #f2faf4; }
.slot-mine { background: #fdf1ef; }
.slot-past, .slot-taken { opacity: 0.6; }
.session-line form { display: inline; }

/* ---- Code couleur du calendrier (Phase 1 feuille de route) ---- */

:root {
    --slot-free: #2e8b57;      /* disponible */
    --slot-free-bg: #e9f7ef;
    --slot-taken: #6b7683;     /* occupé */
    --slot-taken-bg: #eceff2;
    --slot-past-bg: #f5f6f7;   /* passé / fermé */
}

.calendar-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem; margin: 0.8rem 0; }

.view-switcher { display: inline-flex; background: #fff; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(28,39,51,0.08); overflow: hidden; }
.view-switcher a { padding: 0.45rem 1rem; text-decoration: none; color: var(--text); font-size: 0.9rem; }
.view-switcher a.active { background: var(--dark); color: #fff; }
.view-switcher a:not(.active):hover { background: var(--bg); }

.calendar-legend { display: flex; flex-wrap: wrap; gap: 0.9rem; list-style: none; margin: 0; padding: 0; font-size: 0.82rem; color: var(--muted); }
.calendar-legend li { display: flex; align-items: center; gap: 0.35rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-free { background: var(--slot-free-bg); border: 1.5px solid var(--slot-free); }
.legend-mine { background: var(--accent); }
.legend-taken { background: var(--slot-taken-bg); border: 1.5px solid var(--slot-taken); }
.legend-past { background: var(--slot-past-bg); border: 1.5px solid #d5dae0; }

/* États des créneaux — couleurs franches sur toutes les vues. */
.slot-free { background: var(--slot-free-bg); }
.slot-free .session-date { color: var(--slot-free); }
.slot-mine { background: #fdeeeb; border-left: 4px solid var(--accent); }
.slot-taken { background: var(--slot-taken-bg); opacity: 1; }
.slot-taken .locked { color: var(--slot-taken); }
.slot-past { background: var(--slot-past-bg); opacity: 0.7; }
.slot-closed { background: repeating-linear-gradient(45deg, #f5f6f7, #f5f6f7 6px, #eef1f3 6px, #eef1f3 12px); }

/* Grille semaine */
.week-scroll { overflow-x: auto; }
.week-grid { min-width: 720px; }
.week-grid .hour-col { width: 56px; background: #fff; color: var(--muted); font-size: 0.8rem; text-align: right; padding-right: 0.5rem; border: 1px solid #eef1f3; }
.week-grid td.week-cell { height: 40px; text-align: center; vertical-align: middle; padding: 0; }
.week-grid th.today-col { outline: 2px solid var(--accent); outline-offset: -2px; }
.slot-book { width: 100%; height: 100%; border: none; background: transparent; color: var(--slot-free); font-size: 1rem; font-weight: 700; cursor: pointer; }
.slot-book:hover { background: var(--slot-free); color: #fff; }
.slot-mine-link { display: block; text-decoration: none; font-size: 1rem; }

.agenda-appointment { border-left: 4px solid var(--accent); padding-left: 0.6rem; }
.agenda-session { border-left: 4px solid var(--dark-soft); padding-left: 0.6rem; }

/* ---- Messagerie ---- */

.chat-thread { display: flex; flex-direction: column; gap: 0.6rem; max-height: 460px; overflow-y: auto; }
.chat-bubble { max-width: 75%; padding: 0.6rem 0.9rem; border-radius: 12px; }
.chat-me { align-self: flex-end; background: var(--dark); color: #fff; border-bottom-right-radius: 2px; }
.chat-me .chat-meta { color: #aeb8c2; }
.chat-them { align-self: flex-start; background: #eef1f3; border-bottom-left-radius: 2px; }
.chat-body { margin: 0 0 0.25rem; white-space: pre-line; }
.chat-meta { font-size: 0.75rem; color: var(--muted); }
.chat-form { display: flex; gap: 0.6rem; margin-top: 1rem; align-items: flex-end; }
.chat-form textarea { flex: 1; padding: 0.55rem 0.7rem; border: 1px solid #cdd5dc; border-radius: var(--radius); font: inherit; }
.chat-form .button { border: none; cursor: pointer; }
.unread-badge { background: var(--accent); }

/* ---- Hub enseignant (BI) ---- */

.quick-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.admin-nav { margin-bottom: 1rem; }

.heatmap { border-collapse: collapse; width: 100%; }
.heatmap th { font-size: 0.72rem; color: var(--muted); font-weight: 600; padding: 2px; }
.heatmap td { padding: 2px; text-align: center; }
.heat-cell { display: block; width: 100%; height: 20px; border-radius: 3px; background: var(--accent); min-width: 14px; }
.heatmap td:hover .heat-cell { outline: 2px solid var(--dark); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.hub canvas { max-width: 100%; }

/* ---- Entonnoir de conversion ---- */
.funnel-row { display: grid; grid-template-columns: 170px 1fr 90px; align-items: center; gap: 0.6rem; padding: 0.3rem 0; }
.funnel-label { font-size: 0.85rem; color: var(--text); }
.funnel-track { background: #eef1f3; border-radius: 999px; height: 16px; overflow: hidden; }
.funnel-bar { background: var(--accent); height: 100%; border-radius: 999px; }
.funnel-value { font-weight: 600; font-size: 0.9rem; text-align: right; }

/* --- CMS articles : éditeur WYSIWYG du hub enseignant --- */
.wysiwyg { border: 1px solid #d5dbe0; border-radius: var(--radius); background: #fff; margin-bottom: 1rem; }
.wysiwyg-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 0.35rem; border-bottom: 1px solid #eef1f3; background: #f7f9fa; }
.wysiwyg-toolbar button { border: 1px solid transparent; background: none; padding: 0.25rem 0.55rem; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.wysiwyg-toolbar button:hover { border-color: #d5dbe0; background: #fff; }
.wysiwyg-area { min-height: 260px; padding: 0.8rem 1rem; outline: none; }
.card-thumb { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.post-cover { max-width: 100%; border-radius: var(--radius); }
.sheet-filters { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sheet-filters select { padding: 0.35rem 0.6rem; border: 1px solid #d5dbe0; border-radius: 6px; }
.student-video { width: 100%; max-width: 640px; border-radius: var(--radius); background: #000; display: block; margin: 0.5rem 0; }
