/* ==========================================================================
   HÉCTOR CASTILLO - GENERADOR DE FORMULARIOS PARA WHATSAPP
   EXECUTIVE BUILDER UI STYLESHEET (wa-builder.css)
   ========================================================================== */

.wab-hero {
  padding: 8.5rem 0 2.5rem;
  background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.18) 0%, rgba(6, 11, 24, 0) 70%);
  text-align: center;
}

.wab-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38BDF8;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.wab-hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 0 8px #25D366;
}

.wab-hero h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  color: #F8FAFC;
  max-width: 820px;
  margin: 0 auto 1rem;
  line-height: 1.15;
}

.wab-hero-sub {
  font-size: 1.05rem;
  color: #94A3B8;
  max-width: 660px;
  margin: 0 auto 0.75rem;
}

.wab-hero-pills {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748B;
}

/* Main Builder Container */
.wab-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* Card Component */
.wab-card {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  box-shadow: 0 12px 32px -8px rgba(2, 6, 23, 0.28);
}

.wab-card-pad {
  padding: 1.35rem 1.5rem;
}

@media (max-width: 640px) {
  .wab-card-pad {
    padding: 1.15rem;
  }
}

/* Templates Bar */
.wab-templates-bar {
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.5rem;
}

.wab-templates-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wab-templates-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wab-tpl-btn {
  appearance: none;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #334155;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.wab-tpl-btn:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}

.wab-tpl-btn.active {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Two-Column Workspace */
.wab-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .wab-workspace {
    grid-template-columns: 1fr;
  }
}

.wab-left-col {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  min-width: 0;
}

.wab-right-col {
  min-width: 0;
  position: sticky;
  top: 92px;
}

@media (max-width: 1024px) {
  .wab-right-col {
    position: static;
  }
}

/* Typography & Inputs inside Cards */
.wab-section-title {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
}

.wab-section-sub {
  font-size: 0.8rem;
  color: #64748B;
  margin-top: 0.2rem;
}

.wab-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.wab-label-muted {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 0.35rem;
}

.wab-input,
.wab-textarea,
.wab-select {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  padding: 0.62rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: #0F172A;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wab-input:focus,
.wab-textarea:focus,
.wab-select:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.wab-textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.45;
}

/* Country + Phone Selector */
.wab-phone-wrap {
  position: relative;
}

.wab-phone-box {
  display: flex;
  align-items: stretch;
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  background: #FFFFFF;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wab-phone-box:focus-within {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.wab-country-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.85rem;
  background: #F1F5F9;
  border: 0;
  border-right: 1px solid #E2E8F0;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: #0F172A;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.wab-country-btn:hover {
  background: #E2E8F0;
}

.wab-phone-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: #0F172A;
  outline: none;
}

.wab-country-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.wab-country-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
}

.wab-country-search {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #0F172A;
  outline: none;
}

.wab-country-list {
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}

.wab-country-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #0F172A;
  text-align: left;
  cursor: pointer;
}

.wab-country-item:hover {
  background: #F1F5F9;
}

.wab-country-item.active {
  background: #EFF6FF;
  color: #2563EB;
  font-weight: 600;
}

/* Quick Chips */
.wab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: 0.45rem;
}

.wab-chip {
  border: 1px solid #E2E8F0;
  background: #F1F5F9;
  color: #475569;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wab-chip:hover {
  background: #E2E8F0;
  color: #0F172A;
}

/* Fields Builder */
.wab-fields-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.wab-counter-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  background: #EFF6FF;
  color: #2563EB;
}

.wab-counter-badge.limit {
  background: #FEF2F2;
  color: #DC2626;
}

.wab-fields-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wab-field-card {
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  background: #FFFFFF;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wab-field-card.open {
  border-color: #93C5FD;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
}

.wab-field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
}

.wab-field-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #EFF6FF;
  color: #2563EB;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.wab-field-info {
  flex: 1 1 150px;
  min-width: 0;
}

.wab-field-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wab-field-meta {
  font-size: 0.72rem;
  color: #64748B;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.1rem;
}

.wab-field-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}

.wab-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wab-icon-btn:hover:not(:disabled) {
  background: #F1F5F9;
  color: #0F172A;
}

.wab-icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.wab-field-editor {
  border-top: 1px solid #E2E8F0;
  padding: 1rem;
  background: #FAFBFD;
  border-radius: 0 0 16px 16px;
}

.wab-add-field-btn {
  margin-top: 0.75rem;
  width: 100%;
  min-height: 46px;
  border: 2px dashed #CBD5E1;
  border-radius: 16px;
  background: transparent;
  color: #475569;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.wab-add-field-btn:hover:not(:disabled) {
  border-color: #2563EB;
  background: #EFF6FF;
  color: #2563EB;
}

.wab-add-field-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Switch Toggle */
.wab-switch {
  position: relative;
  display: inline-flex;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #CBD5E1;
  background: #E2E8F0;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 0;
  align-items: center;
  flex-shrink: 0;
}

.wab-switch[aria-checked="true"] {
  background: #2563EB;
  border-color: #2563EB;
}

.wab-switch-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  transform: translateX(3px);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.wab-switch[aria-checked="true"] .wab-switch-thumb {
  transform: translateX(24px);
}

/* Segmented / Pill Buttons */
.wab-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wab-pill-btn {
  border: 1px solid #E2E8F0;
  background: #F1F5F9;
  color: #475569;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wab-pill-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.wab-pill-btn.active {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}

/* Publish Mode Cards */
.wab-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .wab-mode-grid {
    grid-template-columns: 1fr;
  }
}

.wab-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem;
  border-radius: 16px;
  border: 2px solid #E2E8F0;
  background: #FFFFFF;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.wab-mode-card:hover {
  border-color: #93C5FD;
}

.wab-mode-card.active {
  border-color: #2563EB;
  background: #EFF6FF;
}

.wab-mode-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #F1F5F9;
  color: #475569;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.wab-mode-card.active .wab-mode-icon {
  background: #2563EB;
  color: #FFFFFF;
}

/* Color Picker Row */
.wab-color-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.wab-color-input {
  width: 42px;
  height: 36px;
  padding: 2px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #FFFFFF;
  cursor: pointer;
}

.wab-color-hex {
  width: 102px !important;
  height: 36px;
  font-family: monospace;
  font-size: 0.8rem !important;
  text-transform: uppercase;
}

.wab-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wab-swatch:hover {
  transform: scale(1.12);
}

.wab-swatch.active {
  border-color: #0F172A;
  box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #2563EB;
}

/* Preview Card */
.wab-preview-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.wab-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 0;
  background: #2563EB;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.wab-test-btn:hover {
  background: #1D4ED8;
}

/* Code Export Section */
.wab-export-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
}

.wab-code-pre {
  margin: 0;
  padding: 1.15rem 1.35rem;
  background: #0B1120;
  color: #E2E8F0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  overflow: auto;
  height: clamp(320px, 44vh, 430px);
  white-space: pre;
}

/* Info Sections Below Builder */
.wab-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.wab-usecases-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .wab-steps-grid {
    grid-template-columns: 1fr;
  }
  .wab-usecases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .wab-usecases-grid {
    grid-template-columns: 1fr;
  }
}

.wab-step-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38BDF8;
  font-weight: 800;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wab-dark-card {
  background: #0F172A;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1.5rem;
  color: #F8FAFC;
}

/* FAQ Accordion */
.wab-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 820px;
  margin: 2rem auto 0;
}

.wab-faq-item {
  background: #0F172A;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
}

.wab-faq-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  background: transparent;
  border: 0;
  color: #F8FAFC;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.wab-faq-ans {
  padding: 0 1.35rem 1.15rem;
  color: #94A3B8;
  font-size: 0.92rem;
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.9rem;
}

/* Warning Alert */
.wab-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 1.1rem;
  border-radius: 16px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  font-size: 0.85rem;
}

/* Toast notification */
.wab-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: #0F172A;
  color: #FFFFFF;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.22s ease;
}

.wab-toast.show {
  opacity: 1;
  transform: translateY(0);
}
