/* =======================================================
 * VARIABLES & BASE (mêmes tokens que tsakus_claude)
 * ======================================================= */
:root {
  --tsakus-blue: #0066FF;
  --tsakus-cyan: #00A0FF;
  --tsakus-dark: #0B101E;
  --tsakus-panel: #121929;
  --tsakus-gold: #FFB400;
  --font-default: 'Inter', sans-serif;
  --font-title: 'Poppins', sans-serif;
  --pt-sidebar-w: 264px;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-default);
  color: #0f172a;
  background-color: #f4f7fb;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-title); margin: 0; }
a { text-decoration: none; }

/* =======================================================
 * PRECHARGEUR TSAKUS (identique au site principal)
 * ======================================================= */
#tsa-preloader {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: #0B101E; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s ease-out, visibility .6s ease-out;
}
.tsa-loader-wrapper {
  position: relative; width: 160px; height: 160px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: 0 0 30px rgba(0,160,255,.15);
}
.tsa-loader-wrapper::before {
  content: ''; position: absolute; width: 150%; height: 150%;
  background: conic-gradient(transparent, transparent, transparent, #00ffff);
  animation: tsa-spin-sfc 1.2s linear infinite;
}
.tsa-loader-wrapper::after {
  content: ''; position: absolute; width: 155px; height: 155px;
  background-color: #0B101E; border-radius: 50%;
}
.tsa-loader-img { position: relative; z-index: 10; width: 150px; height: 150px; border-radius: 50%; object-fit: contain; }
@keyframes tsa-spin-sfc { 100% { transform: rotate(360deg); } }
.tsa-preloader-hidden { opacity: 0 !important; visibility: hidden !important; }

/* =======================================================
 * PAGE DE CONNEXION
 * ======================================================= */
.pt-login-page { min-height: 100vh; display: flex; }
.pt-login-hero {
  position: relative;
  flex: 0 0 46%;
  max-width: 620px;
  background: radial-gradient(circle at 20% 10%, #132247 0%, #050B1F 70%);
  color: #fff;
  padding: 56px 56px 40px;
  display: flex; flex-direction: column; justify-content: center;
  overflow-y: auto;
  border-right: 3px solid var(--tsakus-cyan);
  box-shadow: 8px 0 40px rgba(0, 160, 255, .25);
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
}
.pt-login-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .35;
  pointer-events: none;
}
.pt-login-hero-content { position: relative; z-index: 2; }
.pt-login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.pt-login-logo img { height: 54px; }
.pt-login-hero h1 { font-size: 30px; font-weight: 800; line-height: 1.25; margin-bottom: 14px; }
.pt-login-hero h1 span { color: var(--tsakus-cyan); }
.pt-login-hero p.pt-lead { color: #a9c3ff; font-size: 15px; line-height: 1.6; margin-bottom: 28px; max-width: 440px; }
.pt-login-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 30px; }
.pt-login-feature {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 14px 8px; text-align: center; font-size: 12px; font-weight: 600; color: #cbd5e1;
}
.pt-login-feature i { display: block; font-size: 20px; color: var(--tsakus-cyan); margin-bottom: 8px; }
.pt-login-box-img { max-width: 260px; margin: 0 auto; display: block; filter: drop-shadow(0 20px 40px rgba(0,102,255,.35)); }

.pt-login-form-side {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px;
  background: #fff;
}
.pt-login-form-box { width: 100%; max-width: 380px; text-align: center; }
.pt-login-icon {
  width: 84px; height: 84px; border-radius: 50%; background: #eff6ff; color: var(--tsakus-blue);
  display: flex; align-items: center; justify-content: center; font-size: 34px; margin: 0 auto 18px;
}
.pt-login-form-box h2 { font-size: 26px; font-weight: 800; color: #0f172a; margin-bottom: 8px; }
.pt-login-form-box > p { color: #64748b; font-size: 14px; margin-bottom: 30px; }
.pt-field { text-align: left; margin-bottom: 18px; }
.pt-field label { display: block; font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.pt-input-group { position: relative; }
.pt-input-group i.pt-input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 15px;
}
.pt-input-group input {
  width: 100%; padding: 12px 14px 12px 42px; border: 1px solid #e2e8f0; border-radius: 10px;
  font-size: 14px; background: #f8fafc; transition: border-color .2s, background .2s;
}
.pt-input-group input:focus { outline: none; border-color: var(--tsakus-blue); background: #fff; }
.pt-input-group .pt-toggle-eye {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; cursor: pointer; background: none; border: none;
}
.pt-field-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; font-size: 13px; }
.pt-field-row label { display: flex; align-items: center; gap: 8px; color: #475569; font-weight: 500; cursor: pointer; }
.pt-field-row a { color: var(--tsakus-blue); font-weight: 700; }
.pt-btn-submit {
  width: 100%; background: var(--tsakus-blue); color: #fff; border: 0; border-radius: 10px;
  padding: 14px; font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; transition: background .2s, transform .2s;
}
.pt-btn-submit:hover { background: #0052cc; transform: translateY(-1px); }
.pt-btn-submit:disabled { opacity: .7; cursor: wait; }
.pt-login-help { margin-top: 28px; font-size: 13px; color: #64748b; }
.pt-login-help a { color: var(--tsakus-blue); font-weight: 700; }
.pt-login-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 18px; text-align: left; display: none;
}
.pt-login-error.is-visible { display: block; }

/* Sur les résolutions desktop courantes (ex. 1366x768), le contenu de la colonne de gauche
   (logo + titre + texte + 4 vignettes + visuel du coffret) est plus haut que 100vh, ce qui le
   faisait déborder / pousser la mise en page. On resserre les espacements verticaux et on
   réduit le visuel décoratif en fonction de la hauteur d'écran disponible. */
@media (max-height: 820px) {
  .pt-login-hero { padding: 32px 56px 24px; }
  .pt-login-logo { margin-bottom: 18px; }
  .pt-login-hero h1 { font-size: 25px; margin-bottom: 10px; }
  .pt-login-hero p.pt-lead { margin-bottom: 16px; }
  .pt-login-features { margin-bottom: 16px; }
  .pt-login-box-img { max-width: 170px; }
}
@media (max-height: 680px) {
  .pt-login-box-img { display: none; }
}

@media (max-width: 900px) {
  .pt-login-hero { display: none; }
  .pt-login-form-side { padding: 24px 16px; }
}

/* =======================================================
 * INDICATEURS DE MOT DE PASSE (jauge de robustesse + confirmation en direct)
 * ======================================================= */
.pt-pwd-strength { height: 5px; border-radius: 3px; background: #e2e8f0; margin-top: 8px; overflow: hidden; }
.pt-pwd-strength-bar { height: 100%; width: 0; background: #ef4444; transition: width .25s ease, background-color .25s ease; }
.pt-pwd-strength.is-faible .pt-pwd-strength-bar { width: 33%; background: #ef4444; }
.pt-pwd-strength.is-moyen .pt-pwd-strength-bar { width: 66%; background: #f59e0b; }
.pt-pwd-strength.is-fort .pt-pwd-strength-bar { width: 100%; background: #10b981; }
.pt-pwd-strength-label { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: #64748b; }
.pt-pwd-match { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; min-height: 15px; }
.pt-pwd-match.is-ok { color: #10b981; }
.pt-pwd-match.is-non { color: #ef4444; }

/* =======================================================
 * MISE EN PAGE PRINCIPALE (sidebar + topbar)
 * ======================================================= */
.pt-app { display: flex; min-height: 100vh; }

.pt-sidebar {
  width: var(--pt-sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, #0A1330 0%, #050B1F 100%);
  color: #cbd5e1; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 1000;
}
.pt-sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 22px 20px 16px; }
.pt-sidebar-logo img { height: 40px; }
.pt-sidebar-logo small { display: block; font-size: 10px; letter-spacing: 1.5px; color: #6f85c9; font-weight: 700; margin-top: 2px; }
.pt-sidebar-nav { flex: 1; padding: 10px 12px; }
.pt-sidebar-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  color: #b7c4e6; font-size: 14px; font-weight: 600; margin-bottom: 4px; transition: background .2s, color .2s;
}
.pt-sidebar-nav a i { font-size: 16px; width: 18px; text-align: center; }
.pt-sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.pt-sidebar-nav a.is-active { background: var(--tsakus-blue); color: #fff; box-shadow: 0 6px 18px rgba(0,102,255,.35); }
.pt-sidebar-foot { padding: 18px 20px 24px; border-top: 1px solid rgba(255,255,255,.08); text-align: center; }
.pt-sidebar-foot i { font-size: 30px; color: var(--tsakus-cyan); margin-bottom: 8px; display: block; }
.pt-sidebar-badge { display: inline-flex; align-items: center; gap: 6px; color: #4ade80; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.pt-sidebar-foot small { display: block; color: #64748b; font-size: 11px; line-height: 1.5; }

.pt-main { flex: 1; margin-left: var(--pt-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.pt-topbar {
  background: #fff; border-bottom: 1px solid #e2e8f0; padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 100;
}
.pt-topbar-title h1 { font-size: 20px; font-weight: 800; color: #0f172a; }
.pt-topbar-title .pt-breadcrumb { font-size: 12.5px; color: #94a3b8; margin-top: 2px; }
.pt-topbar-title .pt-breadcrumb span { color: var(--tsakus-blue); font-weight: 700; }
.pt-topbar-actions { display: flex; align-items: center; gap: 16px; }
.pt-search { position: relative; }
.pt-search input {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 14px 9px 36px; font-size: 13px; width: 240px; background: #f8fafc;
}
.pt-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 13px; }
.pt-bell { position: relative; color: #64748b; font-size: 18px; }
.pt-bell .pt-badge-count {
  position: absolute; top: -6px; right: -8px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800;
  width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.pt-partner-chip {
  display: flex; align-items: center; gap: 10px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 6px 14px 6px 10px;
}
.pt-partner-chip .pt-avatar {
  width: 34px; height: 34px; border-radius: 8px; background: #eef6ff; color: var(--tsakus-blue);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.pt-partner-chip strong { display: block; font-size: 13px; color: #0f172a; }
.pt-partner-chip span { display: block; font-size: 11px; color: #10b981; font-weight: 700; }

.tsa-devise-btn {
  border: 1px solid #e2e8f0; background: #f8fafc; color: #334155;
  border-radius: 8px; font-size: 13px; font-weight: 700; padding: 7px 12px;
  display: flex; align-items: center; gap: 6px;
}
.tsa-devise-btn:hover { border-color: var(--tsakus-blue); color: var(--tsakus-blue); }
.tsa-devise-select .dropdown-menu { font-size: 13px; min-width: 220px; }
.tsa-devise-option.is-selectionnee { font-weight: 700; color: var(--tsakus-blue); }

.pt-content { padding: 26px 28px 60px; }

/* =======================================================
 * COMPOSANTS PARTAGES
 * ======================================================= */
.pt-cards-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 20px; }
.pt-stat-card {
  background: #fff; border: 1px solid #eef2f7; border-radius: 16px; padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 14px; box-shadow: 0 6px 20px rgba(15,23,42,.03);
}
.pt-stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.pt-stat-icon.is-blue { background: #eff6ff; color: var(--tsakus-blue); }
.pt-stat-icon.is-gold { background: #fff7e6; color: var(--tsakus-gold); }
.pt-stat-icon.is-green { background: #ecfdf5; color: #10b981; }
.pt-stat-icon.is-purple { background: #f3e8ff; color: #8b5cf6; }
.pt-stat-card h3 { font-size: 24px; font-weight: 800; color: #0f172a; margin: 2px 0; }
.pt-stat-card p.pt-stat-label { font-size: 12.5px; color: #64748b; font-weight: 600; }
.pt-stat-card .pt-stat-delta { font-size: 11.5px; font-weight: 700; color: #10b981; }

.pt-actions-row { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.pt-btn {
  display: inline-flex; align-items: center; gap: 9px; border-radius: 10px; padding: 12px 22px; font-weight: 700;
  font-size: 14px; border: 1px solid transparent; cursor: pointer; transition: all .2s;
}
.pt-btn-primary { background: var(--tsakus-blue); color: #fff; box-shadow: 0 8px 20px rgba(0,102,255,.25); }
.pt-btn-primary:hover { background: #0052cc; color: #fff; }
.pt-btn-outline { background: #fff; color: var(--tsakus-blue); border-color: #bfdbfe; }
.pt-btn-outline:hover { background: #eff6ff; }
.pt-btn-gold { background: linear-gradient(135deg,#f59e0b,#FFB400); color: #0B101E; }
.pt-btn-danger-outline { background: #fff; color: #dc2626; border-color: #fecaca; }
.pt-btn-sm { padding: 8px 14px; font-size: 12.5px; }

.pt-panel { background: #fff; border: 1px solid #eef2f7; border-radius: 16px; padding: 22px; box-shadow: 0 6px 20px rgba(15,23,42,.03); margin-bottom: 20px; }
.pt-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pt-panel-head h2 { font-size: 15px; font-weight: 800; color: #0f172a; }
.pt-panel-head a.pt-link { font-size: 12.5px; color: var(--tsakus-blue); font-weight: 700; }
.pt-grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }

.pt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pt-table th { text-align: left; color: #94a3b8; font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid #eef2f7; }
.pt-table td { padding: 10px; border-bottom: 1px solid #f8fafc; color: #334155; }
.pt-table tr:last-child td { border-bottom: none; }

.pt-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.pt-badge.is-pro { background: #eff6ff; color: #1e40af; }
.pt-badge.is-ultimate { background: #fff7e6; color: #b45309; }
.pt-badge.is-active { background: #ecfdf5; color: #059669; }
.pt-badge.is-pending { background: #fffbeb; color: #b45309; }
.pt-badge.is-used { background: #f1f5f9; color: #475569; }
.pt-badge.is-danger { background: #fef2f2; color: #b91c1c; }

.pt-form label { display: block; font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.pt-form input, .pt-form select, .pt-form textarea {
  width: 100%; border: 1px solid #e2e8f0; border-radius: 10px; padding: 11px 14px; font-size: 14px;
  background: #f8fafc; margin-bottom: 16px; font-family: var(--font-default);
}
.pt-form input:focus, .pt-form select:focus, .pt-form textarea:focus { outline: none; border-color: var(--tsakus-blue); background: #fff; }
.pt-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.pt-alert-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f8fafc; }
.pt-alert-item:last-child { border-bottom: none; }
.pt-alert-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.pt-alert-icon.is-warn { background: #fffbeb; color: #d97706; }
.pt-alert-icon.is-info { background: #eff6ff; color: var(--tsakus-blue); }
.pt-alert-text strong { display: block; font-size: 13px; color: #0f172a; }
.pt-alert-text span { font-size: 12px; color: #64748b; }
.pt-alert-text a { font-size: 12px; color: var(--tsakus-blue); font-weight: 700; }

.pt-code-masque { font-family: Consolas, Monaco, monospace; font-weight: 700; letter-spacing: .3px; }

/* ---- Coller / importer un TSAKUS-ID (pages d'activation) : mêmes noms de classe que
   tsakus_claude/assets/css/style.css (.tsa-input-wrapper/.tsa-input-icon/.tsa-upload-box) pour
   garder un comportement JS identique entre le site principal et l'espace partenaires. ---- */
.tsa-input-wrapper { position: relative; }
.tsa-input-wrapper textarea, .tsa-input-wrapper input { padding-right: 44px !important; }
.tsa-input-icon {
  position: absolute; top: 14px; right: 14px; color: #94a3b8; font-size: 16px; cursor: pointer;
  transition: color .15s;
}
.tsa-input-icon:hover { color: var(--tsakus-blue); }
.tsa-upload-box {
  margin: -6px 0 16px; border: 1.5px dashed #cbd5e1; border-radius: 10px; padding: 14px;
  text-align: center; cursor: pointer; color: #64748b; font-size: 12.5px;
  transition: border-color .15s, background .15s;
}
.tsa-upload-box:hover { border-color: var(--tsakus-blue); background: #f8fbff; }
.tsa-upload-box i { font-size: 20px; display: block; margin-bottom: 4px; color: var(--tsakus-blue); }

/* ---- Bouton flottant "changer de langue" ---- */
.tsa-lang-fab {
  position: fixed; left: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%;
  z-index: 1040; display: flex; align-items: center; justify-content: center; border: 3px solid #fff;
  cursor: pointer; padding: 0;
  background-image: url('../../images/translate.png'), linear-gradient(135deg, var(--tsakus-blue), var(--tsakus-cyan));
  background-size: cover, cover; background-position: center, center; background-repeat: no-repeat, no-repeat;
  box-shadow: 0 8px 24px rgba(0, 102, 255, .35); transition: transform .2s ease, box-shadow .2s ease;
}
.tsa-lang-fab:hover { transform: scale(1.08); box-shadow: 0 10px 28px rgba(0, 102, 255, .45); }
.tsa-lang-fab span {
  font-size: 15px; color: #fff; background: rgba(11, 16, 30, .55); border-radius: 50%;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  position: absolute; bottom: -2px; right: -2px; border: 2px solid #fff;
}
.tsa-lang-choix {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px;
  border: 1.5px solid #e2e8f0; border-radius: 10px; background: #fff; cursor: pointer;
  font-size: 15px; font-weight: 600; color: #0f172a; transition: border-color .15s, background .15s;
  text-align: left;
}
.tsa-lang-choix:hover { border-color: var(--tsakus-blue); background: #f5f9ff; }
.tsa-lang-choix.is-active { border-color: var(--tsakus-blue); background: #eff6ff; }
.tsa-lang-choix .tsa-lang-drapeau { font-size: 22px; }
.tsa-lang-choix .tsa-lang-drapeau-img { width: 26px; height: 18px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.tsa-lang-choix .tsa-lang-check { margin-left: auto; color: var(--tsakus-blue); }

@media (max-width: 1200px) {
  .pt-cards-row { grid-template-columns: repeat(2, 1fr); }
  .pt-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 991px) {
  .pt-sidebar { transform: translateX(-100%); transition: transform .25s; }
  .pt-sidebar.is-open { transform: translateX(0); }
  .pt-main { margin-left: 0; }
  .pt-search { display: none; }
}
