/* ============================================
   NEWTECH INSTITUTE — POPUP FOND CLAIR
   Trilingue FR / EN / HE
   ============================================ */

/* ---------- Overlay ---------- */
#nt-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(27, 42, 74, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#nt-overlay.nt-visible {
  opacity: 1;
  pointer-events: all;
}

/* ---------- Carte fond blanc ---------- */
#nt-popup {
  position: relative;
  width: 100%;
  max-width: 350px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1px solid rgba(27, 42, 74, 0.1);
  box-shadow: 0 20px 50px rgba(27, 42, 74, 0.18), 0 0 0 1px rgba(201, 168, 76, 0.12);
  transform: scale(0.88) translateY(28px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.48, 0.64, 1), opacity 0.4s ease;
}

#nt-overlay.nt-visible #nt-popup {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Liseré or en haut */
#nt-popup::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, transparent 0%, #C9A84C 40%, #E2C47A 60%, transparent 100%);
}

/* ---------- En-tête ---------- */
.nt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.2rem 0.8rem;
  border-bottom: 1px solid rgba(27, 42, 74, 0.08);
}

/* Logo NewTech */
.nt-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.nt-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7B2FD4 0%, #2563EB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(123, 47, 212, 0.35);
}

.nt-logo-initials {
  color: #FFFFFF;
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.nt-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nt-logo-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #1B2A4A;
  letter-spacing: 0.01em;
}

.nt-logo-name strong {
  font-weight: 700;
}

.nt-logo-tagline {
  font-size: 0.62rem;
  font-weight: 600;
  color: #C9A84C;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Contrôles droite (langue + fermer) */
.nt-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nt-lang-switch-btn {
  background: rgba(27, 42, 74, 0.05);
  border: 1px solid rgba(27, 42, 74, 0.15);
  color: #6B7280;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nt-lang-switch-btn.active,
.nt-lang-switch-btn:hover {
  border-color: #C9A84C;
  color: #1B2A4A;
  background: rgba(201, 168, 76, 0.12);
}

.nt-close-x {
  width: 28px;
  height: 28px;
  background: rgba(27, 42, 74, 0.05);
  border: 1px solid rgba(27, 42, 74, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9CA3AF;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.nt-close-x:hover {
  background: rgba(201, 168, 76, 0.1);
  border-color: #C9A84C;
  color: #1B2A4A;
  transform: rotate(90deg);
}

/* ---------- Corps ---------- */
.nt-body {
  padding: 0.7rem 0.95rem 0.9rem;
}

/* ---------- Badge ---------- */
.nt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.35);
  color: #92700A;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.22rem 0.6rem;
  border-radius: 100px;
  margin-bottom: 0.65rem;
}

.nt-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #C9A84C;
  animation: nt-blink 1.6s ease-in-out infinite;
}

@keyframes nt-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* ---------- Services ---------- */
.nt-services { margin-bottom: 0.65rem; }

.nt-services-title {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #C9A84C;
  margin-bottom: 0.4rem;
}

.nt-pills { display: flex; flex-wrap: wrap; gap: 0.28rem; }

.nt-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #F4F6FA;
  border: 1px solid rgba(27, 42, 74, 0.1);
  color: #374151;
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 500;
}

.nt-pill-icon { font-size: 0.72rem; }

/* ---------- Description ---------- */
.nt-desc {
  font-size: 0.75rem;
  color: #6B7280;
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

.nt-desc strong { color: #1B2A4A; font-weight: 600; }

/* Bloc spécial avocats */
.nt-desc-law {
  background: rgba(27, 42, 74, 0.04);
  border-left: 2px solid #C9A84C;
  border-radius: 0 6px 6px 0;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.65rem;
}

/* ---------- Outils / Agents — liste compacte ---------- */
.nt-tool-list {
  list-style: none;
  margin: 0 0 0.7rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.nt-tool-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nt-tl-icon { font-size: 0.82rem; flex-shrink: 0; line-height: 1; }

.nt-tool-label {
  font-size: 0.7rem;
  color: #374151;
  font-weight: 500;
  line-height: 1.2;
}

.nt-tl-sub {
  font-size: 0.65rem;
  color: #9CA3AF;
  font-weight: 400;
}

/* ---------- Séparateur ---------- */
.nt-sep {
  height: 1px;
  background: rgba(27, 42, 74, 0.07);
  margin: 0.6rem 0;
}

/* ---------- Contacts — côte à côte ---------- */
.nt-contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.nt-contact-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.18rem;
  padding: 0.6rem 0.4rem 0.5rem;
  background: #F8F9FB;
  border: 1px solid rgba(27, 42, 74, 0.08);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.nt-contact-row:hover { border-color: rgba(201, 168, 76, 0.4); }

.nt-contact-flag { font-size: 1.8rem; line-height: 1; margin-bottom: 0.15rem; display: block; }

.nt-contact-info { display: flex; flex-direction: column; align-items: center; gap: 0.06rem; width: 100%; }

.nt-contact-place {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #C9A84C;
}

.nt-contact-num {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1B2A4A;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

/* numéros non cliquables — texte simple */

/* Chip WhatsApp */
.nt-contact-actions { display: flex; justify-content: center; margin-top: 0.3rem; }

.nt-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #25D366;
  color: #FFFFFF;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nt-wa-btn:hover {
  background: #1ebe5d;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.4);
}

.nt-wa-btn svg { flex-shrink: 0; }

/* ---------- Site web ---------- */
.nt-website-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1B2A4A;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  padding: 0.5rem 0.8rem;
  background: rgba(201, 168, 76, 0.07);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.nt-website-row:hover {
  background: rgba(201, 168, 76, 0.14);
  border-color: rgba(201, 168, 76, 0.5);
  color: #92700A;
}

/* ---------- Langues parlées ---------- */
.nt-spoken {
  text-align: center;
  font-size: 0.7rem;
  color: #9CA3AF;
  font-style: italic;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

/* ---------- Bouton fermer ---------- */
.nt-close-btn {
  width: 100%;
  padding: 0.7rem;
  background: linear-gradient(135deg, #1B2A4A, #243660);
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.25s ease;
  box-shadow: 0 3px 14px rgba(27, 42, 74, 0.25);
}

.nt-close-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(27, 42, 74, 0.35);
  background: linear-gradient(135deg, #243660, #2d4275);
}

/* ---------- Langue toggle ---------- */

/* Par défaut tout est caché — SCOPPÉ à #nt-popup uniquement */
#nt-popup [data-lang] { display: none !important; }

/* Éléments block quand actifs */
#nt-popup [data-lang].nt-active,
#nt-popup .nt-services-title[data-lang].nt-active,
#nt-popup .nt-desc[data-lang].nt-active,
#nt-popup .nt-spoken[data-lang].nt-active,
#nt-popup .nt-close-btn[data-lang].nt-active { display: block !important; }

/* Éléments inline-flex quand actifs (pills) */
#nt-popup .nt-pill[data-lang].nt-active { display: inline-flex !important; }

/* Éléments inline quand actifs (spans dans un conteneur flex) */
#nt-popup .nt-badge-text[data-lang].nt-active,
#nt-popup .nt-logo-tagline[data-lang].nt-active,
#nt-popup .nt-contact-place[data-lang].nt-active,
#nt-popup .nt-tool-label[data-lang].nt-active { display: inline !important; }

/* ---------- RTL hébreu ---------- */
#nt-popup.nt-rtl .nt-body         { direction: rtl; }
#nt-popup.nt-rtl .nt-header       { direction: rtl; }
#nt-popup.nt-rtl .nt-logo         { flex-direction: row-reverse; }
#nt-popup.nt-rtl .nt-controls     { flex-direction: row-reverse; }
#nt-popup.nt-rtl .nt-contact-row  { text-align: right; }
#nt-popup .nt-contact-num          { direction: ltr; unicode-bidi: isolate; }
#nt-popup.nt-rtl .nt-pills        { direction: rtl; }
#nt-popup.nt-rtl .nt-tools        { direction: rtl; }
#nt-popup.nt-rtl [data-lang="he"] { font-family: 'Segoe UI', Arial, sans-serif; }

/* ============================================
   RESPONSIVE — TÉLÉPHONE PORTABLE
   ≤ 600px : bottom sheet compact
   ≤ 390px : petit écran
   ============================================ */

@media (max-width: 600px) {

  /* Overlay collé en bas */
  #nt-overlay { align-items: flex-end; padding: 0; }

  /* Carte bottom-sheet */
  #nt-popup {
    max-width: 100%;
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 72vh;            /* limité à 72% — popup petit */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    opacity: 1;
    transition: transform 0.38s cubic-bezier(0.34, 1.2, 0.64, 1);
  }

  #nt-overlay.nt-visible #nt-popup { transform: translateY(0); }

  #nt-popup::before { border-radius: 16px 16px 0 0; }

  /* Poignée fine */
  #nt-popup::after {
    content: '';
    display: block;
    width: 28px; height: 3px;
    background: rgba(27, 42, 74, 0.12);
    border-radius: 2px;
    margin: 0.45rem auto 0;
    order: -1;
    flex-shrink: 0;
  }

  /* En-tête serré */
  .nt-header       { padding: 0.55rem 0.9rem 0.5rem; flex-shrink: 0; }
  .nt-logo-mark    { width: 26px; height: 26px; }
  .nt-logo-mark svg { width: 14px; height: 14px; }
  .nt-logo-name    { font-size: 0.82rem; }
  .nt-logo-tagline { font-size: 0.54rem; }

  /* Corps scrollable */
  .nt-body {
    padding: 0.65rem 0.9rem 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }

  /* Badge */
  .nt-badge { font-size: 0.58rem; padding: 0.22rem 0.65rem; margin-bottom: 0.6rem; }

  /* Boutons langue + fermer */
  .nt-controls        { gap: 0.3rem; }
  .nt-lang-switch-btn { padding: 0.25rem 0.45rem; font-size: 0.6rem; min-height: 28px; touch-action: manipulation; }
  .nt-close-x         { width: 30px; height: 30px; font-size: 0.75rem; touch-action: manipulation; }

  /* Services & pills */
  .nt-services       { margin-bottom: 0.6rem; }
  .nt-services-title { font-size: 0.58rem; margin-bottom: 0.4rem; }
  .nt-pills          { gap: 0.25rem; }
  .nt-pill           { font-size: 0.68rem; padding: 0.2rem 0.5rem; }
  .nt-pill-icon      { font-size: 0.7rem; }

  /* Description */
  .nt-desc { font-size: 0.72rem; margin-bottom: 0.6rem; line-height: 1.45; }

  /* Outils */
  .nt-tools    { gap: 0.3rem; margin-bottom: 0.65rem; }
  .nt-tool-item { padding: 0.38rem 0.5rem; gap: 0.35rem; }
  .nt-tool-icon  { font-size: 0.9rem; }
  .nt-tool-label { font-size: 0.62rem; }
  .nt-tool-count { font-size: 0.55rem; }

  /* Séparateur */
  .nt-sep { margin: 0.6rem 0; }

  /* Site web */
  .nt-website-row { font-size: 0.72rem; padding: 0.42rem 0.7rem; margin-bottom: 0.6rem; }

  /* Contacts côte à côte — conservé sur mobile */
  .nt-contacts      { gap: 0.3rem; margin-bottom: 0.65rem; }
  .nt-contact-row   { padding: 0.5rem 0.3rem 0.45rem; }
  .nt-contact-flag  { font-size: 1.2rem; }
  .nt-contact-place { font-size: 0.53rem; }
  .nt-contact-num   { font-size: 0.66rem; }
  .nt-contact-num a { touch-action: manipulation; }
  .nt-wa-btn        { font-size: 0.56rem; padding: 0.18rem 0.45rem; }

  /* Langues parlées */
  .nt-spoken { font-size: 0.6rem; margin-bottom: 0.65rem; }

  /* Bouton fermer */
  .nt-close-btn {
    padding: 0.65rem;
    font-size: 0.78rem;
    min-height: 42px;
    touch-action: manipulation;
    transition: opacity 0.15s ease;
  }
  .nt-close-btn:hover  { transform: none; }
  .nt-close-btn:active { opacity: 0.85; transform: scale(0.98); }
}

/* --- Très petits écrans ≤ 390px --- */
@media (max-width: 390px) {

  #nt-popup    { max-height: 78vh; }   /* un peu plus de hauteur si très petit */

  .nt-header   { padding: 0.5rem 0.8rem 0.45rem; }
  .nt-body     { padding: 0.55rem 0.8rem 0.9rem; }

  .nt-logo-name  { font-size: 0.78rem; }
  .nt-pill       { font-size: 0.64rem; padding: 0.18rem 0.45rem; }
  .nt-tool-label { font-size: 0.58rem; }
  .nt-contact-num { font-size: 0.72rem; }
  .nt-website-row { font-size: 0.68rem; }
  .nt-close-btn   { font-size: 0.74rem; min-height: 40px; }
}
