/* ==========================================
   FlowTailor - Custom Styles
   Beyond Tailwind: animations, form, RTL
   ========================================== */

/* ---- Smooth scroll ---- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

/* ---- Header transitions ---- */
#site-header {
  background: transparent;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#site-header.scrolled {
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#site-header .header-logo-flow {
  color: #fff;
  transition: color 0.3s ease;
}

#site-header.scrolled .header-logo-flow {
  color: #1a1a2e;
}

#site-header a:not([class*="bg-"]) {
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.3s ease;
}

#site-header.scrolled a:not([class*="bg-"]) {
  color: #1a1a2e;
}

#site-header.scrolled a:not([class*="bg-"]):hover {
  color: #4361ee;
}

#site-header #mobile-menu-btn {
  color: #fff;
  transition: color 0.3s ease;
}

#site-header.scrolled #mobile-menu-btn {
  color: #1a1a2e;
}

/* ---- Hero animations ---- */
.animate-fade-in {
  opacity: 0;
  animation: fadeInUp 0.7s ease-out forwards;
}

.animate-fade-in-delay-1 {
  opacity: 0;
  animation: fadeInUp 0.7s ease-out 0.15s forwards;
}

.animate-fade-in-delay-2 {
  opacity: 0;
  animation: fadeInUp 0.7s ease-out 0.3s forwards;
}

.animate-fade-in-delay-3 {
  opacity: 0;
  animation: fadeInUp 0.7s ease-out 0.45s forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Scroll-triggered fade-in ---- */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Form steps ---- */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- Step indicator ---- */
.step-indicator .step-number {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.step-indicator .step-label {
  transition: color 0.3s ease;
}

.step-indicator.active .step-number {
  background-color: #4361ee;
  color: #fff;
}

.step-indicator.active .step-label {
  color: #1a1a2e;
  font-weight: 600;
}

.step-indicator.completed .step-number {
  background-color: #06d6a0;
  color: #fff;
}

.step-indicator.completed .step-label {
  color: #06d6a0;
}

.step-line {
  transition: background-color 0.3s ease;
}

.step-line.completed {
  background-color: #06d6a0;
}

/* ---- Form inputs ---- */
/* Validation styles handled via JS .form-error.show */

.form-error.show {
  display: block !important;
}

/* Tool checkbox selected state */
.tool-checkbox:has(input:checked) {
  border-color: rgba(67, 97, 238, 0.4);
  background-color: rgba(67, 97, 238, 0.04);
}

/* Radio/checkbox custom color */
input[type="radio"]:checked,
input[type="checkbox"]:checked {
  accent-color: #4361ee;
}

/* Radio/checkbox container selected state */
label:has(input[type="radio"]:checked) {
  border-color: rgba(67, 97, 238, 0.4);
  background-color: rgba(67, 97, 238, 0.04);
}

/* ---- FAQ accordion ---- */
.faq-icon {
  transition: transform 0.3s ease;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.faq-item.open .faq-answer {
  display: block;
  max-height: 500px;
}

/* ---- Mobile menu ---- */
#mobile-menu {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  display: block !important;
}

#mobile-menu.open {
  max-height: 400px;
  opacity: 1;
}

/* ---- Success overlay ---- */
#success-overlay {
  opacity: 0;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
}

#success-overlay.show {
  display: flex;
  opacity: 1;
  pointer-events: all;
}

#success-overlay > div {
  transform: scale(0.95);
  transition: transform 0.3s ease-out;
}

#success-overlay.show > div {
  transform: scale(1);
}

/* ---- Responsive table ---- */
@media (max-width: 640px) {
  #value table {
    font-size: 0.8125rem;
  }
  #value table th,
  #value table td {
    padding: 0.75rem 1rem;
  }
}

/* ---- Selection color ---- */
::selection {
  background-color: rgba(67, 97, 238, 0.15);
  color: #1a1a2e;
}

/* ---- Focus visible ---- */
:focus-visible {
  outline: 2px solid #4361ee;
  outline-offset: 2px;
}

/* ---- Scrollbar (subtle) ---- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f8f9fa;
}

::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* ==========================================
   RTL Overrides (for Hebrew page)
   ========================================== */
[dir="rtl"] .faq-icon {
  /* Chevron still points down in RTL */
}

[dir="rtl"] .btn-next svg,
[dir="rtl"] .btn-prev svg {
  transform: scaleX(-1);
}

[dir="rtl"] .step-indicator {
  flex-direction: row-reverse;
}

[dir="rtl"] select {
  background-position: left 1rem center;
  padding-left: 2.5rem;
  padding-right: 1rem;
}

[dir="rtl"] .tool-checkbox {
  flex-direction: row-reverse;
}

/* Hebrew page WhatsApp button */
.whatsapp-btn {
  background-color: #25D366;
  color: #fff;
  transition: background-color 0.2s ease;
}

.whatsapp-btn:hover {
  background-color: #1da851;
}

/* ---- Print styles ---- */
@media print {
  #site-header,
  #mobile-menu,
  #success-overlay,
  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
}
