.academy-phone {
  display: grid;
  grid-template-columns: min(34%, 5.5rem) minmax(0, 1fr);
  align-items: stretch;
  gap: .5rem;
  container-type: inline-size;
}

.academy-phone-country {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 44px;
  max-width: 5.5rem;
  border: 1px solid var(--phone-border, #cbd5e1);
  border-radius: var(--phone-radius, .75rem);
  background: var(--phone-background, #fff);
  color: var(--phone-text, #172033);
  color-scheme: var(--phone-scheme, light);
  font: inherit;
  font-size: max(1rem, 1em);
}

.academy-phone-country select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  background: var(--phone-background, #fff);
  color: inherit;
  color-scheme: inherit;
  font: inherit;
  border: 0;
  border-radius: inherit;
  cursor: pointer;
}

.academy-phone-country [hidden] {
  display: none;
}

.academy-phone-country-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  width: 100%;
  padding-inline: .65rem;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.academy-phone-country-button::after {
  content: "";
  width: .42rem;
  height: .42rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-.125rem) rotate(45deg);
}

.academy-phone-country:focus-within {
  outline: 2px solid var(--phone-focus, #3676d4);
  outline-offset: 2px;
}

.academy-phone input {
  min-width: 0;
  width: 100%;
}

.academy-phone > * {
  grid-column: 1 / -1;
}

@container (width >= 200px) {
  .academy-phone > :not(.academy-phone-country-label) {
    grid-column: auto;
  }
}

.academy-phone:is([data-phone-field="lead_telefone"], [data-phone-field="mt_telefone"]) {
  --phone-radius: .5rem;
}

.academy-phone:is([data-phone-field="lead_telefone"], [data-phone-field="mt_telefone"],
  [data-phone-field="voucher_whatsapp"], [data-phone-field="kit_whatsapp"],
  [data-phone-field="ementa_telefone"], [data-phone-field="catalogo-telefone"]) {
  --phone-text: #1f2937;
  --phone-focus: #f59e0b;
}

.academy-phone[data-phone-field="by-tel"] {
  --phone-border: #d1d5db;
  --phone-text: #111827;
  --phone-focus: #3b82f6;
}

.academy-phone[data-phone-field="checkout-telefone"] {
  --phone-radius: 10px;
  --phone-background: #fff;
  --phone-border: #e2e6ea;
  --phone-text: #00112c;
  --phone-focus: #0066cc;
}

body:has(.checkout-corrigir-dados) .academy-phone[data-phone-field="checkout-telefone"] {
  --phone-radius: 11px;
  --phone-background: #f8fbff;
  --phone-border: #778aa3;
}

.academy-phone[data-phone-field="telefone"] {
  --phone-radius: 8px;
  --phone-border: var(--border, #cbd5e1);
  --phone-background: var(--white, #fff);
  --phone-text: var(--text, #172033);
}

.academy-phone[data-phone-field="certificado-telefone"] {
  --phone-background: rgba(17, 24, 39, .5);
  --phone-text: #fff;
  --phone-border: #374151;
  --phone-scheme: dark;
  --phone-focus: #60a5fa;
}

.academy-phone[data-phone-field="dataPhone"] {
  --phone-radius: 8px;
  --phone-background: var(--bg-input);
  --phone-text: var(--text-primary);
  --phone-border: var(--border);
  --phone-scheme: dark;
}

.academy-phone[data-phone-field="fcCelular"] {
  --phone-background: rgba(255, 255, 255, .05);
  --phone-text: #fff;
  --phone-border: rgba(255, 255, 255, .1);
  --phone-scheme: dark;
  --phone-focus: #818cf8;
}

[data-phone-field="fcCelular"] .fc-field input {
  padding-inline: .75rem;
}

[data-phone-field="fcCelular"] .fc-ico {
  display: none;
}

[data-phone-field="fcCelular"] option {
  background: #0f172a;
  color: #fff;
}

.academy-phone-country-label {
  grid-column: 1 / -1;
  color: #e5e7eb;
  font-size: .875rem;
  font-weight: 500;
}

@media (max-width: 1023px) {
  body:has(#matricula form :is(input, select, .academy-phone-country-button):focus) :is(.academy-wa-float, #mobileBottomBar) {
    visibility: hidden;
  }
}

#academy-phone-picker {
  position: fixed;
  inset: 0;
  width: min(23rem, calc(100% - 2rem));
  max-height: min(24rem, 80dvh);
  margin: auto;
  padding: .875rem;
  border: 1px solid #415475;
  border-radius: 1rem;
  background: #162234;
  color: #f3f6fb;
  box-shadow: 0 1rem 3rem #02061780;
  font-family: inherit;
  overscroll-behavior: contain;
}

#academy-phone-picker[open] {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

#academy-phone-picker::backdrop {
  background: #050914ae;
  overflow: hidden;
  overscroll-behavior: contain;
}

.academy-phone-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .625rem;
  padding-inline-start: .375rem;
}

#academy-phone-picker-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 650;
}

.academy-phone-picker-header button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: #dbe6f7;
  font-size: 1.375rem;
  cursor: pointer;
}

#academy-phone-picker .academy-phone-search {
  flex: none;
  min-height: 46px;
  padding: .6rem .75rem;
  border: 1px solid #506580;
  border-radius: .625rem;
  background: #101a29;
  color: #fff;
  color-scheme: dark;
  font: inherit;
  font-size: 1rem;
}

.academy-phone-search::placeholder {
  color: #aebdd1;
}

.academy-phone-results {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #506580 transparent;
}

.academy-phone-results button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  min-height: 44px;
  padding: .45rem .625rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .875rem;
  text-align: start;
  cursor: pointer;
}

.academy-phone-results button[aria-pressed="true"] {
  background: #223c58;
}

.academy-phone-results button:hover,
.academy-phone-picker-header button:hover {
  background: #2b4160;
}

#academy-phone-picker :is(input, button):focus-visible {
  outline: 2px solid #9bc3ff;
  outline-offset: -2px;
}

.academy-phone-result-code {
  flex: none;
  color: #b8cee8;
  font-variant-numeric: tabular-nums;
}

.academy-phone-empty {
  margin: 0;
  padding: .5rem .375rem;
  color: #c4d1e4;
  font-size: .875rem;
}
