/* Shared public-form UX — country phone picker + field errors.
   Intentionally minimal so existing page/card styles stay dominant. */

.onairo-field-error {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #f87171;
}
.onairo-field-error.is-visible {
  display: block;
}
.form-group,
.lp-mini-form .full,
.onairo-phone-host {
  position: relative;
}
.onairo-field-status {
  position: absolute;
  top: 2.35rem;
  right: 0.85rem;
  z-index: 2;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  pointer-events: none;
}
.onairo-invalid > .onairo-field-status {
  background: #ef4444;
}
.onairo-valid > .onairo-field-status {
  background: #22c55e;
}
.onairo-invalid > .onairo-field-status::after,
.onairo-valid > .onairo-field-status::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}
.onairo-invalid > .onairo-field-status::after { content: "!"; }
.onairo-valid > .onairo-field-status::after { content: "✓"; }
.onairo-phone-host > .onairo-field-status {
  top: auto;
  bottom: 0.8rem;
  right: 0.85rem;
}
.onairo-invalid input,
.onairo-invalid textarea,
.onairo-invalid select,
.onairo-invalid .onairo-phone__number,
.onairo-invalid .onairo-phone__trigger {
  border-color: rgba(248, 113, 113, 0.65) !important;
}
.onairo-valid input:not([type="file"]),
.onairo-valid textarea,
.onairo-valid select {
  border-color: rgba(34, 197, 94, 0.52) !important;
}

.onairo-form-progress {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
}
.onairo-form-progress__label {
  color: var(--slate, #94a3b8);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: right;
}
.onairo-form-progress__track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}
.onairo-form-progress__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cobalt, #2563eb), #60a5fa);
  transition: width 0.2s ease;
}
.onairo-draft-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
  color: var(--slate-light, #cbd5e1);
  font-size: 0.8rem;
}
.onairo-draft-discard {
  border: 0;
  padding: 0.25rem;
  background: transparent;
  color: var(--cobalt-light, #60a5fa);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.onairo-submitting button[type="submit"] {
  position: relative;
  cursor: wait;
  opacity: 0.72;
}
textarea[data-onairo-autogrow="off"] {
  resize: vertical;
}
textarea:not([data-onairo-autogrow="off"]) {
  overflow-y: auto;
  resize: none !important;
}

.onairo-phone {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
.onairo-phone__country {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
}
.onairo-phone__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.28));
  background: var(--card, rgba(15, 23, 42, 0.72));
  color: var(--white, #e2e8f0);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}
.onairo-phone__trigger:focus,
.onairo-phone__trigger:focus-visible {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
}
.onairo-phone__trigger-flag {
  font-size: 1.05rem;
  line-height: 1;
}
.onairo-phone__trigger-dial {
  font-variant-numeric: tabular-nums;
}
.onairo-phone__trigger-chevron {
  opacity: 0.65;
  font-size: 0.7rem;
  margin-left: 0.1rem;
}
.onairo-phone__panel {
  display: none;
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  width: min(320px, 86vw);
  max-height: min(280px, 50vh);
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.28));
  background: var(--card, #0f172a);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.onairo-phone__panel.is-open {
  display: flex;
  flex-direction: column;
}
.onairo-phone__search {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.22));
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
}
.onairo-phone__search:focus {
  outline: none;
}
.onairo-phone__list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 220px;
}
.onairo-phone__option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
}
.onairo-phone__option:hover,
.onairo-phone__option.is-active,
.onairo-phone__option[aria-selected="true"] {
  background: rgba(37, 99, 235, 0.16);
}
.onairo-phone__option-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.onairo-phone__option-dial {
  color: var(--slate, #94a3b8);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.onairo-phone__number {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}
.onairo-phone__hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .onairo-phone {
    flex-wrap: wrap;
  }
  .onairo-phone__country {
    flex: 1 1 100%;
  }
  .onairo-phone__trigger {
    width: 100%;
    justify-content: space-between;
  }
  .onairo-phone__panel {
    width: 100%;
    left: 0;
    right: 0;
  }
  .onairo-phone__number {
    flex: 1 1 100%;
  }
  .onairo-field-status {
    top: 2.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .onairo-form-progress__track span {
    transition: none;
  }
}
