/* Recruiter "Mon Établissement" edit (R7). Pixel-perfect copy of the canonical
   mockup /mockups/recruiter/establishment/edit, rendered as a real form bound to
   the RecruiterProfile. All rules scoped under .page-ree (vars scoped too, no
   :root leak). Zero inline CSS in the view. AC6.7 — editing never publishes:
   the page carries no publish toggle (annotated in the view). */

.page-ree {
  --brand-gold-main: 41 43% 45%;
  --grad-primary: linear-gradient(99deg, #BD9733 0%, #E5D29F 25%, #E8CC6E 50%, #E5D29F 75%, #FFF4C2 100%);
  min-height: 100vh;
  background: #FFFFFF;
  color: #1a1a1a;
  font-family: 'Geist', sans-serif;
}
.page-ree *, .page-ree *::before, .page-ree *::after { box-sizing: border-box; }
.page-ree a { text-decoration: none; color: inherit; }

.ree-wrap { max-width: 1380px; margin: 0 auto; padding: 24px 32px 128px; }

/* ══ TOP BAR ══ */
.ree-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.ree-back { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #666; transition: color .15s; }
.ree-back:hover { color: #000; }
.ree-page-title { font-size: 20px; font-weight: 700; color: #000; margin: 0; font-family: 'Geist', sans-serif; }
.ree-page-title span { color: hsl(var(--brand-gold-main)); }
.ree-topbar-spacer { width: 180px; }

/* ══ AC6.7 VISIBILITY NOTICE ══ */
.ree-lovable-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; padding: 16px 18px; border: 1px solid rgba(184,145,42,.22); border-radius: 14px; background: linear-gradient(180deg,#fff 0%,#FBF7EA 100%); box-shadow: 0 6px 22px rgba(184,145,42,.08); }
.ree-lovable-cta strong { font-size: 14px; color: #1a1a1a; }
.ree-lovable-cta span { display: block; font-size: 12px; color: #70685f; margin-top: 2px; }
.ree-lovable-cta a { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: 999px; background: var(--grad-primary); color: #1a1208; font-size: 12px; font-weight: 800; white-space: nowrap; }

/* ══ 2-COL ══ */
.ree-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 1024px) { .ree-grid { grid-template-columns: 40% 60%; } }

/* ══ LEFT — LIVE PREVIEW ══ */
.ree-preview-col { position: sticky; top: 90px; align-self: start; }
.ree-preview-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ree-preview-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #888; display: inline-flex; align-items: center; gap: 6px; }
.ree-preview-link { font-size: 11px; font-weight: 600; color: hsl(var(--brand-gold-main)); display: inline-flex; align-items: center; gap: 4px; }
.ree-preview-link:hover { text-decoration: underline; }
.ree-preview-card { border-radius: 12px; outline: 1px solid rgba(184,145,42,.16); outline-offset: 4px; overflow: hidden; border: 1px solid #e5e5e5; box-shadow: 0 1px 3px rgba(0,0,0,.04); background: #fff; }
.ree-preview-banner { position: relative; width: 100%; height: 176px; background-size: cover; background-position: center; background-color: #2A1F0A; }
.ree-preview-banner-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,.2) 50%, transparent); }
.ree-preview-banner-content { position: absolute; bottom: 12px; left: 16px; right: 16px; color: #fff; }
.ree-preview-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ree-preview-badge { font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 9999px; background: rgba(255,255,255,.15); backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.2); color: #fff; }
.ree-preview-name { font-size: 18px; font-weight: 700; line-height: 1.25; margin: 0; }
.ree-preview-location { font-size: 10px; opacity: .8; margin-top: 2px; }
.ree-preview-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ree-preview-tagline { font-size: 12px; color: #666; font-style: italic; line-height: 1.4; }
.ree-preview-about { font-size: 12px; color: #777; line-height: 1.6; }
.ree-preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 8px; border-top: 1px solid #f0f0f0; }
.ree-stat { text-align: center; }
.ree-stat-value { font-size: 13px; font-weight: 700; color: #000; }
.ree-stat-label { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: #888; margin-top: 2px; }
.ree-preview-section { padding-top: 8px; border-top: 1px solid #f0f0f0; }
.ree-preview-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #888; margin-bottom: 6px; }
.ree-preview-row { display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0; }
.ree-preview-row-name { font-weight: 600; color: #1a1a1a; }
.ree-preview-row-role { color: #888; }
.ree-preview-row-cands { color: hsl(var(--brand-gold-main)); font-weight: 700; }

/* ══ RIGHT — TABS ══ */
.ree-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid #e5e5e5; margin-bottom: 20px; overflow-x: auto; position: sticky; top: 80px; z-index: 30; background: #FFFFFF; padding: 8px 0 0; }
.ree-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; color: #888; transition: color .15s; background: none; border: none; cursor: pointer; font-family: inherit; }
.ree-tab:hover { color: #000; }
.ree-tab.active { color: #000; }
.ree-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: hsl(var(--brand-gold-main)); }
.ree-tab svg { flex-shrink: 0; }
/* Onglet d'une feature future (ex. Réseau) : présent comme la maquette, grisé + non cliquable. */
.ree-tab-soon { opacity: .55; cursor: not-allowed; filter: grayscale(.5); }
.ree-tab-soon:hover { color: #888; }
.ree-tab-soon-badge { font-size: 8px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 2px 6px; border-radius: 100px; background: #1C1A17; color: #E8D49A; border: 1px solid rgba(196,165,89,.35); }

.ree-tab-panel { display: none; }
.ree-tab-panel.active { display: flex; flex-direction: column; gap: 24px; }

/* ══ FORM SECTION ══ */
.ree-form-section { background: #FFFFFF; border: 1px solid #e5e5e5; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.ree-form-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: hsl(var(--brand-gold-main)); margin: 0 0 16px; font-family: 'Geist', sans-serif; }

/* ══ FIELDS ══ */
.ree-field { display: block; }
.ree-field + .ree-field { margin-top: 16px; }
.ree-field-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: hsl(var(--brand-gold-main)); margin-bottom: 6px; }
.ree-input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #e5e5e5; background: #fff; font-size: 13px; color: #1a1a1a; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.ree-input:focus { outline: none; border-color: hsl(var(--brand-gold-main)); box-shadow: 0 0 0 3px rgba(163,133,67,.15); }
textarea.ree-input { resize: vertical; }
.ree-input-tall { min-height: 140px; }
.ree-input-medium { min-height: 100px; }
.ree-field-hint { font-size: 11px; color: #999; margin-top: 6px; line-height: 1.5; }

/* ══ IMAGE UPLOAD ══ */
.ree-banner-preview { border-radius: 8px; overflow: hidden; border: 1px solid #e5e5e5; margin-top: 8px; }
.ree-banner-preview img { width: 100%; height: 128px; object-fit: cover; display: block; }
.ree-file { display: block; width: 100%; font-size: 12px; color: #555; }
.ree-file::file-selector-button { margin-right: 12px; padding: 8px 14px; border-radius: 9999px; border: 1px dashed #ccc; background: #fff; color: #666; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.ree-file::file-selector-button:hover { border-color: hsl(var(--brand-gold-main)); color: hsl(var(--brand-gold-main)); }

/* ══ FIELD GRID ══ */
.ree-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Dans une grille, l'espacement est géré par `gap` : on annule le margin-top
   de la règle .ree-field + .ree-field qui décalait le 2e champ (Pays, Email). */
.ree-field-grid > .ree-field { margin-top: 0; }

/* ══ TEAM / OPENINGS (read-only cross-links) ══ */
.ree-team-list, .ree-openings-list, .ree-network-list { display: flex; flex-direction: column; gap: 8px; }
.ree-team-row { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid #e5e5e5; border-radius: 8px; }
.ree-team-avatar, .ree-network-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(196,165,89,.15); color: hsl(var(--brand-gold-main)); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ree-team-info { flex: 1; min-width: 0; }
.ree-team-name { font-size: 13px; font-weight: 700; color: #000; }
.ree-team-role { font-size: 11px; color: #888; }
.ree-add-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; height: 36px; border-radius: 9999px; font-size: 12px; font-weight: 600; border: 1px dashed #ccc; color: #666; transition: all .15s; }
.ree-add-btn:hover { border-color: hsl(var(--brand-gold-main)); color: hsl(var(--brand-gold-main)); }
.ree-add-btn--mt { margin-top: 8px; }
.ree-opening-row { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid #e5e5e5; border-radius: 8px; }
.ree-opening-title { font-size: 13px; font-weight: 700; color: #000; }
.ree-opening-meta { font-size: 11px; color: #888; margin-top: 2px; }
.ree-opening-cands { color: hsl(var(--brand-gold-main)); font-weight: 700; font-size: 12px; }
.ree-empty-msg { font-size: 12px; color: #888; font-style: italic; }

/* ══ FUTURE-BRICK ══ */
.ree-future { opacity: .55; }
.ree-future-badge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #9a8350; background: rgba(163,133,67,.10); border: 1px solid rgba(163,133,67,.20); border-radius: 5px; padding: 2px 6px; margin-left: 6px; vertical-align: middle; }

/* ══ STICKY SAVE BAR ══ */
.ree-save-bar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-top: 1px solid #e5e5e5; z-index: 40; }
.ree-save-bar-inner { max-width: 1380px; margin: 0 auto; padding: 12px 32px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }

@media (max-width: 1023px) {
  .ree-preview-col { display: none; }
  .ree-lovable-cta { flex-direction: column; align-items: flex-start; }
  .ree-lovable-cta a { width: 100%; }
  .ree-topbar-spacer { display: none; }
  .ree-field-grid { grid-template-columns: 1fr; }
  .ree-topbar { flex-direction: column; gap: 8px; align-items: flex-start; }
  .ree-page-title { font-size: 17px; }
  .ree-save-bar-inner { padding: 12px 16px; }
  .ree-tabs { top: 70px; }
}

/* ══ GALLERY (drag & drop upload + réordonnancement) ══ */
.ree-gallery-hint { margin-top: 0; margin-bottom: 12px; }
.ree-gallery-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 24px; border: 1.5px dashed #d8d2c4; border-radius: 10px; background: #fcfaf5; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.ree-gallery-drop:hover, .ree-gallery-drop.is-over { border-color: hsl(var(--brand-gold-main)); background: rgba(196,165,89,.07); }
.ree-gallery-drop-icon { font-size: 22px; line-height: 1; color: hsl(var(--brand-gold-main)); }
.ree-gallery-drop-title { font-size: 13px; font-weight: 700; color: #000; }
.ree-gallery-drop-sub { font-size: 11px; color: #999; }

.ree-gallery-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ree-gallery-item { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid #e5e5e5; border-radius: 10px; background: #fff; }
.ree-gallery-item.is-dragging { opacity: .5; }
.ree-gallery-handle { display: flex; align-items: center; color: #c4c0b6; cursor: grab; flex-shrink: 0; }
.ree-gallery-handle:active { cursor: grabbing; }
.ree-gallery-thumb { width: 72px; height: 52px; border-radius: 6px; overflow: hidden; background: #f4f1ea; flex-shrink: 0; }
.ree-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ree-gallery-file { display: none; }
.ree-gallery-caption { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; background: #fff; }
.ree-gallery-caption:focus { outline: none; border-color: hsl(var(--brand-gold-main)); box-shadow: 0 0 0 3px rgba(163,133,67,.15); }
.ree-gallery-remove { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; font-size: 20px; line-height: 1; color: #b94a48; background: transparent; transition: background .15s; }
.ree-gallery-remove:hover { background: rgba(185,74,72,.10); }

/* ── Vidéo de présentation (upload Mux) ── */
.ree-video-frame { position: relative; width: 100%; max-width: 460px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #14110C; border: 1px solid #e5e5e5; display: flex; align-items: center; justify-content: center; }
.ree-video-frame mux-player { width: 100%; height: 100%; }
.ree-video-placeholder { font-size: 30px; color: rgba(232,212,154,.6); }
.ree-video-spinner { display: none; position: absolute; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(232,212,154,.25); border-top-color: #E8D49A; animation: ree-video-spin .8s linear infinite; }
.ree-video-frame.is-loading .ree-video-spinner { display: block; }
.ree-video-frame.is-loading mux-player,
.ree-video-frame.is-loading .ree-video-placeholder { opacity: .25; }
@keyframes ree-video-spin { to { transform: rotate(360deg); } }
.ree-video-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.ree-video-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid hsl(var(--brand-gold-main)); background: #fff; color: hsl(var(--brand-gold-main)); font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer; transition: background .15s; }
.ree-video-btn:hover { background: rgba(163,133,67,.08); }
.ree-video-status { font-size: 12px; color: #6b6b6b; }
