/* ==========================================================================
   FSM Core Plugin — Component Styles
   ==========================================================================
   This stylesheet handles ALL interactive components rendered by the FSM Core
   plugin (forms, buttons, badges, tabs, stats, cards, notices, etc.).
   Layout and structural concerns live in the theme's style.css.

   Custom properties consumed here are defined in the theme root:
     --fsm-navy, --fsm-blue-600, --fsm-teal, --fsm-emerald,
     --fsm-amber, --fsm-danger
   Every var() call includes a fallback for robustness.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FORMS
   -------------------------------------------------------------------------- */

.fsm-form {
  max-width: 800px;
  margin: 0 auto;
}

.fsm-form-section {
  margin-bottom: 32px;
}

.fsm-form-section > h3,
.fsm-form-section > h4 {
  margin-bottom: 16px;
  font-weight: 700;
  color: var(--fsm-navy, #0f172a);
}

.fsm-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.fsm-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.fsm-form-row .fsm-form-group {
  margin-bottom: 0;
}

.fsm-form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  line-height: 1.4;
}

.fsm-form-group input[type="text"],
.fsm-form-group input[type="email"],
.fsm-form-group input[type="password"],
.fsm-form-group input[type="url"],
.fsm-form-group input[type="tel"],
.fsm-form-group input[type="number"],
.fsm-form-group input[type="date"],
.fsm-form-group select,
.fsm-form-group textarea {
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fsm-navy, #0f172a);
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.fsm-form-group input:focus,
.fsm-form-group select:focus,
.fsm-form-group textarea:focus {
  outline: none;
  border-color: var(--fsm-blue-600, #2563eb);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.fsm-form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.fsm-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.fsm-form-help {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   1b. RICH EDITOR (I4 — WYSIWYG léger)
   -------------------------------------------------------------------------- */

.fsm-rich-wrap {
  border-radius: 8px;
  overflow: hidden;
}

.fsm-rich-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px 8px 0 0;
}

.fsm-rich-toolbar button {
  padding: 4px 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
  color: #374151;
  transition: background .15s, border-color .15s;
}

.fsm-rich-toolbar button:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.fsm-rich-editor {
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-top: none;
  border-radius: 0 0 8px 8px;
  outline: none;
  font-size: 14px;
  line-height: 1.6;
  color: #1f2937;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

.fsm-rich-editor:focus {
  border-color: var(--fsm-blue-600, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.fsm-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   2. BUTTONS
   -------------------------------------------------------------------------- */

.fsm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  height: auto;
  min-height: 36px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.fsm-btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.fsm-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  color: #fff;
  text-decoration: none;
}

.fsm-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.fsm-btn-secondary {
  background-color: #f3f4f6;
  color: #1f2937;
  border: 1px solid #e5e7eb;
}

.fsm-btn-secondary:hover {
  background-color: #e5e7eb;
  color: #111827;
  text-decoration: none;
}

.fsm-btn-success {
  background: linear-gradient(135deg, var(--fsm-emerald, #059669), #047857);
  color: #fff;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}

.fsm-btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
  color: #fff;
  text-decoration: none;
}

.fsm-btn-success:active {
  transform: translateY(0);
}

.fsm-btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  min-height: 28px;
  border-radius: 6px;
}

.fsm-btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

.fsm-btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--fsm-blue-600, #2563eb);
  font-weight: 600;
  cursor: pointer;
}

.fsm-btn-link:hover {
  text-decoration: underline;
}

.fsm-btn:disabled,
.fsm-btn[disabled],
.fsm-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   3. TABS
   -------------------------------------------------------------------------- */

.fsm-tabs {
  display: flex;
  flex-direction: row;
  border-bottom: 2px solid #e5e7eb;
  gap: 0;
  margin-bottom: 24px;
}

.fsm-tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.fsm-tab:hover {
  background-color: #eff6ff;
  color: var(--fsm-blue-600, #2563eb);
  text-decoration: none;
}

.fsm-tab.active,
.fsm-tab[aria-selected="true"] {
  color: var(--fsm-blue-600, #2563eb);
  font-weight: 700;
  border-bottom-color: var(--fsm-blue-600, #2563eb);
}

.fsm-tab-content {
  display: none;
}

.fsm-tab-content.active {
  display: block;
}

/* --------------------------------------------------------------------------
   4. CARDS GRID
   -------------------------------------------------------------------------- */

.fsm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* --------------------------------------------------------------------------
   5. ACTIVITY / ORG CARDS
   -------------------------------------------------------------------------- */

.fsm-activity-card,
.fsm-org-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  border-top: 4px solid transparent;
  background-image: linear-gradient(#fff, #fff),
    linear-gradient(135deg, #3b82f6, var(--fsm-teal, #14b8a6));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fsm-activity-card:hover,
.fsm-org-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.fsm-activity-card .fsm-card-header,
.fsm-org-card .fsm-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.fsm-activity-card .fsm-card-header h3,
.fsm-org-card .fsm-card-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--fsm-navy, #0f172a);
  margin: 0;
  line-height: 1.3;
}

.fsm-activity-card .fsm-card-header h3 a,
.fsm-org-card .fsm-card-header h3 a {
  color: var(--fsm-navy, #0f172a);
  text-decoration: none;
  transition: color 0.15s ease;
}

.fsm-activity-card .fsm-card-header h3 a:hover,
.fsm-org-card .fsm-card-header h3 a:hover {
  color: var(--fsm-blue-600, #2563eb);
}

.fsm-activity-card .fsm-card-meta,
.fsm-org-card .fsm-card-meta {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.fsm-meta-item::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  background: #d1d5db;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.fsm-meta-item:first-child::before {
  display: none;
}

.fsm-activity-card .fsm-card-body,
.fsm-org-card .fsm-card-body {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
  margin-bottom: 16px;
}

.fsm-activity-card .fsm-card-footer,
.fsm-org-card .fsm-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.fsm-org-name {
  font-size: 13px;
  color: #6b7280;
}

/* --------------------------------------------------------------------------
   6. BADGES
   -------------------------------------------------------------------------- */

.fsm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 9999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.fsm-badge-thematic {
  background-color: #f3f4f6;
  color: #374151;
}

.fsm-badge-pending,
.fsm-badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.fsm-badge-approved,
.fsm-badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.fsm-badge-rejected,
.fsm-badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.fsm-badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

/* --------------------------------------------------------------------------
   7. TAGS
   -------------------------------------------------------------------------- */

.fsm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.fsm-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  line-height: 1.4;
  transition: background-color 0.15s ease;
}

.fsm-tag:hover {
  background-color: #f3f4f6;
}

/* --------------------------------------------------------------------------
   8. NOTICES
   -------------------------------------------------------------------------- */

.fsm-notice {
  border-radius: 10px;
  padding: 16px 20px;
  border-left: 4px solid #d1d5db;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  background-color: #f9fafb;
  color: #374151;
}

.fsm-notice a {
  color: var(--fsm-blue-600, #2563eb);
  font-weight: 600;
  text-decoration: none;
}

.fsm-notice a:hover {
  text-decoration: underline;
}

.fsm-notice-warning {
  border-left-color: var(--fsm-amber, #f59e0b);
  background-color: #fffbeb;
  color: #92400e;
}

.fsm-notice-success {
  border-left-color: var(--fsm-emerald, #059669);
  background-color: #ecfdf5;
  color: #065f46;
}

.fsm-notice-error {
  border-left-color: var(--fsm-danger, #ef4444);
  background-color: #fef2f2;
  color: #991b1b;
}

/* --------------------------------------------------------------------------
   9. CHECKBOXES & THEMATIC ITEMS
   -------------------------------------------------------------------------- */

.fsm-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  cursor: pointer;
}

.fsm-checkbox input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--fsm-blue-600, #2563eb);
  cursor: pointer;
}

.fsm-checkbox span,
.fsm-checkbox label {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}

.fsm-thematics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.fsm-thematic-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: #f9fafb;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.fsm-thematic-item:hover {
  background-color: #f3f4f6;
}

/* --------------------------------------------------------------------------
   10. STATS GRID
   -------------------------------------------------------------------------- */

.fsm-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.fsm-stat {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fsm-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.fsm-stat-number {
  display: block;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  background: linear-gradient(
    135deg,
    var(--fsm-blue-600, #2563eb),
    var(--fsm-teal, #14b8a6)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fsm-stat-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  line-height: 1.4;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   11. PHASE BANNER
   -------------------------------------------------------------------------- */

.fsm-phase-banner {
  border-radius: 12px;
  padding: 20px 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 28px;
  background: linear-gradient(
    135deg,
    var(--fsm-blue-600, #2563eb),
    var(--fsm-teal, #14b8a6)
  );
}

.fsm-phase-banner strong {
  margin-right: 8px;
}

.fsm-phase-registration {
  background: linear-gradient(
    135deg,
    var(--fsm-emerald, #059669),
    #10b981
  );
}

.fsm-phase-forum {
  background: linear-gradient(
    135deg,
    #06b6d4,
    #0891b2
  );
  color: #ffffff;
}

.fsm-phase-archived {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* --------------------------------------------------------------------------
   12. ACCOUNT
   -------------------------------------------------------------------------- */

.fsm-account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.fsm-account-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--fsm-navy, #0f172a);
  margin: 0;
}

.fsm-account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fsm-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.fsm-account-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fsm-account-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--fsm-navy, #0f172a);
  margin: 0 0 16px 0;
}

.fsm-card-highlight {
  border-left: 4px solid var(--fsm-amber, #f59e0b);
}

.fsm-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fsm-list li {
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fsm-list li:last-child {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   12b. BADGE CARD (My Account)
   -------------------------------------------------------------------------- */

.fsm-badge-preview {
  padding: 16px;
  background: #f9fafb;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.fsm-badge-preview canvas,
.fsm-badge-preview img {
  border-radius: 8px;
}

@media print {
  .fsm-account-grid > .fsm-account-card:not(:has(.fsm-badge-preview)),
  .fsm-account-header,
  .fsm-tabs {
    display: none !important;
  }
  .fsm-badge-preview {
    background: none;
  }
}

/* --------------------------------------------------------------------------
   13. MESSAGE FEEDBACK
   -------------------------------------------------------------------------- */

#fsm-register-message,
#fsm-activity-message {
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
  display: none;
}

#fsm-register-message.visible,
#fsm-activity-message.visible {
  display: block;
}

.fsm-msg-success {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.fsm-msg-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* --------------------------------------------------------------------------
   14. EMPTY STATE
   -------------------------------------------------------------------------- */

.fsm-empty {
  text-align: center;
  padding: 48px 24px;
  color: #9ca3af;
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   15. COLLAPSIBLE
   -------------------------------------------------------------------------- */

.fsm-collapsible {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.fsm-collapsible summary {
  padding: 14px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--fsm-navy, #0f172a);
  background-color: #f9fafb;
  transition: background-color 0.15s ease;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fsm-collapsible summary::-webkit-details-marker {
  display: none;
}

.fsm-collapsible summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: #9ca3af;
  transition: transform 0.2s ease;
}

.fsm-collapsible[open] summary::after {
  content: "\2212";
}

.fsm-collapsible summary:hover {
  background-color: #f3f4f6;
}

.fsm-collapsible .fsm-collapsible-content {
  padding: 16px 20px;
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   16. RESPONSIVE — 768px breakpoint
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  /* Forms */
  .fsm-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Grid */
  .fsm-grid {
    grid-template-columns: 1fr;
  }

  /* Tabs */
  .fsm-tabs {
    flex-wrap: wrap;
    gap: 0;
  }

  .fsm-tab {
    font-size: 13px;
    padding: 10px 14px;
  }

  /* Stats */
  .fsm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .fsm-stat {
    padding: 20px;
  }

  .fsm-stat-number {
    font-size: 30px;
  }

  /* Account */
  .fsm-account-grid {
    grid-template-columns: 1fr;
  }

  /* Cards */
  .fsm-activity-card,
  .fsm-org-card {
    padding: 20px;
  }

  /* Phase banner */
  .fsm-phase-banner {
    padding: 16px 20px;
    font-size: 14px;
  }

  /* Buttons */
  .fsm-btn-lg {
    padding: 12px 24px;
    font-size: 14px;
  }

  /* Account header */
  .fsm-account-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --------------------------------------------------------------------------
   17. LOGIN FORM
   -------------------------------------------------------------------------- */

.fsm-login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 16px;
}

.fsm-login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fsm-login-header {
  text-align: center;
  margin-bottom: 28px;
}

.fsm-login-header h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--fsm-navy, #0f172a);
  margin: 0 0 8px 0;
}

.fsm-login-header p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.fsm-login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.fsm-login-footer p {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
}

.fsm-login-footer a {
  color: var(--fsm-blue-600, #2563eb);
  font-weight: 600;
  text-decoration: none;
}

.fsm-login-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .fsm-login-card {
    padding: 28px 20px;
  }
}

/* ==========================================================================
   G4 — Tooltips d'aide sur les champs de formulaire
   ========================================================================== */

.fsm-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #9ca3af;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  position: relative;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
}

.fsm-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #f9fafb;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  width: 240px;
  text-align: left;
  display: none;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  pointer-events: none;
  white-space: normal;
}

.fsm-tooltip:hover::after {
  display: block;
}

/* ==========================================================================
   ACCOUNT DASHBOARD — ENHANCED STYLES
   ========================================================================== */

/* ── Avatar circle (initials) ── */
.fsm-account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--fsm-gradient-blue, linear-gradient(135deg,#3b82f6,#1d4ed8));
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}

/* ── Account header (left block with avatar + name) ── */
.fsm-account-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fsm-account-header-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fsm-account-header-meta h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--fsm-navy, #0f172a);
}

.fsm-account-header-meta small {
  font-size: 13px;
  color: var(--fsm-text-muted, #64748b);
}

/* ── Account header right (badges + status) ── */
.fsm-account-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* ── Payment status pill ── */
.fsm-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
}
.fsm-status-pill--pending  { background: #fef3c7; color: #92400e; }
.fsm-status-pill--success  { background: #d1fae5; color: #065f46; }
.fsm-status-pill--info     { background: #dbeafe; color: #1e40af; }
.fsm-status-pill--warning  { background: #fef3c7; color: #92400e; }
.fsm-status-pill--danger   { background: #fee2e2; color: #991b1b; }

/* ── Org hero card (org name + status banner) ── */
.fsm-org-hero {
  background: linear-gradient(135deg, var(--fsm-navy,#0f172a) 0%, var(--fsm-navy-600,#1e3a5f) 100%);
  border-radius: 12px;
  padding: 20px 24px;
  color: #fff;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.fsm-org-hero::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.fsm-org-hero-name {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.3;
}
.fsm-org-hero-meta {
  font-size: 13px;
  opacity: .75;
  margin: 0 0 14px;
}
.fsm-org-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.fsm-btn-ghost-white {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  backdrop-filter: blur(4px);
}
.fsm-btn-ghost-white:hover {
  background: rgba(255,255,255,.25);
  color: #fff;
  text-decoration: none;
}
.fsm-org-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}
.fsm-org-status-badge--pending  { background: #fef3c7; color: #92400e; }
.fsm-org-status-badge--approved { background: #d1fae5; color: #065f46; }
.fsm-org-status-badge--rejected { background: #fee2e2; color: #991b1b; }

/* ── Representative cards (replacing all inline styles) ── */
.fsm-rep-card {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.fsm-rep-card--self {
  border: 2px solid #c7d2fe;
  background: #eef2ff;
}
.fsm-rep-card--included {
  border-color: #a7f3d0;
  background: #f0fdf4;
}
.fsm-rep-card--extra-paid {
  border-color: #fcd34d;
  background: #fffbeb;
}
.fsm-rep-card--extra-pending {
  border-color: #fca5a5;
  background: #fff5f5;
}
.fsm-rep-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.fsm-rep-card-name {
  font-weight: 700;
  font-size: 14px;
  color: #111827;
}
.fsm-rep-card-email {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 8px;
}
.fsm-rep-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}
.fsm-rep-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
}
.fsm-rep-tag--self     { background: #c7d2fe; color: #312e81; }
.fsm-rep-tag--included { background: #d1fae5; color: #065f46; }
.fsm-rep-tag--paid     { background: #fef3c7; color: #92400e; }
.fsm-rep-tag--pending  { background: #fee2e2; color: #991b1b; }

.fsm-rep-pending-notice {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #b45309;
  background: #fef3c7;
  padding: 3px 10px;
  border-radius: 10px;
}

/* ── Rep form fieldsets (replacing inline styles) ── */
.fsm-rep-fieldset {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.fsm-rep-fieldset legend {
  padding: 0 8px;
  font-size: 13px;
  font-weight: 700;
}
.fsm-rep-fieldset--included {
  border: 1px solid #a7f3d0;
  background: #f0fdf4;
}
.fsm-rep-fieldset--included legend { color: #065f46; }
.fsm-rep-fieldset--extra {
  border: 1px solid #fed7aa;
  background: #fff7ed;
}
.fsm-rep-fieldset--extra legend { color: #92400e; }
.fsm-rep-fieldset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.fsm-rep-fieldset-grid label,
.fsm-rep-fieldset label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #374151;
}
.fsm-rep-fieldset-grid input,
.fsm-rep-fieldset input[type="text"],
.fsm-rep-fieldset input[type="email"],
.fsm-rep-fieldset input[type="tel"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color .2s;
}
.fsm-rep-fieldset-grid input:focus,
.fsm-rep-fieldset input:focus {
  border-color: var(--fsm-blue-600, #2563eb);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.fsm-rep-add-btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background .2s, border-color .2s;
}
.fsm-rep-add-btn--included {
  border: 2px dashed #6ee7b7;
  background: #f0fdf4;
  color: #065f46;
}
.fsm-rep-add-btn--included:hover { background: #d1fae5; border-color: #34d399; }
.fsm-rep-add-btn--extra {
  border: 2px dashed #fed7aa;
  background: #fff7ed;
  color: #92400e;
}
.fsm-rep-add-btn--extra:hover { background: #fef3c7; border-color: #fbbf24; }

/* ── Rep form section wrapper ── */
.fsm-rep-form-section {
  margin-top: 16px;
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
}
.fsm-rep-form-hint {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
}

/* ── Info/notice banner ── */
.fsm-info-banner {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fsm-info-banner--green {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}
.fsm-info-banner--blue {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e40af;
}
.fsm-info-banner--amber {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}

/* ── Quota badge ── */
.fsm-quota-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  background: #e5e7eb;
  color: #374151;
  vertical-align: middle;
}
.fsm-quota-badge--warn {
  background: #fef3c7;
  color: #92400e;
}
.fsm-quota-badge--full {
  background: #fee2e2;
  color: #991b1b;
}

/* ==========================================================================
   REGISTRATION FORM — ENHANCED STYLES
   ========================================================================== */

/* ── Form hero header ── */
.fsm-register-hero {
  background: var(--fsm-gradient-hero, linear-gradient(135deg,#1e3a8a 0%,#2563eb 50%,#06b6d4 100%));
  border-radius: 12px;
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 28px;
  text-align: center;
}
.fsm-register-hero h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
}
.fsm-register-hero p {
  margin: 0;
  opacity: .85;
  font-size: 14px;
}

/* ── Enhanced tabs ── */
.fsm-tabs--register {
  overflow-x: auto;
  scrollbar-width: none;
}
.fsm-tabs--register::-webkit-scrollbar { display: none; }
.fsm-tabs--register .fsm-tab {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 18px 12px;
  font-size: 13px;
}
.fsm-tab-icon {
  font-size: 18px;
  line-height: 1;
}

/* ── Section divider with title ── */
.fsm-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
}
.fsm-section-divider-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--fsm-gradient-blue, linear-gradient(135deg,#3b82f6,#1d4ed8));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.fsm-section-divider-text {
  flex: 1;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 6px;
}
.fsm-section-divider-text h3 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
  color: var(--fsm-navy, #0f172a);
}
.fsm-section-divider-text p {
  margin: 0;
  font-size: 12px;
  color: var(--fsm-text-muted, #64748b);
}

/* ── Fee preview box ── */
.fsm-fee-preview {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 16px 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.fsm-fee-preview-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.fsm-fee-preview-label {
  font-size: 12px;
  color: #0369a1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
}
.fsm-fee-preview-amount {
  font-size: 22px;
  font-weight: 900;
  color: var(--fsm-navy, #0f172a);
  line-height: 1;
}
.fsm-fee-preview-note {
  font-size: 11px;
  color: #0369a1;
  margin-top: 3px;
}

/* ── Rep fieldset inside registration form ── */
.fsm-reg-rep-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.fsm-reg-rep-section legend {
  font-size: 14px;
  font-weight: 700;
  color: var(--fsm-navy, #0f172a);
  padding: 0 8px;
}
.fsm-reg-rep-section--included {
  border-color: #a7f3d0;
  background: #f0fdf4;
}
.fsm-reg-rep-section--extra {
  border-color: #fed7aa;
  background: #fff7ed;
}

/* ── Submit area ── */
.fsm-form-submit-area {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px 24px;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fsm-form-submit-area .fsm-btn {
  align-self: flex-start;
}
.fsm-form-submit-legal {
  font-size: 12px;
  color: var(--fsm-text-muted, #64748b);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 640px) {
  .fsm-rep-fieldset-grid { grid-template-columns: 1fr; }
  .fsm-account-header-right { align-items: flex-start; }
  .fsm-org-hero-actions { flex-direction: column; }
  .fsm-fee-preview { flex-direction: column; text-align: center; }
  .fsm-form-submit-area .fsm-btn { align-self: stretch; justify-content: center; }
}
