/* ==========================================================================
   Contact fields — country-code picker + honeypot (see js/contact-fields.js)
   Markup per form:
     <div class="cc-row" style="--cc-radius:10px">
       <select data-cc-picker data-phone-input="#phoneId" name="country_code"></select>
       <div class="...existing phone input wrapper...">...</div>
     </div>
   ========================================================================== */

.cc-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

/* Use when the phone wrapper also contains its error text (apply modal) */
.cc-row--top {
  align-items: flex-start;
}

.cc-row > :last-child {
  flex: 1 1 auto;
  min-width: 0;
}

.cc-picker {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  max-width: 40%;
}

.cc-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden;
}

.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 88px;
  max-width: 100%;
  height: var(--cc-height, auto);
  padding: 0 10px 0 12px;
  border: var(--cc-border, 1.5px solid #e2e8f0);
  border-radius: var(--cc-radius, 10px);
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-size: var(--cc-font-size, 0.85rem);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cc-btn.is-placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.cc-btn:hover,
.cc-picker.is-open .cc-btn,
.cc-btn:focus-visible {
  border-color: #0056c6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 86, 198, 0.12);
}

.cc-chevron {
  flex-shrink: 0;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.cc-picker.is-open .cc-chevron {
  transform: rotate(180deg);
}

/* Phone input locked until a country code is picked */
.cc-row input[type="tel"]:disabled {
  background: #f8fafc;
  cursor: not-allowed;
}

/* ---------- Floating panel (appended to <body>) ---------- */
.cc-panel {
  position: fixed;
  z-index: 2147483000;
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  font-family: inherit;
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
}

.cc-panel.is-open {
  display: flex;
}

.cc-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  color: #94a3b8;
}

.cc-search {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font: inherit;
  font-size: 0.85rem;
  color: #1e293b;
  background: transparent;
}

.cc-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  flex: 1 1 auto;
}

.cc-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.84rem;
  color: #1e293b;
  cursor: pointer;
}

.cc-list li.is-active {
  background: #eff6ff;
}

.cc-list li.is-selected {
  font-weight: 600;
  color: #0056c6;
}

.cc-iso {
  flex: 0 0 26px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
}

.cc-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-dial {
  flex: 0 0 auto;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.cc-list li.cc-empty {
  color: #94a3b8;
  cursor: default;
  justify-content: center;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .cc-row {
    gap: 6px;
  }

  .cc-btn {
    min-width: 74px;
    gap: 4px;
    padding: 0 8px 0 10px;
  }

  .cc-list li {
    padding: 11px 14px;
    font-size: 0.9rem;
  }
}

/* 16px stops iOS Safari from zooming the page when the search box is focused */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  .cc-search {
    font-size: 16px;
  }
}

/* ---------- Honeypot (kept off-screen, not display:none) ---------- */
.cc-hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
