/* =====================================================
   Overlay (Fullscreen-aware, centered via Flexbox)
===================================================== */
.botkid-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 2000000;
  display: none;

  /* Layout (do NOT toggle in JS) */
  align-items: center;
  justify-content: center;
}

/* Visible state (toggle via JS class) */
.botkid-modal.is-open {
  display: flex;
}


/* =====================================================
   Modal Card (Desktop-first, App-grade)
===================================================== */
.botkid-modal-card {
  background: var(--botkid-bg-light);
  width: 100%;
  max-width: 760px;          /* slightly wider for large screens */
  max-height: 85vh;
  padding: 36px 40px;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  overflow-y: auto;
}


/* =====================================================
   Header
===================================================== */
.botkid-modal-header {
  margin-bottom: 20px;
}

.botkid-modal-header h3 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  color: var(--botkid-text-dark);
}

.botkid-modal-header p {
  font-size: 15px;
  line-height: 1.5;
  color: #555;
}


/* =====================================================
   Step Indicator
===================================================== */
.botkid-step-indicator {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 14px;
}


/* =====================================================
   Fields
===================================================== */
.botkid-field {
  margin-bottom: 18px;
}

.botkid-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--botkid-text-dark);
}

.botkid-field input,
.botkid-field select,
.botkid-field textarea {
  width: 100%;
  font-size: 15px;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  box-sizing: border-box;
  background-color: #fff;
}

.botkid-field textarea {
  resize: vertical;
  min-height: 90px;
}

.botkid-field input:focus,
.botkid-field select:focus,
.botkid-field textarea:focus {
  border-color: var(--botkid-primary);
  box-shadow: 0 0 0 3px rgba(249, 168, 38, 0.15);
  outline: none;
}


/* =====================================================
   Custom Select Arrow
===================================================== */
.botkid-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}


/* =====================================================
   Checkbox & Option Groups
===================================================== */
.botkid-checkbox-group {
  margin-bottom: 22px;
}

.botkid-checkbox-group > label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--botkid-text-dark);
}

.botkid-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.botkid-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}


/* =====================================================
   Footer / Actions
===================================================== */
.botkid-modal-footer {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.botkid-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.botkid-primary {
  background: var(--botkid-primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s ease;
  line-height: normal;
}

.botkid-primary:hover {
  background: var(--botkid-primary-dark);
}

.botkid-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.botkid-primary.botkid-loading {
  pointer-events: none;
}

.botkid-secondary {
  background: transparent;
  border: none;
  color: var(--botkid-text-dark);
  font-size: 14px;
  cursor: pointer;
  padding: 10px 18px;
  line-height: normal;
}

.botkid-secondary:hover {
  text-decoration: underline;
}


/* =====================================================
   Step Handling
===================================================== */
.botkid-step[hidden] {
  display: none;
}

.botkid-step {
  animation: botkidStepFade 0.25s ease;
}

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


/* =====================================================
   Validation / Error
===================================================== */
#botkid-step-error {
  margin-top: 12px;
  font-size: 13px;
  color: #dc2626;
}


/* =====================================================
   Mobile (Full-screen Stepper)
===================================================== */
@media (max-width: 640px) {
  .botkid-modal-card {
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
    padding: 24px 20px;
  }

  .botkid-options {
    grid-template-columns: 1fr;
  }
}
