/* ============================================================
   ACROBRANCH — ANIMATIONS (scroll reveal, progress bar)
   ============================================================ */

/* ---- READ PROGRESS BAR ---- */
#read-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--color-accent);
  z-index: 9999;
  transition: none;
}

/* ---- PAGE LOADER ---- */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-offwhite);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity .4s ease;
}
#page-loader.fade-out { opacity: 0; pointer-events: none; }
.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.loader-inner img { width: 80px; height: auto; animation: loaderPulse 1.2s ease-in-out infinite; }
.loader-bar-wrap {
  width: 160px;
  height: 3px;
  background: var(--color-gray-light);
  border-radius: 99px;
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  animation: loaderFill 2s ease forwards;
}
@keyframes loaderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .7; transform: scale(.95); }
}
@keyframes loaderFill {
  0%   { width: 0%; }
  80%  { width: 90%; }
  100% { width: 100%; }
}

/* ---- TOAST NOTIFICATIONS ---- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  z-index: 99998;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--color-white);
  color: var(--color-dark);
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 340px;
  font-size: .9rem;
  font-weight: 600;
  pointer-events: all;
  animation: toastIn .35s cubic-bezier(.34,1.56,.64,1);
}
.toast.hiding { animation: toastOut .25s ease forwards; }
.toast-success { border-left: 4px solid #22c55e; }
.toast-error   { border-left: 4px solid var(--color-accent); }
.toast-info    { border-left: 4px solid var(--color-primary); }
@keyframes toastIn  { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:none; } }
@keyframes toastOut { to   { opacity:0; transform:translateX(40px); } }

/* ---- STICKY MOBILE CTA ---- */
#sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  background: var(--color-white);
  border-top: 1px solid var(--color-gray-light);
  padding: .75rem 1rem;
  gap: .75rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
  transition: transform .3s ease;
}
#sticky-cta.visible { display: flex; }
#sticky-cta.hidden  { transform: translateY(100%); }
#sticky-cta .btn    { flex: 1; justify-content: center; font-size: .9rem; padding: .7rem 1rem; }

/* ---- RIPPLE ---- */
.btn-primary { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnim .5s linear;
  background: rgba(255,255,255,.35);
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* ---- PAGE TRANSITION ---- */
body.page-exit { animation: pageExit .18s ease forwards; }
@keyframes pageExit { to { opacity: 0; } }

/* ---- QUIZ ---- */
.quiz-section {
  padding: var(--section-padding);
  background: var(--color-beige);
}
.quiz-widget {
  max-width: 680px;
  margin: 2rem auto 0;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
}
.quiz-step { display: none; animation: fadeInUp .4s ease; }
.quiz-step.active { display: block; }
.quiz-question {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 1.5rem;
}
.quiz-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.quiz-btn {
  padding: .85rem 1rem;
  border: 2px solid var(--color-gray-light);
  border-radius: var(--radius-md);
  background: var(--color-offwhite);
  color: var(--color-dark);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: left;
}
.quiz-btn:hover, .quiz-btn.selected {
  border-color: var(--color-primary);
  background: rgba(27,67,50,.07);
  color: var(--color-primary);
}
.quiz-progress {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.5rem;
}
.quiz-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gray-light);
  transition: background var(--transition);
}
.quiz-progress-dot.done { background: var(--color-primary); }
.quiz-result {
  text-align: center;
  animation: fadeInUp .5s ease;
}
.quiz-result-badge {
  display: inline-block;
  padding: .4rem 1.2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .05em;
  margin-bottom: 1rem;
}
.quiz-result h3 { font-size: 1.5rem; color: var(--color-primary); margin-bottom: .5rem; }
.quiz-result p  { color: var(--color-gray); margin-bottom: 1.25rem; }
.quiz-result-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}
.quiz-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
@media (max-width: 480px) {
  .quiz-answers { grid-template-columns: 1fr; }
  .quiz-widget  { padding: 1.75rem 1.25rem; }
}
