/* ═══════════════════════════════════════════════════════════════
   SirajWay — sw-auth-modal.css
   Modal Authentification (login / inscription / profil)
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay ────────────────────────────────────────────────── */
#sw-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 16, 0.82);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
#sw-auth-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Carte modal ────────────────────────────────────────────── */
#sw-auth-card {
  background: #10141f;
  border: 1px solid rgba(212,170,80,.28);
  border-radius: 18px;
  width: min(420px, calc(100vw - 32px));
  padding: 36px 32px 30px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,.7), 0 0 0 1px rgba(212,170,80,.06);
  transform: translateY(20px);
  transition: transform .25s ease;
}
#sw-auth-overlay.open #sw-auth-card {
  transform: translateY(0);
}

/* ── Bouton fermer ──────────────────────────────────────────── */
#sw-auth-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none;
  border: none;
  color: rgba(212,170,80,.6);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color .2s;
}
#sw-auth-close:hover { color: #D4AA50; }

/* ── En-tête ────────────────────────────────────────────────── */
.sw-auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.sw-auth-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.sw-auth-logo-text {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: #D4AA50;
  letter-spacing: .06em;
}

/* ── Onglets ────────────────────────────────────────────────── */
.sw-auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 26px;
}
.sw-auth-tab {
  flex: 1;
  padding: 9px 0;
  background: none;
  border: none;
  border-radius: 7px;
  color: rgba(245,239,224,.5);
  font-family: 'Cormorant Garamond', serif;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.sw-auth-tab.active {
  background: rgba(212,170,80,.15);
  color: #D4AA50;
}
.sw-auth-tab:hover:not(.active) {
  color: rgba(245,239,224,.8);
}

/* ── Formulaire ─────────────────────────────────────────────── */
.sw-auth-form { display: flex; flex-direction: column; gap: 14px; }
.sw-auth-form.hidden { display: none; }

.sw-auth-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  color: rgba(184,175,160,.85);
  text-transform: uppercase;
  margin-bottom: 5px;
  display: block;
}
.sw-auth-field {
  display: flex;
  flex-direction: column;
}
.sw-auth-input {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(212,170,80,.18);
  border-radius: 9px;
  padding: 11px 14px;
  color: #F5EFE0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, background .2s;
}
.sw-auth-input:focus {
  border-color: rgba(212,170,80,.55);
  background: rgba(255,255,255,.07);
}
.sw-auth-input::placeholder { color: rgba(245,239,224,.3); }

/* ── Bouton soumettre ───────────────────────────────────────── */
.sw-auth-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #C9A040, #D4AA50);
  border: none;
  border-radius: 10px;
  color: #060810;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  margin-top: 4px;
}
.sw-auth-submit:hover { opacity: .9; }
.sw-auth-submit:active { transform: scale(.98); }
.sw-auth-submit:disabled { opacity: .55; cursor: not-allowed; }

/* ── Messages d'erreur / succès ─────────────────────────────── */
.sw-auth-msg {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13.5px;
  border-radius: 8px;
  padding: 10px 13px;
  display: none;
  text-align: center;
}
.sw-auth-msg.error  { background: rgba(220,60,60,.12); color: #f87171; border: 1px solid rgba(220,60,60,.2); display: block; }
.sw-auth-msg.success{ background: rgba(80,200,120,.12); color: #6ee7a0; border: 1px solid rgba(80,200,120,.2); display: block; }

/* ── Vue profil (connecté) ──────────────────────────────────── */
#sw-auth-profile { display: none; }
#sw-auth-profile.active { display: block; }

.sw-auth-avatar {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, rgba(212,170,80,.18), rgba(212,170,80,.06));
  border: 2px solid rgba(212,170,80,.35);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}
.sw-auth-profile-name {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  color: #D4AA50;
  text-align: center;
  margin-bottom: 4px;
}
.sw-auth-profile-email {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13.5px;
  color: rgba(245,239,224,.45);
  text-align: center;
  margin-bottom: 24px;
  word-break: break-all;
}
.sw-auth-logout {
  width: 100%;
  padding: 11px;
  background: rgba(220,60,60,.1);
  border: 1px solid rgba(220,60,60,.25);
  border-radius: 10px;
  color: #f87171;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  cursor: pointer;
  transition: background .2s;
}
.sw-auth-logout:hover { background: rgba(220,60,60,.18); }

/* ── Bouton sidebar "Mon compte" ─────────────────────────────── */
#btn-compte .sw-auth-name-short {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
#btn-compte.logged {
  color: #D4AA50;
}

/* ── Sidebar footer — layout 3 boutons ──────────────────────── */
/* Nuit + Paramètres restent côte à côte, Mon Compte sur sa propre ligne */
/* :has() → spécificité (1,1,0) > .sidebar__foot (0,1,0), gagne quel que soit l'ordre de chargement */
.sidebar__foot:has(#btn-compte) {
  flex-wrap: wrap !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.sidebar__foot:has(#btn-compte) #btn-nuit,
.sidebar__foot:has(#btn-compte) #btn-params {
  flex: 1 1 0 !important;
  min-width: 0;
}
/* Mon Compte : ligne dédiée, pleine largeur, centré, doré */
#btn-compte {
  color: #D4AA50 !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  border-top: 1px solid rgba(212,170,80,.1);
  margin-top: 3px;
  padding-top: 7px !important;
  padding-bottom: 5px !important;
  justify-content: center !important;
  letter-spacing: .06em;
}
/* Texte — pleine largeur, sans troncature */
#btn-compte span {
  overflow: visible !important;
  white-space: nowrap !important;
  text-overflow: unset !important;
  max-width: none !important;
}
