/* Shared contact-details form styles: text fields and the phone field with
   its country-code picker. Used by index.html (opt-in modal) and book.html.
   Expects the page to define --bg, --bg-soft, --text, --muted, --accent and
   --border. */

.field { display: block; margin-bottom: 16px; }

.field span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder { color: rgba(151, 161, 184, 0.55); }

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 123, 255, 0.18);
}

.field input:user-invalid { border-color: #e0566b; }

/* Phone field with country-code selector */
.phone-row { display: flex; gap: 8px; }
.phone-row .phone-input { flex: 1; min-width: 0; }

.cc-select { position: relative; flex-shrink: 0; }

.cc-btn {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  line-height: 1;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0 10px;
  cursor: pointer;
  white-space: nowrap;
}

.cc-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 123, 255, 0.18);
}

.cc-flag,
.cc-list li .fl {
  width: 22px;
  height: 16px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  display: block;
}
.cc-dial { font-size: 0.95rem; color: var(--muted); line-height: 1; transform: translateY(3.5px); }
.cc-caret { color: var(--muted); flex-shrink: 0; display: block; }

.cc-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  width: 270px;
  max-width: 78vw;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 8px;
  overflow: hidden;
}

/* Opens upward when there isn't room below */
.cc-menu.up {
  top: auto;
  bottom: calc(100% + 6px);
}

.cc-menu[hidden] { display: none; }

.cc-search {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  margin-bottom: 8px;
}

.cc-search:focus { outline: none; border-color: var(--accent); }

.cc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 123, 255, 0.55) transparent;
}

/* WebKit / Blink custom scrollbar (on-brand) */
.cc-list::-webkit-scrollbar { width: 10px; }
.cc-list::-webkit-scrollbar-track { background: transparent; }
.cc-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
  transition: background 0.15s ease;
}
.cc-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  background-clip: content-box;
}

.cc-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.2;
}

.cc-list li:hover,
.cc-list li.is-active { background: rgba(46, 123, 255, 0.14); }

.cc-list li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; transform: translateY(3.5px); }
.cc-list li .dl { color: var(--muted); line-height: 1.2; align-self: center; transform: translateY(3.5px); }
