/* ============================================================
   CF7 Multistep Full++ - Frontend Styles
   Author: Full++
   ============================================================ */

/* CSS Custom Properties - overridden by JS from settings */
:root {
  --cf7ms-primary:        #006747;
  --cf7ms-secondary:      #204c8e;
  --cf7ms-progress-bg:    #e0e0e0;
  --cf7ms-progress-fill:  #006747;
  --cf7ms-tab-active-bg:  #006747;
  --cf7ms-tab-active-fg:  #ffffff;
  --cf7ms-tab-bg:         #f0f0f0;
  --cf7ms-tab-fg:         #333333;
  --cf7ms-radius:         6px;
  --cf7ms-transition:     0.35s ease;
}

/* ── WRAPPER ──────────────────────────────────────────────── */
.cf7ms-wrapper {
  position: relative;
  overflow: hidden;
}

/* ── PROGRESS AREA ───────────────────────────────────────── */
.cf7ms-progress-area {
  margin-bottom: 20px;
}

.cf7ms-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85em;
  color: #555;
  font-weight: 600;
}

.cf7ms-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--cf7ms-progress-bg);
  border-radius: 99px;
  overflow: hidden;
}

.cf7ms-progress-bar-fill {
  height: 100%;
  background: var(--cf7ms-progress-fill);
  border-radius: 99px;
  transition: width var(--cf7ms-transition);
  width: 0%;
}

.cf7ms-percentage {
  font-size: 0.9em;
  font-weight: 700;
  color: var(--cf7ms-primary);
}

/* ── TABS ────────────────────────────────────────────────── */
.cf7ms-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--cf7ms-progress-bg);
  padding-bottom: 0;
}

.cf7ms-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-bottom: 3px solid transparent;
  background: var(--cf7ms-tab-bg);
  color: var(--cf7ms-tab-fg);
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--cf7ms-radius) var(--cf7ms-radius) 0 0;
  transition: background var(--cf7ms-transition), color var(--cf7ms-transition), border-color var(--cf7ms-transition);
  position: relative;
  bottom: -2px;
  outline: none;
}

.cf7ms-tab:hover:not(.is-active):not(.is-locked) {
  background: color-mix(in srgb, var(--cf7ms-tab-active-bg) 20%, white);
  color: var(--cf7ms-tab-active-bg);
}

.cf7ms-tab.is-active {
  background: var(--cf7ms-tab-active-bg);
  color: var(--cf7ms-tab-active-fg);
  border-bottom-color: var(--cf7ms-tab-active-bg);
}

.cf7ms-tab.is-completed::after {
  content: ' ✓';
  font-size: 0.8em;
  opacity: 0.8;
}

.cf7ms-tab.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.cf7ms-tab-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  font-size: 0.78em;
  font-weight: 700;
  flex-shrink: 0;
}

.cf7ms-tab.is-active .cf7ms-tab-number {
  background: rgba(255,255,255,0.4);
}

/* ── STEPS ───────────────────────────────────────────────── */
.cf7ms-step {
  display: none;
}

.cf7ms-step.is-active {
  display: block;
  animation-duration: var(--cf7ms-transition);
  animation-fill-mode: both;
}

/* Slide animations */
.cf7ms-step.anim-slide-in-right {
  animation-name: cf7ms-slide-in-right;
}
.cf7ms-step.anim-slide-in-left {
  animation-name: cf7ms-slide-in-left;
}
.cf7ms-step.anim-fade-in {
  animation-name: cf7ms-fade-in;
}

@keyframes cf7ms-slide-in-right {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes cf7ms-slide-in-left {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes cf7ms-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── NAVIGATION BUTTONS ──────────────────────────────────── */
.cf7ms-nav {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.cf7ms-nav.pos-left          { justify-content: flex-start; }
.cf7ms-nav.pos-center        { justify-content: center; }
.cf7ms-nav.pos-right         { justify-content: flex-end; }
.cf7ms-nav.pos-space-between { justify-content: space-between; }

.cf7ms-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--cf7ms-radius);
  border: 2px solid var(--cf7ms-primary);
  background: var(--cf7ms-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.95em;
  cursor: pointer;
  transition: background var(--cf7ms-transition), border-color var(--cf7ms-transition), color var(--cf7ms-transition);
  line-height: 1.4;
  text-decoration: none;
}

.cf7ms-btn:hover {
  background: var(--cf7ms-secondary);
  border-color: var(--cf7ms-secondary);
  color: #fff;
}

.cf7ms-btn-prev {
  background: transparent;
  color: var(--cf7ms-primary);
}

.cf7ms-btn-prev:hover {
  background: var(--cf7ms-primary);
  color: #fff;
}

.cf7ms-btn:disabled,
.cf7ms-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Hide prev on first step */
.cf7ms-nav .cf7ms-btn-prev[data-hidden="true"] {
  visibility: hidden;
}

/* ── VALIDATION ERRORS ───────────────────────────────────── */
.cf7ms-step-error {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--cf7ms-radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.88em;
  color: #856404;
  display: none;
}

.cf7ms-step-error.is-visible {
  display: block;
  animation: cf7ms-fade-in 0.2s ease both;
}

/* Highlight invalid fields */
.cf7ms-field-invalid input,
.cf7ms-field-invalid select,
.cf7ms-field-invalid textarea {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 2px rgba(220,53,69,0.15);
}

/* ── STEP INDICATOR (bottom bullet dots) ─────────────────── */
.cf7ms-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.cf7ms-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cf7ms-progress-bg);
  transition: background var(--cf7ms-transition), transform var(--cf7ms-transition);
}

.cf7ms-dot.is-active {
  background: var(--cf7ms-primary);
  transform: scale(1.3);
}

.cf7ms-dot.is-completed {
  background: color-mix(in srgb, var(--cf7ms-primary) 50%, white);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .cf7ms-tabs {
    gap: 4px;
  }
  .cf7ms-tab {
    padding: 6px 10px;
    font-size: 0.8em;
  }
  .cf7ms-btn {
    padding: 9px 16px;
    font-size: 0.88em;
  }
}
