/* ─── Espace compte Struct Up : inscription, connexion et page profil ───
   Cette couche s'affiche par-dessus l'application (elle vit hors de #root)
   et reprend la charte de l'app : Quicksand pour les titres, Nunito pour le
   texte, violet #6D5CE8 en couleur d'accent. */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

#structup-account {
  position: fixed;
  inset: 0;
  z-index: 9000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(1200px 520px at 50% -12%, rgba(183, 148, 244, 0.22) 0%, transparent 58%),
    linear-gradient(180deg, #F3F1FB 0%, #FFFFFF 460px);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #374151;
  padding: 28px 18px 56px;
  box-sizing: border-box;
}

#structup-account[hidden] { display: none; }
#structup-account * { box-sizing: border-box; }

.sua-shell { max-width: 480px; margin: 0 auto; }

.sua-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 22px;
}

/* Logo Struct Up (public/logo.png), le meme que celui de l application. */
.sua-brand-mark {
  width: 54px;
  height: 34px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.sua-brand-name {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #1B1D3A;
}

.sua-card {
  background: #fff;
  border: 1.5px solid #EAE7F8;
  border-radius: 20px;
  padding: 24px 22px;
  box-shadow: 0 18px 44px rgba(27, 29, 58, 0.07);
  margin-bottom: 16px;
}

.sua-title {
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(22px, 5.6vw, 27px);
  font-weight: 800;
  color: #1B1D3A;
  margin: 0 0 8px;
  line-height: 1.22;
}

.sua-intro {
  font-size: 14.5px;
  line-height: 1.6;
  color: #565B7D;
  margin: 0 0 20px;
}

.sua-tabs {
  display: flex;
  gap: 6px;
  background: #F5F3FD;
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 22px;
}

.sua-tab {
  flex: 1;
  border: 0;
  border-radius: 10px;
  padding: 10px 8px;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #565B7D;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.sua-tab[aria-selected='true'] {
  background: #fff;
  color: #4C3FBF;
  box-shadow: 0 2px 8px rgba(27, 29, 58, 0.08);
}

.sua-field { margin-bottom: 14px; }

.sua-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #565B7D;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.sua-field .sua-req { color: #6D5CE8; }

.sua-field input,
.sua-field select,
.sua-field textarea {
  width: 100%;
  border: 1.5px solid #EAE7F8;
  border-radius: 12px;
  padding: 12px 13px;
  font-family: inherit;
  font-size: 15px;
  color: #1B1D3A;
  background: #fff;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.sua-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23565B7D' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

.sua-field textarea { min-height: 92px; resize: vertical; line-height: 1.55; }

.sua-field input:focus,
.sua-field select:focus,
.sua-field textarea:focus {
  border-color: #6D5CE8;
  box-shadow: 0 0 0 3px rgba(109, 92, 232, 0.14);
}

.sua-field input:disabled { background: #F9FAFB; color: #6B7280; }

/* Champ au format invalide : bordure rouge + message sous le champ. */
.sua-field input.sua-invalid,
.sua-field select.sua-invalid,
.sua-field textarea.sua-invalid {
  border-color: #DC2626;
  background: #FEF2F2;
}

.sua-field input.sua-invalid:focus,
.sua-field select.sua-invalid:focus,
.sua-field textarea.sua-invalid:focus {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.sua-field-error {
  font-size: 12px;
  font-weight: 600;
  color: #DC2626;
  margin-top: 5px;
  line-height: 1.45;
}

.sua-field-error[hidden] { display: none; }

.sua-hint { font-size: 12px; color: #9CA3AF; margin-top: 5px; }

.sua-row { display: flex; gap: 12px; }
.sua-row > * { flex: 1; min-width: 0; }

.sua-btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6D5CE8 0%, #8B7CF6 100%);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(109, 92, 232, 0.28);
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.sua-btn:active { transform: translateY(1px); }
.sua-btn[disabled] { opacity: 0.6; cursor: default; box-shadow: none; }

.sua-btn-ghost {
  background: #fff;
  color: #4C3FBF;
  border: 1.5px solid #EAE7F8;
  box-shadow: none;
}

.sua-btn-link {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: none;
  border: 0;
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #565B7D;
  cursor: pointer;
  text-decoration: underline;
}

.sua-alert {
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 14px;
  border: 1.5px solid;
}

.sua-alert-error { background: #FEF2F2; border-color: #FCA5A5; color: #B91C1C; }
.sua-alert-info { background: #F5F3FD; border-color: #EAE7F8; color: #4C3FBF; }

/* ── Page profil ── */

.sua-hello {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.sua-avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6D5CE8 0%, #A78BFA 100%);
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 22px rgba(109, 92, 232, 0.3);
}

.sua-hello-text { min-width: 0; }

.sua-hello-title {
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(21px, 5.4vw, 26px);
  font-weight: 800;
  color: #1B1D3A;
  margin: 0 0 3px;
  line-height: 1.2;
}

.sua-hello-sub {
  font-size: 13px;
  color: #6B7280;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sua-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.sua-section-title {
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1B1D3A;
  margin: 0;
}

.sua-status {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: #4C3FBF;
  background: rgba(245, 243, 253, 0.94);
  backdrop-filter: blur(6px);
  border: 1.5px solid #EAE7F8;
  border-radius: 999px;
  padding: 8px 14px;
  margin: 0 auto 16px;
  width: fit-content;
  min-height: 34px;
}

.sua-status[data-state='saved'] { color: #197A5A; border-color: #BBF7D0; background: rgba(240, 253, 244, 0.94); }
.sua-status[data-state='error'] { color: #B91C1C; border-color: #FCA5A5; background: rgba(254, 242, 242, 0.94); }

.sua-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.sua-sync {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #F5F3FD;
  border: 1.5px solid #EAE7F8;
  border-radius: 16px;
  padding: 14px 15px;
  font-size: 13px;
  line-height: 1.55;
  color: #565B7D;
  margin-bottom: 16px;
}

.sua-sync b { color: #1B1D3A; }

.sua-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Pastille de retour au profil, visible dans l'app ── */

#structup-account-pill {
  position: fixed;
  right: 14px;
  bottom: 88px;
  z-index: 8000;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #EAE7F8;
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(27, 29, 58, 0.16);
  font-family: 'Quicksand', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #1B1D3A;
  cursor: pointer;
}

#structup-account-pill[hidden] { display: none; }

#structup-account-pill .sua-avatar {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  font-size: 13px;
  box-shadow: none;
}

@media (min-width: 640px) {
  #structup-account { padding-top: 46px; }
}

/* ─── Attente de validation ────────────────────────────────────────────────
   Bandeau affiche sur la page profil tant que l'administration n'a pas ouvert
   l'acces au compte. */
.sua-gate {
  margin-top: 14px;
  border-radius: 14px;
  padding: 13px 15px;
  background: #FFF9EC;
  border: 1.5px solid #FBD98B;
  color: #7A5A11;
}

.sua-gate strong {
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-size: 14.5px;
  margin-bottom: 4px;
}

.sua-gate p { margin: 0; font-size: 13.5px; line-height: 1.55; }
.sua-gate p + p { margin-top: 6px; }

.sua-gate-refuse { background: #FEF2F2; border-color: #FCA5A5; color: #B91C1C; }

/* ─── Console d'administration ────────────────────────────────────────────
   Ecran reserve au compte contact@struct-up.com : validation des inscriptions,
   boite de reception et vue des creations. */
.sua-admin-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.sua-admin-stat {
  border: 1.5px solid #EAE7F8;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}

.sua-admin-stat-value {
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #4C3FBF;
}

.sua-admin-stat-label { display: block; font-size: 12px; color: #6B7280; margin-top: 2px; }

.sua-admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.sua-admin-tab {
  flex: 1 1 auto;
  border: 1.5px solid #EAE7F8;
  background: #fff;
  border-radius: 12px;
  padding: 9px 11px;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #565B7D;
  cursor: pointer;
}

.sua-admin-tab.is-active { background: #F3F1FB; border-color: #C7BDF6; color: #4C3FBF; }

.sua-admin-zone { display: flex; flex-direction: column; gap: 10px; }

.sua-admin-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  border: 1.5px solid #F0EEFA;
  border-radius: 14px;
  padding: 12px 13px;
}

.sua-admin-row-block { flex-direction: column; }

.sua-admin-main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sua-admin-main strong { font-family: 'Quicksand', sans-serif; font-size: 14.5px; color: #1B1D3A; }
.sua-admin-meta { font-size: 12.5px; color: #6B7280; }

.sua-admin-message {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: #374151;
}

.sua-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }

.sua-btn-mini {
  width: auto;
  padding: 8px 13px;
  font-size: 13px;
  border-radius: 11px;
  box-shadow: none;
  text-decoration: none;
  text-align: center;
  display: inline-block;
}

.sua-badge {
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1.5px solid;
}

.sua-badge-pending { background: #FFF9EC; border-color: #FBD98B; color: #7A5A11; }
.sua-badge-approved { background: #ECFDF5; border-color: #86EFAC; color: #166534; }
.sua-badge-rejected { background: #FEF2F2; border-color: #FCA5A5; color: #B91C1C; }
.sua-badge-admin { background: #F3F1FB; border-color: #C7BDF6; color: #4C3FBF; }

.sua-admin-empty { font-size: 13.5px; color: #9CA3AF; margin: 4px 0; }
.sua-admin-subtitle { font-family: 'Quicksand', sans-serif; font-size: 14px; color: #1B1D3A; margin: 14px 0 8px; }

.sua-admin-entry { border: 1.5px solid #F0EEFA; border-radius: 12px; padding: 10px 12px; }
.sua-admin-entry summary { font-size: 13px; font-weight: 700; color: #4C3FBF; cursor: pointer; }

.sua-admin-pre {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #4B5563;
  background: #FAF9FE;
  border-radius: 10px;
  padding: 9px 10px;
}

.sua-shell-wide { max-width: 720px; }

/* ─── Notifications ────────────────────────────────────────────────────────
   Cloche flottante posee au-dessus de l'app, juste au-dessus de la pastille
   de compte, et panneau deroulant ancre au meme coin. Les deux vivent en
   dehors du bundle React : la couche compte les injecte dans <body>. */
#structup-notif-bell {
  position: fixed;
  right: 14px;
  bottom: 140px;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid #EAE7F8;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(27, 29, 58, 0.16);
  cursor: pointer;
}

#structup-notif-bell[hidden] { display: none; }

.sua-bell-icon {
  font-size: 19px;
  line-height: 1;
}

/* Pastille de non-lus : positionnee sur le bord de la cloche. */
.sua-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #DC2626;
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

#structup-notif-panel {
  position: fixed;
  right: 14px;
  bottom: 192px;
  z-index: 8001;
  width: min(360px, calc(100vw - 28px));
  max-height: min(60vh, 460px);
  display: flex;
  flex-direction: column;
  border: 1.5px solid #EAE7F8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(27, 29, 58, 0.2);
  overflow: hidden;
}

#structup-notif-panel[hidden] { display: none; }

.sua-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid #EAE7F8;
}

.sua-notif-title {
  font-family: 'Quicksand', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #1B1D3A;
}

.sua-notif-close {
  border: 0;
  background: none;
  padding: 2px 4px;
  font-size: 14px;
  line-height: 1;
  color: #6B7280;
  cursor: pointer;
}

.sua-notif-empty {
  margin: 0;
  padding: 22px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #565B7D;
}

.sua-notif-list {
  overflow-y: auto;
}

.sua-notif-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid #F3F1FB;
  background: none;
  text-align: left;
  cursor: pointer;
}

.sua-notif-item:hover { background: #F9F8FE; }
.sua-notif-item:last-child { border-bottom: 0; }

/* Non lue : liseré coloré et titre appuyé, sans changer la hauteur de la
   ligne pour que la liste ne bouge pas quand la notification est lue. */
.sua-notif-item-neuf {
  box-shadow: inset 3px 0 0 #6D5CE8;
  background: #FBFAFF;
}

.sua-notif-item-titre {
  font-family: 'Quicksand', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #1B1D3A;
}

.sua-notif-item-texte {
  font-size: 12.5px;
  line-height: 1.55;
  color: #565B7D;
}

.sua-notif-item-date {
  font-size: 11.5px;
  color: #6B7280;
}
