/* ===========================================================
   Nestora App - styles partagés
   Couleurs alignées sur styles/theme.ts de l'app mobile
   =========================================================== */

.nestora-app-mount {
  --n-gold: #B8965A;
  --n-gold-light: #E8D5B0;
  --n-gold-header: #EDE3D0;
  --n-gold-pale: #F7F1E8;
  --n-dark: #4A4540;
  --n-ink: #1C1A17;
  --n-surface: #FDFBF8;
  --n-white: #FFFFFF;
  --n-border-subtle: rgba(184, 150, 90, 0.15);
  --n-border: rgba(184, 150, 90, 0.35);
  --n-border-strong: rgba(184, 150, 90, 0.55);
  --n-muted: #8A8480;
  --n-muted-dark: #6B6560;

  --n-ok-bg: #E3F4E7;
  --n-ok-bg-pale: #F2FAF5;
  --n-ok-border: #9FD9B8;
  --n-ok-text: #1A7A45;

  --n-warn-bg: #FFF3DC;
  --n-warn-border: #FAC775;
  --n-warn-text: #854F0B;

  --n-info-bg: #D5E6F8;
  --n-info-bg-pale: #F0F7FD;
  --n-info-border: #85B7EB;
  --n-info-text: #185FA5;

  --n-danger-bg: #FFF0F0;
  --n-danger-border: #FFCCCC;
  --n-danger-text: #A32D2D;

  color: var(--n-ink);
  /* Typo héritée du template Bricks (body = Nunito, titres h2/h3 = Fraunces). */
  font-family: inherit;
  line-height: 1.4;
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  /* Marge latérale propre au mount : le contenu ne colle pas aux bords sur mobile,
     quelle que soit la config de padding du conteneur Bricks parent. */
  padding: 0 16px;
  box-sizing: border-box;
}

.nestora-app-mount *,
.nestora-app-mount *::before,
.nestora-app-mount *::after {
  box-sizing: border-box;
}

/* Les contrôles de formulaire n'héritent pas de la police par défaut. */
.nestora-app-mount input,
.nestora-app-mount button,
.nestora-app-mount textarea {
  font-family: inherit;
}

/* --- Typographie --- */
/* Pas de font-family : les h2/h3 prennent la police des Theme Styles Bricks. */
.nestora-app-mount .nestora-title {
  font-weight: 300;
  font-size: 24px;
  color: var(--n-dark);
  margin: 0 0 16px;
}

.nestora-app-mount .nestora-section-title {
  font-weight: 400;
  font-size: 16px;
  color: var(--n-dark);
  margin: 24px 0 8px;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-block;
}

.nestora-app-mount .nestora-tone-info  { background: var(--n-info-bg);   color: var(--n-info-text); }
.nestora-app-mount .nestora-tone-warn  { background: var(--n-warn-bg);   color: var(--n-warn-text); }
.nestora-app-mount .nestora-tone-ok    { background: var(--n-ok-bg);     color: var(--n-ok-text); }
.nestora-app-mount .nestora-tone-danger{ background: var(--n-danger-bg); color: var(--n-danger-text); }
.nestora-app-mount .nestora-tone-muted { background: var(--n-gold-pale); color: var(--n-muted-dark); }

/* --- Cartes --- */
.nestora-app-mount .nestora-card {
  background: var(--n-white);
  border: 1px solid var(--n-border);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
}

.nestora-app-mount .nestora-empty {
  color: var(--n-muted);
  text-align: center;
  padding: 24px;
}

.nestora-app-mount .nestora-loading {
  color: var(--n-muted);
  padding: 12px;
}

/* --- Formulaires --- */
.nestora-app-mount .nestora-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nestora-app-mount .nestora-label {
  font-size: 13px;
  color: var(--n-muted-dark);
  font-weight: 500;
}

.nestora-app-mount .nestora-input {
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--n-border);
  border-radius: 8px;
  background: var(--n-white);
  color: var(--n-ink);
  width: 100%;
  outline: none;
}

.nestora-app-mount .nestora-input:focus {
  border-color: var(--n-gold);
  box-shadow: 0 0 0 3px rgba(184, 150, 90, 0.18);
}

.nestora-app-mount .nestora-otp {
  display: flex;
  gap: 8px;
}

.nestora-app-mount .nestora-otp-box {
  flex: 1 1 0;
  min-width: 0;
  max-width: 56px;
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--n-border);
  border-radius: 8px;
  background: var(--n-white);
  color: var(--n-ink);
  outline: none;
}

.nestora-app-mount .nestora-otp-box:focus {
  border-color: var(--n-gold);
  box-shadow: 0 0 0 3px rgba(184, 150, 90, 0.18);
}

.nestora-app-mount .nestora-otp-box:disabled {
  background: var(--n-gold-pale);
  color: var(--n-muted-dark);
}

.nestora-app-mount .nestora-button {
  font-size: 15px;
  font-weight: 500;
  padding: 12px 18px;
  background: var(--n-gold);
  color: var(--n-white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.nestora-app-mount .nestora-button:hover:not([disabled]) {
  background: var(--n-dark);
}

.nestora-app-mount .nestora-button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.nestora-app-mount .nestora-button-secondary {
  font-size: 14px;
  padding: 8px 14px;
  background: var(--n-white);
  color: var(--n-dark);
  border: 1px solid var(--n-border);
  border-radius: 8px;
  cursor: pointer;
}

.nestora-app-mount .nestora-button-secondary:hover {
  background: var(--n-gold-pale);
}

.nestora-app-mount .nestora-link {
  background: none;
  border: none;
  color: var(--n-gold);
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 0;
  font-size: 14px;
  align-self: flex-start;
}

.nestora-app-mount .nestora-error {
  background: var(--n-danger-bg);
  color: var(--n-danger-text);
  border: 1px solid var(--n-danger-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 14px;
}

.nestora-app-mount .nestora-info {
  background: var(--n-info-bg-pale);
  color: var(--n-info-text);
  border: 1px solid var(--n-info-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 14px;
}

/* --- Layouts utilitaires --- */
.nestora-app-mount .nestora-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nestora-app-mount .nestora-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nestora-app-mount .nestora-muted {
  color: var(--n-muted);
  font-size: 13px;
}

.nestora-app-mount .nestora-strong {
  font-weight: 600;
  color: var(--n-ink);
}

.nestora-app-mount .nestora-tag {
  display: inline-block;
  background: var(--n-gold-pale);
  color: var(--n-gold);
  border: 1px solid var(--n-border);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  width: fit-content;
  margin-top: 4px;
}

/* --- Lignes de mission --- */
.nestora-app-mount .nestora-section {
  margin-bottom: 8px;
}

.nestora-app-mount .nestora-mission-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 12px 14px;
  border: 1px solid var(--n-border-subtle);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--n-white);
  margin: 6px 0;
}

.nestora-app-mount .nestora-mission-row.nestora-tone-info   { border-left-color: var(--n-info-border); }
.nestora-app-mount .nestora-mission-row.nestora-tone-warn   { border-left-color: var(--n-warn-border); }
.nestora-app-mount .nestora-mission-row.nestora-tone-ok     { border-left-color: var(--n-ok-border); }
.nestora-app-mount .nestora-mission-row.nestora-tone-danger { border-left-color: var(--n-danger-border); }
.nestora-app-mount .nestora-mission-row.nestora-tone-muted  { border-left-color: var(--n-gold); }

.nestora-app-mount .nestora-mission-type {
  font-weight: 600;
  color: var(--n-dark);
}

.nestora-app-mount .nestora-mission-date {
  color: var(--n-muted-dark);
  font-size: 14px;
  text-align: right;
}

.nestora-app-mount .nestora-mission-loc {
  grid-column: 1 / -1;
  color: var(--n-muted);
  font-size: 13px;
}

/* --- Item de mission (row + actions empilés) --- */
.nestora-app-mount .nestora-mission-item {
  margin: 6px 0;
}

.nestora-app-mount .nestora-mission-item .nestora-mission-row {
  margin: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

.nestora-app-mount .nestora-mission-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--n-gold-pale);
  border: 1px solid var(--n-border-subtle);
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.nestora-app-mount .nestora-mission-actions-col {
  flex-direction: column;
  align-items: stretch;
}

.nestora-app-mount .nestora-mission-actions .nestora-button,
.nestora-app-mount .nestora-mission-actions .nestora-button-secondary {
  padding: 8px 14px;
  font-size: 14px;
}

/* --- Provider cards (vue client - expand) --- */
.nestora-app-mount .nestora-providers-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: var(--n-white);
  border: 1px solid var(--n-border-subtle);
  border-top: 1px solid var(--n-border);
  margin-top: 4px;
  border-radius: 8px;
}

.nestora-app-mount .nestora-provider-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--n-border);
  border-radius: 8px;
  background: var(--n-gold-pale);
}

.nestora-app-mount .nestora-provider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.nestora-app-mount .nestora-provider-name {
  font-weight: 600;
  color: var(--n-dark);
}

.nestora-app-mount .nestora-provider-rating {
  color: var(--n-gold);
  font-weight: 600;
  font-size: 14px;
}

.nestora-app-mount .nestora-provider-card .nestora-button {
  align-self: flex-end;
  margin-top: 6px;
}

/* --- Lignes de profil --- */
.nestora-app-mount .nestora-info-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--n-border-subtle);
}

.nestora-app-mount .nestora-info-row:first-child {
  border-top: none;
}

.nestora-app-mount .nestora-info-label {
  color: var(--n-muted);
  font-size: 14px;
}

.nestora-app-mount .nestora-info-value {
  color: var(--n-ink);
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .nestora-app-mount .nestora-info-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .nestora-app-mount .nestora-mission-row {
    grid-template-columns: 1fr;
  }
  .nestora-app-mount .nestora-mission-date {
    text-align: left;
  }
}

/* --- Abonnement & crédits (paiement web) --- */
.nestora-app-mount .nestora-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.nestora-app-mount .nestora-pack-grid {
  grid-template-columns: 1fr 1fr 1fr;
}

.nestora-app-mount .nestora-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 14px 14px;
  border: 1px solid var(--n-border);
  border-radius: 10px;
  background: var(--n-white);
  overflow: hidden;
}

.nestora-app-mount .nestora-plan-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--n-gold);
  color: var(--n-white);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
}

.nestora-app-mount .nestora-plan-period {
  font-size: 12px;
  color: var(--n-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nestora-app-mount .nestora-plan-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--n-ink);
}

.nestora-app-mount .nestora-plan-credits {
  font-size: 12px;
  color: var(--n-gold);
  font-weight: 600;
}

.nestora-app-mount .nestora-plan-card .nestora-button {
  margin-top: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .nestora-app-mount .nestora-plan-grid,
  .nestora-app-mount .nestora-pack-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================================================
   SIDEBAR
   =========================================================== */

.nestora-app-mount.nestora-sidebar-mount {
  max-width: none;
  margin: 0;
  padding: 0;
}

.nestora-hidden {
  display: none !important;
}

.nestora-app-mount .nestora-sidebar {
  background: var(--n-white);
  border: 1px solid var(--n-border);
  border-radius: 10px;
  padding: 12px;
  position: sticky;
  top: 24px;
}

.nestora-app-mount .nestora-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nestora-app-mount .nestora-sidebar-item {
  margin: 0;
  padding: 0;
}

.nestora-app-mount .nestora-sidebar-link {
  display: block;
  padding: 10px 14px;
  color: var(--n-dark);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
}

.nestora-app-mount .nestora-sidebar-link:hover {
  background: var(--n-gold-pale);
  color: var(--n-gold);
}

.nestora-app-mount .nestora-sidebar-item.is-active .nestora-sidebar-link {
  background: var(--n-gold);
  color: var(--n-white);
}

.nestora-app-mount .nestora-sidebar-item.is-active .nestora-sidebar-link:hover {
  background: var(--n-dark);
  color: var(--n-white);
}

.nestora-app-mount .nestora-sidebar-item-logout {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--n-border-subtle);
}

.nestora-app-mount .nestora-sidebar-link-logout {
  color: var(--n-muted-dark);
}

.nestora-app-mount .nestora-sidebar-link-logout:hover {
  background: var(--n-danger-bg);
  color: var(--n-danger-text);
}

/* --- Mobile burger + drawer --- */
.nestora-app-mount .nestora-sidebar-burger,
.nestora-app-mount .nestora-sidebar-overlay,
.nestora-app-mount .nestora-sidebar-drawer {
  display: none;
}

.nestora-app-mount .nestora-sidebar-burger {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--n-border);
  background: var(--n-white);
  border-radius: 10px;
  cursor: pointer;
  z-index: 9998;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nestora-app-mount .nestora-burger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--n-dark);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nestora-app-mount .nestora-sidebar-burger.open .nestora-burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nestora-app-mount .nestora-sidebar-burger.open .nestora-burger-bar:nth-child(2) {
  opacity: 0;
}

.nestora-app-mount .nestora-sidebar-burger.open .nestora-burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nestora-app-mount .nestora-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9997;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nestora-app-mount .nestora-sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nestora-app-mount .nestora-sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(82vw, 320px);
  background: var(--n-white);
  border-right: 1px solid var(--n-border);
  z-index: 9999;
  padding: 24px 16px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
}

.nestora-app-mount .nestora-sidebar-drawer.open {
  transform: translateX(0);
}

.nestora-app-mount .nestora-sidebar-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--n-muted-dark);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.nestora-app-mount .nestora-sidebar-close:hover {
  color: var(--n-dark);
}

.nestora-app-mount .nestora-sidebar-drawer .nestora-sidebar-list {
  margin-top: 32px;
}

body.nestora-sidebar-locked {
  overflow: hidden;
}

@media (max-width: 768px) {
  .nestora-app-mount .nestora-sidebar {
    display: none;
  }
  .nestora-app-mount .nestora-sidebar-burger {
    display: flex;
  }
  .nestora-app-mount .nestora-sidebar-overlay,
  .nestora-app-mount .nestora-sidebar-drawer {
    display: block;
  }
}
