/* ================== CARDTOT – FORM + POPUP ================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.ct-hidden {
  display: none !important;
}

/* Nút mở form (trong nội dung) + nút nổi */
.ct-open-btn,
#ct-floating-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: #004c3f;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  transition: all 0.2s ease;
  text-decoration: none;
}

.ct-open-btn:hover,
#ct-floating-btn:hover {
  background: #006f5b;
  transform: translateY(-1px);
}

/* Nút nổi bên phải dưới */
#ct-floating-btn {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 9999;
}

@media (max-width: 480px) {
  #ct-floating-btn {
    right: 10px;
    bottom: 14px;
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* ============= Overlay & Modal ============= */

#ct-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

#ct-modal {
  width: 100%;
  max-width: 520px;
  margin: 0 12px;
  background: #ffffff;
  border-radius: 20px;
  padding: 20px 18px 18px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  position: relative;
}

/* Nút đóng */
#ct-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #111827;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
}

/* Header */
.ct-title {
  margin: 0 36px 4px 4px;
  font-size: 18px;
  font-weight: 700;
  color: #004c3f;
}

.ct-sub {
  margin: 0 30px 12px 4px;
  font-size: 13px;
  color: #6b7280;
}

/* STEP INDICATOR – 3 bước */
.ct-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 10px;
}

.ct-stepper-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  font-size: 11px;
  color: #9ca3af;
}

/* Đường nối giữa các bước */
.ct-stepper-item::after {
  content: '';
  position: absolute;
  top: 15px;
  right: -50%;
  width: 100%;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}
.ct-stepper-item:last-child::after {
  display: none;
}

.ct-stepper-circle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  z-index: 1;
}

.ct-stepper-label {
  margin-top: 4px;
  text-align: center;
}

/* Trạng thái đã xong */
.ct-stepper-item.is-done .ct-stepper-circle {
  border-color: #004c3f;
  background: #004c3f;
  color: #ffffff;
}
.ct-stepper-item.is-done::after {
  background: #004c3f;
}
.ct-stepper-item.is-done .ct-stepper-label {
  color: #004c3f;
}

/* Trạng thái đang active */
.ct-stepper-item.is-active .ct-stepper-circle {
  border-color: #004c3f;
  background: #ecfdf5;
  color: #004c3f;
}
.ct-stepper-item.is-active .ct-stepper-label {
  color: #004c3f;
}

/* Progress bar dưới stepper */
.ct-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-bottom: 14px;
}

#ct-progress {
  width: 33.33%;
  height: 100%;
  background: #004c3f;
  transition: width 0.3s ease;
}

/* Bước */
.ct-step {
  display: none;
}

.ct-step.active {
  display: block;
}

.ct-step h4 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

/* Grid button chọn tuỳ chọn */
.ct-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ct-btn-grid button {
  flex: 1 1 calc(50% - 8px);
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  font-size: 14px;
  color: #111827;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ct-btn-grid button:hover {
  border-color: #004c3f;
  background: #ecfdf5;
}

.ct-btn-grid button.selected {
  border-color: #004c3f;
  background: #ecfdf5;
  font-weight: 600;
}

/* Input */
#ct-form input[type="text"],
#ct-form input[type="email"],
#ct-form input[type="tel"],
#ct-form input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  margin-bottom: 10px;
  font-size: 14px;
}

#ct-form input:focus {
  outline: none;
  border-color: #004c3f;
  box-shadow: 0 0 0 1px rgba(0, 76, 63, 0.12);
}

/* Anti-bot */
.ct-antibot-label {
  display: block;
  margin: 6px 0 4px;
  font-size: 13px;
  color: #4b5563;
}

/* Submit */
#ct-form button[type="submit"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: none;
  background: #004c3f;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 4px;
}

#ct-form button[type="submit"]:hover {
  background: #006f5b;
}

/* Note & success */
.ct-note {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}

.ct-note a {
  color: #004c3f;
  text-decoration: underline;
}

#ct-success {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #064e3b;
  font-size: 13px;
  font-weight: 500;
}

/* Mobile */
@media (max-width: 480px) {
  #ct-modal {
    margin: 0 10px;
    padding: 18px 14px 14px;
  }

  .ct-sub {
    margin-right: 10px;
  }

  .ct-stepper-label {
    font-size: 10px;
  }

  .ct-btn-grid button {
    flex-basis: 100%;
  }
}
