/* ═══════════════════════════════════════════
   ZELLENIUM — modal.css
   Lead-capture modal: backdrop + step form
   ═══════════════════════════════════════════ */

/* ── Backdrop ───────────────────────────── */
.zl-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(6, 6, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.zl-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal card ─────────────────────────── */
.zl-modal {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow:
    0 0 0 1px rgba(0,212,255,.06),
    0 40px 100px rgba(0,0,0,.7),
    0 0 80px rgba(0,212,255,.04);
  transform: translateY(28px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), opacity 0.35s ease;
  opacity: 0;
}

.zl-modal-backdrop.is-open .zl-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── Sidebar ────────────────────────────── */
.zl-modal-sidebar {
  background: rgba(10,10,24,0.9);
  border-right: 1px solid rgba(255,255,255,.06);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  overflow: hidden;
}

.zl-modal-sidebar::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(0,212,255,.07) 0%, transparent 70%);
  pointer-events: none;
}

.zl-modal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.zl-modal-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-sans);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.04em;
}

.zl-modal-brand-name {
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.01em;
}

/* Steps list */
.zl-steps {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.zl-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  padding-bottom: 32px;
}

.zl-step:last-child {
  padding-bottom: 0;
}

/* Vertical connector line */
.zl-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 18px;
  top: 40px;
  width: 2px;
  height: calc(100% - 10px);
  background: rgba(255,255,255,.07);
  border-radius: 2px;
  transition: background 0.4s ease;
}

.zl-step.is-done:not(:last-child)::after {
  background: linear-gradient(to bottom, #00d4ff, rgba(0,212,255,.2));
}

/* Step icon */
.zl-step-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.3);
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.zl-step.is-active .zl-step-icon {
  border-color: var(--c-cyan);
  background: rgba(0,212,255,.12);
  color: var(--c-cyan);
  box-shadow: 0 0 20px rgba(0,212,255,.2);
}

.zl-step.is-done .zl-step-icon {
  border-color: var(--c-cyan);
  background: rgba(0,212,255,.15);
  color: var(--c-cyan);
}

/* Step text */
.zl-step-info {
  padding-top: 8px;
}

.zl-step-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  margin-bottom: 2px;
  transition: color 0.3s;
}

.zl-step-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.35);
  transition: color 0.3s;
}

.zl-step.is-active .zl-step-num  { color: var(--c-cyan); }
.zl-step.is-active .zl-step-label { color: var(--c-text); }
.zl-step.is-done   .zl-step-label { color: rgba(255,255,255,.55); }

/* ── Form panel ─────────────────────────── */
.zl-modal-body {
  background: rgba(13,13,28,0.95);
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

/* Close button */
.zl-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  z-index: 10;
}

.zl-modal-close:hover {
  background: rgba(255,80,80,.1);
  border-color: rgba(255,80,80,.25);
  color: rgba(255,100,100,.9);
}

/* ── Form steps ─────────────────────────── */
.zl-form-step {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: stepIn 0.35s cubic-bezier(0.16,1,0.3,1);
}

.zl-form-step.is-active {
  display: flex;
}

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

.zl-step-title {
  font-family: var(--f-sans);
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 6px;
}

.zl-step-subtitle {
  font-size: 14px;
  color: var(--c-text-2);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* Form fields */
.zl-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.zl-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.zl-input,
.zl-select {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 13px 16px;
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--c-text);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.zl-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.zl-select option {
  background: #0e0e22;
  color: var(--c-text);
}

.zl-input::placeholder { color: rgba(255,255,255,.2); }

.zl-input:focus,
.zl-select:focus {
  border-color: rgba(0,212,255,.45);
  background: rgba(0,212,255,.04);
  box-shadow: 0 0 0 3px rgba(0,212,255,.08);
}

.zl-input.has-error,
.zl-select.has-error {
  border-color: rgba(255,80,80,.5);
  box-shadow: 0 0 0 3px rgba(255,80,80,.06);
}

.zl-field-error {
  font-size: 11px;
  color: rgba(255,90,90,.85);
  display: none;
}

.zl-field-error.visible { display: block; }

.zl-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Chips / option pills */
.zl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.zl-chip {
  padding: 8px 16px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  font-size: 13px;
  color: var(--c-text-2);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.zl-chip:hover {
  border-color: rgba(0,212,255,.3);
  color: var(--c-text);
}

.zl-chip.is-selected {
  border-color: var(--c-cyan);
  background: rgba(0,212,255,.1);
  color: var(--c-cyan);
}

/* Navigation buttons */
.zl-form-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
}

.zl-btn-back {
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}

.zl-btn-back:hover {
  background: rgba(255,255,255,.05);
  color: var(--c-text);
}

.zl-btn-next {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #00d4ff, #0088ff, #7c3aed);
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: opacity var(--t-fast), transform var(--t-fast);
  letter-spacing: 0.01em;
}

.zl-btn-next:hover  { opacity: 0.88; transform: translateY(-1px); }
.zl-btn-next:active { transform: translateY(0); }

.zl-btn-next.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Progress bar */
.zl-progress {
  height: 2px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}

.zl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d4ff, #7c3aed);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.16,1,0.3,1);
}

/* ── Success screen ──────────────────────── */
.zl-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  gap: 16px;
  animation: stepIn 0.4s cubic-bezier(0.16,1,0.3,1);
}

.zl-success.is-active { display: flex; }

.zl-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0,220,130,.12);
  border: 2px solid rgba(0,220,130,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00dc82;
  margin-bottom: 8px;
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes successPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.zl-success-title {
  font-family: var(--f-sans);
  font-size: 22px;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.04em;
}

.zl-success-text {
  font-size: 14px;
  color: var(--c-text-2);
  line-height: 1.6;
  max-width: 300px;
}

.zl-success-highlight {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: rgba(0,212,255,.08);
  border: 1px solid rgba(0,212,255,.2);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-cyan);
  letter-spacing: 0.04em;
}

.zl-btn-close-success {
  margin-top: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}

.zl-btn-close-success:hover {
  background: rgba(255,255,255,.09);
  color: var(--c-text);
}

/* ── Responsivo ─────────────────────────── */
@media (max-width: 680px) {
  .zl-modal-backdrop { padding: 16px; align-items: center; }

  .zl-modal {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: 88vh;
    border-radius: 20px;
  }

  .zl-modal-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: 12px 16px 10px;
  }

  /* Esconde logo e nome no mobile para economizar espaço */
  .zl-modal-brand { display: none; }

  .zl-steps {
    flex-direction: row;
    gap: 0;
    overflow-x: auto;
  }

  .zl-step {
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding-bottom: 0;
    padding-right: 0;
    text-align: center;
    gap: 4px;
  }

  .zl-step:not(:last-child)::after {
    top: 16px;
    left: calc(50% + 18px);
    width: calc(100% - 36px);
    height: 2px;
  }

  .zl-step-info  { padding-top: 0; }
  .zl-step-num   { display: none; }
  .zl-step-label { font-size: 11px; }
  .zl-step-icon  { width: 30px; height: 30px; }

  .zl-modal-body    { padding: 16px 16px 20px; overflow-y: auto; }
  .zl-field-row     { grid-template-columns: 1fr; }
  .zl-step-subtitle { margin-bottom: 20px; font-size: 13px; }
  .zl-step-title    { font-size: 20px; }
  .zl-field         { margin-bottom: 12px; }
  .zl-form-nav      { padding-top: 16px; }
  .zl-progress      { margin-bottom: 20px; }
}
