/* ==========================================================================
   Syllab.ai - Promo Top Banner & Step-by-Step Modal Stylesheet
   Theme: Obsidian Dark with Vibrant Syllab Electric Red (#FF2A3A)
   ========================================================================== */

:root {
  --syllab-promo-bg: #0a0a0c;
  --syllab-promo-border: rgba(255, 42, 58, 0.35);
  --syllab-promo-red: #ff2a3a;
  --syllab-promo-red-hover: #ff4757;
  --syllab-promo-red-glow: rgba(255, 42, 58, 0.4);
  --syllab-promo-text: #ffffff;
  --syllab-promo-muted: #a1a1aa;
  --syllab-promo-height: 38px;
}

/* --------------------------------------------------------------------------
   Top Sticky / Prepended Banner - Fully Clickable Header
   -------------------------------------------------------------------------- */
#syllab-top-banner {
  position: relative;
  width: 100%;
  height: var(--syllab-promo-height);
  min-height: var(--syllab-promo-height);
  background: linear-gradient(90deg, #090a0f 0%, #12131b 50%, #090a0f 100%);
  border-bottom: 1px solid var(--syllab-promo-border);
  box-shadow: 0 2px 14px rgba(255, 42, 58, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--syllab-promo-text);
  box-sizing: border-box;
  padding: 0 44px 0 16px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

#syllab-top-banner:hover {
  background: linear-gradient(90deg, #0b0c14 0%, rgba(255, 42, 58, 0.1) 50%, #0b0c14 100%);
  border-bottom-color: rgba(255, 42, 58, 0.5);
  box-shadow: 0 3px 18px rgba(255, 42, 58, 0.22);
}

#syllab-top-banner:focus-visible {
  outline: 2px solid var(--syllab-promo-red);
  outline-offset: -2px;
}

#syllab-top-banner.closing {
  height: 0 !important;
  min-height: 0 !important;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.syllab-banner-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  color: inherit;
  max-width: 100%;
}

.syllab-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 42, 58, 0.12);
  border: 1px solid rgba(255, 42, 58, 0.35);
  color: #ff5260;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2.5px 8px;
  border-radius: 9999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.syllab-badge-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background-color: var(--syllab-promo-red);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--syllab-promo-red);
  animation: syllabPulse 2s infinite ease-in-out;
}

@keyframes syllabPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 10px var(--syllab-promo-red); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.syllab-banner-text {
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Arrow indicator with hover nudge */
.syllab-banner-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--syllab-promo-red);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  flex-shrink: 0;
}

#syllab-top-banner:hover .syllab-banner-arrow {
  transform: translateX(4px);
  color: var(--syllab-promo-red-hover);
}

/* Standalone Close Button */
.syllab-banner-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--syllab-promo-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
  z-index: 5;
}

.syllab-banner-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.syllab-banner-close:focus-visible {
  outline: 2px solid var(--syllab-promo-red);
  outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   Step-by-Step Promo Popup Modal
   -------------------------------------------------------------------------- */
.syllab-promo-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 8, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.syllab-promo-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.syllab-promo-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: #111215;
  border: 1px solid rgba(255, 42, 58, 0.35);
  border-radius: 18px;
  box-shadow: 0 16px 32px -10px rgba(0, 0, 0, 0.8), 0 0 12px -3px rgba(255, 42, 58, 0.25);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  transform: scale(0.94) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.syllab-promo-modal-backdrop.active .syllab-promo-modal {
  transform: scale(1) translateY(0);
}

.syllab-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
}

.syllab-modal-close:hover {
  background: var(--syllab-promo-red);
  border-color: var(--syllab-promo-red);
  transform: rotate(90deg);
}

.syllab-modal-banner-wrap {
  width: 100%;
  height: 125px;
  min-height: 125px;
  position: relative;
  overflow: hidden;
  background: #000000;
  flex-shrink: 0;
}

.syllab-modal-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.syllab-modal-banner-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 55px;
  background: linear-gradient(to bottom, rgba(17, 18, 21, 0) 0%, rgba(17, 18, 21, 1) 100%);
  pointer-events: none;
}

.syllab-modal-body {
  padding: 4px 20px 20px 20px;
  box-sizing: border-box;
  overflow-y: auto;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}

.syllab-modal-header-text {
  text-align: center;
  margin-top: 4px;
  margin-bottom: 14px;
  position: relative;
}

.syllab-modal-title {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 4px 0;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.syllab-modal-subtitle {
  font-size: 12.5px;
  color: var(--syllab-promo-muted);
  margin: 0;
  line-height: 1.35;
}

/* Auto-applied Pre-checkout Badge (Replaces manual coupon copy box) */
.syllab-modal-auto-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 9999px;
  padding: 6px 14px;
  margin-bottom: 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: #34d399;
  text-align: center;
  letter-spacing: -0.01em;
}

.syllab-auto-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
  display: inline-block;
  animation: syllabGreenPulse 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes syllabGreenPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 10px #10b981; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Steps List */
.syllab-modal-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.syllab-modal-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 9px 12px;
}

.syllab-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: rgba(255, 42, 58, 0.2);
  color: #ff4d5a;
  border: 1px solid rgba(255, 42, 58, 0.4);
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  margin-top: 1px;
  flex-shrink: 0;
}

.syllab-step-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.syllab-step-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f4f4f5;
  margin: 0;
}

.syllab-step-desc {
  font-size: 11.5px;
  color: var(--syllab-promo-muted);
  margin: 0;
  line-height: 1.35;
}

/* Primary Modal CTA */
.syllab-modal-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 18px;
  background: linear-gradient(135deg, #ff2a3a 0%, #d8001a 100%);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(255, 42, 58, 0.35);
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.syllab-modal-cta-btn:hover {
  background: linear-gradient(135deg, #ff3d4c 0%, #ee001d 100%);
  box-shadow: 0 6px 24px rgba(255, 42, 58, 0.55);
  transform: translateY(-1px);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Responsive Layouts: PC, Foldable Book (Honor Magic V6), Mobile
   -------------------------------------------------------------------------- */
.syllab-text-mobile {
  display: none;
}
.syllab-text-desktop {
  display: inline;
}

/* 📱 Format Mobile & Folded Screen (< 520px) :
   Standard phones (360px - 430px) & Folded Honor Magic V6 outer screen */
@media (max-width: 519px) {
  #syllab-top-banner {
    padding: 0 38px 0 12px;
    height: 36px;
    min-height: 36px;
  }
  .syllab-banner-inner {
    gap: 6px;
  }
  .syllab-banner-badge {
    display: none; /* Cache le badge pour maximiser l'espace de la phrase vendeur */
  }
  .syllab-text-desktop {
    display: none;
  }
  .syllab-text-mobile {
    display: inline;
    font-size: 12.5px;
  }
  .syllab-banner-arrow svg {
    width: 14px;
    height: 14px;
  }
  .syllab-modal-banner-wrap {
    height: 100px;
    min-height: 100px;
  }
  .syllab-modal-body {
    padding: 4px 16px 16px 16px;
  }
  .syllab-modal-title {
    font-size: 19px;
  }
  .syllab-promo-modal {
    box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.8), 0 0 10px -2px rgba(255, 42, 58, 0.2);
  }
}

/* 📖 Format Pliable "Book" (520px - 768px) :
   Honor Magic V6 / V3 écran déplié (~700px - 768px), tablettes compactes */
@media (min-width: 520px) and (max-width: 768px) {
  #syllab-top-banner {
    padding: 0 40px 0 16px;
  }
  .syllab-banner-inner {
    gap: 8px;
  }
  .syllab-banner-badge {
    font-size: 9.5px;
    padding: 2px 7px;
  }
  .syllab-text-desktop {
    display: inline;
    font-size: 12.5px;
  }
  .syllab-text-mobile {
    display: none;
  }
  .syllab-modal-banner-wrap {
    height: 115px;
    min-height: 115px;
  }
}

/* 💻 Format PC / Desktop (>= 769px) :
   Laptops & Desktop */
@media (min-width: 769px) {
  .syllab-text-desktop {
    display: inline;
    font-size: 13px;
  }
  .syllab-text-mobile {
    display: none;
  }
}
