/* Travel by Luxe — phone prefix row (see docs/phone-prefix.md) */

.tbl-phone-row {
  display: grid;
  grid-template-columns: minmax(158px, 1fr) minmax(0, 1.35fr);
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 400px) {
  .tbl-phone-row {
    grid-template-columns: 1fr;
  }
}

.tbl-phone-prefix-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
  min-width: 0;
  border-radius: 4px;
  transition: border-color 0.3s, background 0.3s;
}

/* Form wrapper (pages use <form class="msf-wrap"> for tracking) */
form.msf-wrap {
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.tbl-phone-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  min-width: 28px;
  height: 20px;
  margin: 0 4px 0 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-size: 0;
  line-height: 1;
}

.tbl-phone-flag--emoji {
  width: auto;
  min-width: 0;
  height: auto;
  margin: 0 8px 0 10px;
  font-size: 1.3em;
  background-image: none !important;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif !important;
  font-style: normal;
  font-weight: normal;
}

.tbl-phone-prefix-sep {
  width: 1px;
  align-self: stretch;
  margin: 8px 0;
  flex-shrink: 0;
}

.tbl-phone-prefix {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  text-align: left;
  text-align-last: left;
  padding: 12px 36px 12px 12px;
  font-size: 13px;
  line-height: 1.35;
  width: 100%;
  min-width: 0;
  flex: 1;
  border: none;
  outline: none;
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
}

.tbl-phone-prefix::-ms-expand {
  display: none;
}

.tbl-phone-number {
  min-width: 0;
  width: 100%;
}

/* Page .cta-input uses `background:` shorthand (repeat + wipes image) — override on <select> */
select.cta-input.tbl-phone-prefix,
.cta-input.tbl-phone-prefix,
select.cta-input.tbl-phone-prefix:focus,
.cta-input.tbl-phone-prefix:focus {
  padding: 12px 36px 12px 12px;
  border: none !important;
  border-radius: 0;
  width: 100%;
  min-width: 0;
  max-width: none;
  box-shadow: none !important;
  outline: none;
  background-color: transparent !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 16px 16px !important;
}

.tbl-phone--dark select.cta-input.tbl-phone-prefix,
.tbl-phone--dark .cta-input.tbl-phone-prefix,
.tbl-phone--dark select.cta-input.tbl-phone-prefix:focus,
.tbl-phone--dark .cta-input.tbl-phone-prefix:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.85)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
}

.tbl-phone--light select.cta-input.tbl-phone-prefix,
.tbl-phone--light .cta-input.tbl-phone-prefix,
.tbl-phone--light select.cta-input.tbl-phone-prefix:focus,
.tbl-phone--light .cta-input.tbl-phone-prefix:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(27,58,45,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
}

/* Dark theme (Italy LPs, partner form) */
.tbl-phone--dark .tbl-phone-prefix-wrap {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.tbl-phone--dark .tbl-phone-prefix-wrap:focus-within {
  border-color: var(--gold, #c8a96e);
  background: rgba(255, 255, 255, 0.12);
}

.tbl-phone--dark .tbl-phone-prefix-sep {
  background: rgba(255, 255, 255, 0.15);
}

.tbl-phone--dark .tbl-phone-prefix {
  color: var(--white, #fdfbf8);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.85)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.tbl-phone--dark .tbl-phone-prefix option {
  color: var(--ink, #1b1b1b);
  background: var(--white, #fdfbf8);
}

/* Light theme (index.html) */
.tbl-phone--light .tbl-phone-prefix-wrap {
  border: 1px solid rgba(27, 58, 45, 0.25);
  background: var(--white, #fdfbf8);
}

.tbl-phone--light .tbl-phone-prefix-wrap:focus-within {
  border-color: var(--green, #1b3a2d);
  box-shadow: 0 0 0 2px rgba(27, 58, 45, 0.08);
}

.tbl-phone--light .tbl-phone-prefix-sep {
  background: rgba(27, 58, 45, 0.15);
}

.tbl-phone--light .tbl-phone-prefix {
  color: var(--text, #1b1b1b);
  font-family: var(--sans, system-ui, sans-serif);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(27,58,45,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.tbl-phone--light .tbl-phone-prefix option {
  color: var(--text, #1b1b1b);
  background: var(--white, #fdfbf8);
}

/* Partner form: taller row */
.pf-phone-row.tbl-phone-row {
  grid-template-columns: minmax(160px, 1.05fr) minmax(0, 1.6fr);
}

.pf-phone-row .tbl-phone-prefix-wrap {
  height: 52px;
  box-sizing: border-box;
}

.pf-phone-row .tbl-phone-prefix {
  height: 100%;
  box-sizing: border-box;
  padding: 12px 36px 12px 10px;
}
