@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ── Callback Widget: all styles scoped to widget elements ── */

/* ── Floating launcher button ──────────────────────────────── */
.cbw-launcher {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  animation: cbwFloatIn 0.5s ease-out 0.8s both;
}

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

.cbw-launcher-btn {
  width: 56px;
  height: 56px;
  background: #3aaa5e;
  border: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(58, 170, 94, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
}

.cbw-launcher-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 28px rgba(58, 170, 94, 0.55);
}

.cbw-launcher-btn svg {
  width: 26px;
  height: 26px;
  fill: white;
}

.cbw-launcher-label {
  font-size: 11px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.2px;
  text-align: center;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* ── Overlay backdrop ─────────────────────────────────────── */
.cbw-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 100000;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 20px;
  animation: cbwFadeIn 0.18s ease;
}

.cbw-overlay.open {
  display: flex;
}

@keyframes cbwFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Popup card ───────────────────────────────────────────── */
.cbw-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px 22px 22px;
  width: 360px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  position: relative;
  animation: cbwSlideUp 0.22s ease;
}

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

/* ── Card header ──────────────────────────────────────────── */
.cbw-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.cbw-header-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cbw-header-icon svg {
  width: 38px;
  height: 38px;
  fill: #3aaa5e;
}

.cbw-header-text {
  flex: 1;
}

.cbw-header-title {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
  letter-spacing: -0.4px;
}

.cbw-header-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
  font-weight: 500;
}

/* ── Close button ─────────────────────────────────────────── */
.cbw-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #6b7280;
  transition: background 0.2s;
  font-family: inherit;
}

.cbw-close:hover {
  background: #e5e7eb;
  color: #374151;
}

/* ── Form fields ──────────────────────────────────────────── */
.cbw-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cbw-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cbw-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 18px;
  background: #eff6ff;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #111827;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
}

.cbw-input:focus {
  border-color: #3aaa5e;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(58, 170, 94, 0.15);
}

.cbw-input::placeholder {
  color: #9ca3af;
}

.cbw-input.error {
  border-color: #ef4444;
  background: #fff5f5;
}

/* ── Phone row ────────────────────────────────────────────── */
.cbw-phone-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
}

.cbw-country-select {
  box-sizing: border-box;
  padding: 12px 26px 12px 14px;
  background: #f3f4f6;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #374151;
  outline: none;
  cursor: pointer;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  min-width: 0;
  width: 100%;
}

.cbw-country-select:focus {
  border-color: #3aaa5e;
}

/* ── Error message ────────────────────────────────────────── */
.cbw-error-msg {
  font-size: 12px;
  color: #ef4444;
  padding: 0 6px;
  min-height: 16px;
  font-weight: 500;
}

/* ── Submit button ────────────────────────────────────────── */
.cbw-submit {
  width: 100%;
  padding: 15px;
  background: #3aaa5e;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(58, 170, 94, 0.35);
  margin-top: 4px;
}

.cbw-submit:hover {
  background: #2e9450;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(58, 170, 94, 0.45);
}

.cbw-submit:active {
  transform: scale(0.98);
}

.cbw-submit svg {
  width: 22px;
  height: 22px;
  stroke: white;
  stroke-width: 3;
  fill: none;
}

.cbw-submit-label {
  color: white;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  letter-spacing: 0.1px;
}

/* ── Success state ────────────────────────────────────────── */
.cbw-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 10px 10px;
  gap: 14px;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.cbw-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #3aaa5e;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cbwCheckPop 0.4s ease;
}

@keyframes cbwCheckPop {
  0%   { transform: scale(0.6); opacity: 0; }
  70%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

.cbw-success-icon svg {
  width: 36px;
  height: 36px;
  stroke: #3aaa5e;
  stroke-width: 3;
  fill: none;
}

.cbw-success-text {
  font-size: 17px;
  color: #374151;
  font-weight: 500;
  line-height: 1.4;
}

.cbw-success-phone {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.5px;
}

.cbw-success-sub {
  font-size: 13px;
  color: #6b7280;
  font-weight: 400;
  line-height: 1.5;
  margin-top: -4px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .cbw-card {
    border-radius: 20px;
    padding: 20px 16px 18px;
  }

  .cbw-row,
  .cbw-phone-row {
    grid-template-columns: 1fr;
  }

  .cbw-phone-row {
    grid-template-columns: 80px 1fr;
  }
}
