/**
 * All of the CSS for your admin-specific functionality should be
 * included in this file.
 */
.image-gallery-items {
  display: flex;
  gap: 10px 0px;
  flex-wrap: wrap;
}
.image-gallery-items .image-gallery-item {
  text-align: center;
}
.image-gallery-items + p {
  text-align: right;
}

.immowp-dashboard {
  margin-right: 20px;
}
.immowp-dashboard .immowp_settings {
  margin-bottom: 30px;
  padding: 20px;
  background: #fff;
  border: 1px solid #dedede;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.immowp-dashboard .immowp-header,
.immowp-dashboard .immowp_settings {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.immowp-logo img {
  height: 40px;
}
.immowp-dashboard .immowp-nav ul {
  display: flex;
  align-items: center;
  gap: 20px;
}
.immowp-row h5 {
  font-size: 1em;
  text-decoration: underline;
  margin: 0;
}
.immowp-row {
  margin-bottom: 2em;
}
.immowp-row input[type='text'],
.immowp-row select {
  min-width: 400px;
}

.immowp-promo-banner {
  background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
  border: 1px solid #bbdefb;
  border-radius: 8px;
  margin: 20px;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.immowp-promo-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2196f3, #21cbf3);
}

.immowp-promo-content {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
}

.immowp-promo-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.immowp-promo-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.immowp-promo-text strong {
  color: #1565c0;
  font-size: 14px;
  font-weight: 600;
}

.immowp-promo-text span {
  color: #37474f;
  font-size: 13px;
  line-height: 1.4;
}

.immowp-promo-action {
  flex-shrink: 0;
}

.immowp-promo-button {
  background: #2196f3;
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.3s ease;
  display: inline-block;
}

.immowp-promo-button:hover {
  background: #1976d2;
  color: white;
}

.immowp-promo-button:focus {
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
  outline: none;
}

@media (max-width: 768px) {
  .immowp-promo-content {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .immowp-promo-text {
    align-items: center;
    text-align: center;
  }
  
  .immowp-promo-button {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* --- Fiche bien : sections de champs -------------------------------------
   Le tableau natif de WordPress place un champ par ligne, libellé à gauche :
   avec 74 champs la fiche dépassait 5 000 px de haut et laissait la moitié
   droite vide. Les sections passent en grille, libellé au-dessus du champ. */

.iwp-field-group { margin: 0 0 18px; }
.iwp-field-group + .iwp-field-group { border-top: 1px solid #e0e0e0; padding-top: 14px; }

.iwp-field-group-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #646970;
}

.iwp-fields-intro { margin: 0 0 14px; color: #646970; }
.iwp-show-all-wrap { margin-left: 14px; white-space: nowrap; }

/* La table devient une grille ; tbody s'efface pour que chaque ligne en soit
   un élément. */
.iwp-form-table,
.iwp-form-table > tbody {
  display: block;
}
.iwp-form-table {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px 20px;
  align-items: start;
}
.iwp-form-table > tbody { display: contents; }

.iwp-form-table tr { display: block; min-width: 0; }
.iwp-form-table th,
.iwp-form-table td {
  display: block;
  width: auto;
  padding: 0;
  vertical-align: top;
}

.iwp-form-table th label,
.iwp-form-table th {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: #1d2327;
}
.iwp-form-table th { margin-bottom: 4px; }

.iwp-form-table td input[type="text"],
.iwp-form-table td input[type="number"],
.iwp-form-table td input[type="date"],
.iwp-form-table td input[type="url"],
.iwp-form-table td select,
.iwp-form-table td textarea {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

/* Case à cocher : libellé À CÔTÉ et non au-dessus. Empilé, un simple
   interrupteur occupait la hauteur d'un champ de saisie pour rien. */
.iwp-form-table tr:has(td input[type="checkbox"]) {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
}
/* Le td s'efface pour que la case et sa note deviennent des éléments de la
   même grille : sinon la note s'insère entre la case et son libellé. */
.iwp-form-table tr:has(td input[type="checkbox"]) td { display: contents; }
.iwp-form-table tr:has(td input[type="checkbox"]) td input[type="checkbox"] { order: 1; }
.iwp-form-table tr:has(td input[type="checkbox"]) th { order: 2; margin: 0; }
.iwp-form-table tr:has(td input[type="checkbox"]) td .description { order: 3; grid-column: 1 / -1; }
.iwp-form-table td input[type="checkbox"] { margin: 0; }

/* Deux champs pour une même donnée (montant + périodicité du viager) : côte à
   côte, sinon le second passe pour un champ sans libellé. */
.iwp-form-table td:has(> input + input) {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.iwp-form-table td:has(> input + input) > input { flex: 1 1 0; min-width: 0; }
.iwp-form-table td:has(> input + input) > .description { flex: 1 0 100%; }

.iwp-form-table .description {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #646970;
}

/* Les champs porteurs d'une explication longue, d'un avertissement ou d'un
   dépôt de fichier occupent toute la largeur : sinon la note écrase la
   colonne et casse l'alignement de la grille. */
.iwp-form-table tr:has(textarea),
.iwp-form-table tr:has(.iwp-alert-warning),
.iwp-form-table tr:has(.rudr-doc-upload),
.iwp-form-table tr:has(img) {
  grid-column: 1 / -1;
}

@media screen and (max-width: 782px) {
  .iwp-form-table { grid-template-columns: 1fr; }
}

/* --- Incitations Pro (édition lite) ---------------------------------------
   Badge de menu, ligne discrète de la page de réglages, page d'upgrade et
   notices d'incitation (admin/class-immowp-gestion-immo-upsell.php). ------- */

.iwp-pro-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 10px;
  background: #7c3aed;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Ligne discrète affichée dans les réglages à la place d'une section Pro
   absente en lite : même gabarit que .immowp-row, en plus sobre. */
.immowp-row.immowp-pro-teaser {
  padding: 10px 14px;
  background: #f6f4fb;
  border: 1px dashed #d8cdf0;
  border-radius: 6px;
}
.immowp-row.immowp-pro-teaser h5 {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.immowp-row.immowp-pro-teaser small a {
  margin-left: 4px;
}

/* Page d'upgrade / passerelle (immowp-gestion-immo-extensions-pro.php). */

.immowp-upsell {
  max-width: 1100px;
}

.immowp-upsell-hero {
  margin: 20px 0 24px;
}
.immowp-upsell-hero h1 {
  font-size: 26px;
  margin: 0 0 10px;
}
.immowp-upsell-hero p {
  font-size: 15px;
  color: #50575e;
  max-width: 760px;
}

.immowp-upsell-featured {
  background: #f6f4fb;
  border: 1px solid #d8cdf0;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 30px;
}
.immowp-upsell-featured-kicker {
  margin: 0 0 4px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #7c3aed;
  font-weight: 600;
}
.immowp-upsell-featured h2 {
  margin: 0 0 8px;
}
.immowp-upsell-featured .button {
  margin-top: 12px;
}

.immowp-upsell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.immowp-upsell-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  padding: 18px;
}
.immowp-upsell-card.is-featured {
  border-color: #7c3aed;
  box-shadow: 0 0 0 1px #7c3aed;
}
.immowp-upsell-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.immowp-upsell-card p {
  margin: 0;
  color: #50575e;
  font-size: 13px;
}

.immowp-upsell-price {
  text-align: center;
  background: #1d2327;
  color: #fff;
  border-radius: 10px;
  padding: 32px 20px;
  margin-bottom: 36px;
}
.immowp-upsell-price-amount {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
}
.immowp-upsell-price .button-hero {
  font-size: 15px;
  padding: 8px 24px;
  height: auto;
}

.immowp-upsell-compare {
  margin-bottom: 36px;
}
.immowp-upsell-compare table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #dcdcde;
}
.immowp-upsell-compare th,
.immowp-upsell-compare td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #f0f0f1;
}
.immowp-upsell-compare th:not(:first-child),
.immowp-upsell-compare td:not(:first-child) {
  text-align: center;
  width: 90px;
}
.immowp-upsell-yes { color: #1a7f37; font-weight: 700; }
.immowp-upsell-no { color: #8c8f94; }

.immowp-upsell-faq {
  margin-bottom: 36px;
}
.immowp-upsell-faq-item {
  margin-bottom: 16px;
}
.immowp-upsell-faq-item h3 {
  margin: 0 0 4px;
  font-size: 14px;
}
.immowp-upsell-faq-item p {
  margin: 0;
  color: #50575e;
}

.immowp-upsell-bridge,
.immowp-upsell-support {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}
.immowp-upsell-bridge h2,
.immowp-upsell-support h2 {
  margin-top: 0;
}
.immowp-upsell-bridge .button,
.immowp-upsell-support .button {
  margin-top: 10px;
}

/* Notices d'incitation (admin_notices) : teaser sur les vues, demande d'avis. */

.immowp-review-notice-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------------------------------------------------------------------------
   Page Réglages en onglets (admin/class-immowp-gestion-immo-settings.php),
   gabarit repris de l'écran d'administration de mlsnative, en version sobre
   comme l'écran de la passerelle ImmoWP : bandeau bleu nuit, couleurs
   désaturées, onglet actif teinté plutôt que plein, pas d'ombres colorées.
   Une couleur par onglet : --tab sur .iwpg (onglet ouvert), --c sur chaque
   onglet de la barre. La couleur de l'onglet ouvert se retrouve partout dans
   la page (pastille des cartes, liens, bouton d'enregistrement).
   Les cartes gardent le balisage des partiels section-*.php
   (.immowp_settings > section > en-tête + description).
   ------------------------------------------------------------------------ */

body.iwp_gestion_immo_page_immowp-settings { background: #f4f6fb; }

.iwpg {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --card: #fff;
  --brand-a: #0e1a33;
  --brand-b: #22345c;
  --radius: 14px;
  color: var(--ink);
  max-width: 1280px;
  margin: 16px 20px 40px 0;
  font-size: 14px;
}
.iwpg * { box-sizing: border-box; }
.iwpg a { color: var(--tab); }

/* Bandeau */
.iwpg-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 24px; border-radius: 18px; color: #fff; background: linear-gradient(120deg, var(--brand-a), var(--brand-b)); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.iwpg-hero__brand { display: flex; align-items: center; gap: 14px; }
.iwpg .iwpg-hero h1 { margin: 0; padding: 0; color: #fff; font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.iwpg-hero small { color: rgba(255, 255, 255, .85); font-size: 13px; }
.iwpg-logo { display: grid; place-items: center; height: 52px; padding: 6px 12px; border-radius: 13px; background: #fff; }
.iwpg-logo img { display: block; width: auto; height: 36px; }
.iwpg-hero__status { display: flex; gap: 8px; flex-wrap: wrap; }
.iwpg-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 550; color: rgba(255, 255, 255, .92); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); }
.iwpg-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.iwpg-pill--ok::before { background: #6ee7b7; }
.iwpg-pill--info::before { background: #bae6fd; }

/* Barre d'onglets */
.iwpg-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 16px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.iwpg .iwpg-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 550; transition: background .15s, color .15s; }
.iwpg-tab .dashicons { width: 18px; height: 18px; font-size: 18px; color: var(--c); }
.iwpg .iwpg-tab:hover { background: #f8fafc; color: var(--ink); }
.iwpg .iwpg-tab.is-active { background: color-mix(in srgb, var(--c) 11%, #fff); color: color-mix(in srgb, var(--c) 85%, #000); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, #fff); }
.iwpg .iwpg-tab:focus { outline: none; box-shadow: 0 0 0 2px var(--c); }
.iwpg-tab .iwp-pro-badge { margin-left: 0; background: #6f5e9e; }

/* Notices et bandeau de la passerelle, placés sous la barre d'onglets */
.iwpg .notice { margin: 0 0 16px; border-radius: 10px; }
.iwpg .immowp-promo-banner { margin: 0 0 16px; border-radius: var(--radius); }

/* Cartes */
.iwpg .immowp_settings { display: block; margin: 0 0 16px; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); overflow: hidden; }
.iwpg .immowp_settings > section { display: block; }
.iwpg .immowp_settings-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.iwpg .immowp_settings-header h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 650; color: var(--ink); }
.iwpg .immowp_settings-header h3::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--tab); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tab) 12%, #fff); }
.iwpg .immowp_settings-description { padding: 4px 20px 8px; }

/* Lignes de réglage */
.iwpg .immowp-row { margin: 0; padding: 14px 0; border-top: 1px solid var(--line); }
.iwpg .immowp-row:first-child { border-top: 0; }
.iwpg .immowp-row h5 { margin: 0 0 2px; font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--ink); }
.iwpg .immowp-row small,
.iwpg .immowp-row .description { color: var(--muted); }
.iwpg .immowp-row p { margin: 8px 0 0; }
.iwpg .immowp-row :where(input[type='text'], input[type='email'], input[type='password'], input[type='url'], select, textarea):not(.wp-color-picker) { width: 100%; min-width: 0; max-width: 420px; }
.iwpg .immowp-row .large-text { max-width: none; }
.iwpg .immowp-row.immowp-pro-teaser { margin: 12px 0; padding: 10px 14px; border: 1px dashed #d8cdf0; }

/* Barre d'enregistrement, collée en bas de l'écran pendant le défilement */
.iwpg-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin: 4px 0 16px; padding: 12px 16px; border-radius: var(--radius); background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); border: 1px solid var(--line); box-shadow: 0 -6px 20px -14px rgba(15, 23, 42, .25); }
.iwpg .iwpg-savebar .button-primary { min-height: 36px; padding: 0 18px; border-radius: 8px; background: var(--tab); border-color: var(--tab); }
.iwpg .iwpg-savebar .button-primary:hover,
.iwpg .iwpg-savebar .button-primary:focus { background: color-mix(in srgb, var(--tab) 85%, #000); border-color: color-mix(in srgb, var(--tab) 85%, #000); box-shadow: 0 0 0 1px #fff, 0 0 0 3px color-mix(in srgb, var(--tab) 40%, #fff); }

@media (max-width: 782px) {
  .iwpg { margin-right: 10px; }
  .iwpg-hero { padding: 16px; }
  .iwpg-tab { flex: 1 1 auto; justify-content: center; }
  .iwpg .immowp_settings-description { padding: 4px 16px 8px; }
}
