/* ============================================================
   Contact advocate — Zocdoc-style streamlined layout
   ============================================================ */

.contact-v2-page {
  background: #ffffff;
  --contact-topbar-height: 3.5rem;
  padding-top: var(--contact-topbar-height);
}

/* ——— Zocdoc-style top bar ——— */
.contact-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10040;
  height: var(--contact-topbar-height);
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.contact-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 40rem;
  height: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.contact-topbar__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.contact-topbar__logo img {
  display: block;
  width: auto;
  height: 1.75rem;
}

.contact-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.contact-topbar__secure {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
}

.contact-topbar__secure .material-symbols-outlined {
  font-size: 0.9375rem;
}

.contact-topbar__sep {
  width: 1px;
  height: 1.125rem;
  background: #d1d5db;
}

.contact-topbar__account {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
  text-decoration: none;
  white-space: nowrap;
}

.contact-topbar__account:hover {
  text-decoration: underline;
}

.contact-topbar__account-skeleton {
  flex-shrink: 0;
}

.contact-topbar__account-skeleton[hidden],
.contact-topbar__account[hidden] {
  display: none;
}

/* ——— Skeleton placeholders (auth + advocate load) ——— */
.contact-skeleton {
  border-radius: 4px;
  background: linear-gradient(90deg, #f3f4f6 25%, #f9fafb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: contact-skeleton-shimmer 1.4s infinite;
}

@keyframes contact-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-skeleton {
    animation: none;
    background: #f3f4f6;
  }
}

.contact-skeleton--avatar {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.contact-skeleton__stack {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.45rem;
  padding-top: 0.125rem;
}

.contact-skeleton--line-lg {
  width: 68%;
  height: 1.125rem;
  border-radius: 5px;
}

.contact-skeleton--line-md {
  width: 52%;
  height: 0.8125rem;
}

.contact-skeleton--line-sm {
  width: 42%;
  height: 0.75rem;
}

.contact-skeleton--line-toggle {
  width: 52%;
  height: 0.875rem;
}

.contact-skeleton--pill {
  display: inline-block;
  width: 4.25rem;
  height: 0.875rem;
  border-radius: 999px;
}

.contact-v2-summary__skeleton {
  display: none;
  width: 100%;
  align-items: flex-start;
  gap: 0.875rem;
}

.contact-v2-summary.is-loading .contact-v2-summary__skeleton {
  display: flex;
}

.contact-v2-summary.is-loading .contact-v2-summary__content {
  display: none;
}

.contact-v2-summary__content {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  width: 100%;
  min-width: 0;
}

/* ——— Main layout ——— */
.contact-v2-main {
  padding: 0 0 calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.contact-v2-shell {
  width: min(100%, 32rem);
  margin: 0 auto;
  padding: 0.75rem 1rem 0;
}

/* ——— Advocate summary card (Zocdoc-style) ——— */
.contact-v2-summary {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--fpa-app-border, #e5e7eb);
  border-radius: 8px;
  background: #ffffff;
}

.contact-v2-summary[hidden] {
  display: none !important;
}

.contact-v2-summary__photo {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgb(0 0 0 / 0.08);
}

.contact-v2-summary__body {
  flex: 1;
  min-width: 0;
}

.contact-v2-summary__identity {
  margin-bottom: 0.625rem;
}

.contact-v2-summary__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  font-size: clamp(1.125rem, 4.2vw, 1.3125rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--fpa-app-text, #111827);
}

.contact-v2-summary__title {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.35;
  color: #374151;
}

.contact-v2-summary__meta {
  display: grid;
  gap: 0.2rem;
}

.contact-v2-summary__line {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #4b5563;
}

.contact-v2-summary__line[hidden] {
  display: none;
}

.contact-v2-summary__line--service {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.contact-v2-summary__cam {
  font-size: 1rem;
  width: 1rem;
  height: 1rem;
  margin-right: 0.3rem;
  color: #111827;
  font-variation-settings:
    "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

.contact-v2-summary__cam[hidden] {
  display: none;
}

.contact-v2-summary__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
  vertical-align: middle;
}

.contact-v2-summary__badge--pro {
  background: rgb(16 185 129 / 0.12);
  color: #047857;
}

.contact-v2-summary__badge--basic {
  background: rgb(29 78 216 / 0.1);
  color: #1d4ed8;
}

.contact-v2-summary__badge[hidden] {
  display: none;
}

.contact-v2-summary__badge .material-symbols-outlined {
  font-size: 0.875rem;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}

/* ——— Form ——— */
.contact-v2-form-wrap {
  margin-top: 1.25rem;
  min-width: 0;
}

.contact-v2-form__header {
  margin-bottom: 1.25rem;
}

.contact-v2-form__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.375rem, 4.5vw, 1.625rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--fpa-app-text, #111827);
}

.contact-v2-form__subtitle {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--fpa-app-text-muted, #6b7280);
}

.contact-v2-form__status {
  display: none;
}

.contact-v2-form__status.success {
  color: #166534;
}

.contact-v2-form__status.error {
  color: #b91c1c;
}

.contact-v2-form {
  display: grid;
  gap: 0.875rem;
}

.contact-v2-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.contact-v2-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.contact-v2-field label {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--fpa-app-text, #111827);
}

.contact-v2-field input,
.contact-v2-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--fpa-app-border, #d1d5db);
  border-radius: 8px;
  padding: 0.6875rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--fpa-app-text, #111827);
  background: #ffffff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.contact-v2-field textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.contact-v2-field input:focus,
.contact-v2-field textarea:focus {
  outline: none;
  border-color: #182743;
  box-shadow: 0 0 0 3px rgb(24 39 67 / 0.1);
}

.contact-v2-field input[type="datetime-local"] {
  font-size: 0.9375rem;
}

/* Legacy float-field support (contact-advocate-v2.html) */
.contact-v2-float-field {
  position: relative;
  display: block;
  min-width: 0;
}

.contact-v2-float-field input,
.contact-v2-float-field textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--fpa-app-border, #d1d5db);
  border-radius: 8px;
  padding: 0.6875rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--fpa-app-text, #111827);
  background: #ffffff;
}

/* ——— Optional fields ——— */
.contact-v2-optional {
  margin: 0;
}

.contact-v2-optional > .contact-v2-optional__summary {
  width: fit-content;
  max-width: 100%;
}

.contact-v2-optional__summary {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #182743;
  cursor: pointer;
  list-style: none;
}

.contact-v2-optional__summary::-webkit-details-marker {
  display: none;
}

.contact-v2-optional__chevron {
  font-size: 1.125rem;
  margin-left: 0.05rem;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.contact-v2-optional[open] .contact-v2-optional__chevron {
  transform: rotate(180deg);
}

.contact-v2-optional__fields {
  display: grid;
  gap: 0.875rem;
  margin-top: 0.75rem;
}

/* ——— Zip location tag ——— */
.contact-v2-zip-picker {
  margin-top: -0.35rem;
}

.contact-v2-zip-loading {
  padding-top: 0.0625rem;
}

.contact-v2-zip-loading[hidden] {
  display: none;
}

.contact-v2-zip-loading__bar {
  display: block;
  width: 6.5rem;
  height: 0.6875rem;
}

.contact-v2-zip-error {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #b45309;
}

.contact-v2-zip-error[hidden] {
  display: none;
}

.contact-v2-zip-picker .location-tag-wrap {
  display: block;
}

.contact-v2-zip-picker .location-tag-wrap[hidden] {
  display: none;
}

.contact-v2-zip-picker .location-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.35rem 0.25rem 0.5rem;
  background: #fafafa;
  border: 1px solid #eeeeee;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #111111;
  line-height: 1.2;
}

.contact-v2-zip-picker .location-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #9e9e9e;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.contact-v2-zip-picker .location-tag-remove svg {
  width: 12px;
  height: 12px;
}

.contact-v2-zip-picker .location-tag-remove:hover {
  background: #f5f5f5;
  color: #111111;
}

/* ——— Submit ——— */
.contact-v2-form__actions {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.contact-v2-form__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: #182743;
  color: #ffffff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.contact-v2-form__submit:hover:not(:disabled) {
  background: #0f1a2e;
}

.contact-v2-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.contact-v2-form__secure {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.75rem;
  color: var(--fpa-app-text-muted, #6b7280);
}

.contact-v2-form__secure .material-symbols-outlined {
  font-size: 0.875rem;
}

.contact-v2-form__note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--fpa-app-text-muted, #6b7280);
  text-align: center;
}

.contact-v2-form__note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.contact-v2-hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ——— Success ——— */
.contact-v2-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0 1rem;
}

.contact-v2-success[hidden] {
  display: none;
}

.contact-v2-success__photo {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgb(0 0 0 / 0.08);
}

.contact-v2-success__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.625rem, 5vw, 1.875rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fpa-app-text, #111827);
}

.contact-v2-success__name-line {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--fpa-app-text, #111827);
}

.contact-v2-success__meta {
  margin: 0 0 0.35rem;
  max-width: 20rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--fpa-app-text-muted, #6b7280);
}

.contact-v2-success__meta:last-of-type {
  margin-bottom: 1.5rem;
}

.contact-v2-success__email {
  color: var(--fpa-app-text, #111827);
  font-weight: 600;
}

.contact-v2-success__signup {
  display: grid;
  gap: 0.875rem;
  width: 100%;
  max-width: 22rem;
  margin-bottom: 1rem;
}

.contact-v2-success__signup[hidden] {
  display: none;
}

.contact-v2-success__signup-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--fpa-app-text-muted, #6b7280);
}

.contact-v2-success__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: #182743;
  color: #ffffff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.contact-v2-success__cta--link[hidden] {
  display: none;
}

.contact-v2-success__cta:hover {
  background: #111827;
}

.contact-v2-success__secondary {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #182743;
  text-decoration: none;
}

.contact-v2-success__secondary:hover {
  text-decoration: underline;
}

/* ——— Toast ——— */
.contact-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(8px);
  background: #111827;
  color: #fff;
  padding: 0.6875rem 1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  z-index: 10050;
  opacity: 0;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.contact-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.contact-toast.error {
  background: #b91c1c;
}

.contact-toast.success {
  background: #166534;
}

.is-hidden {
  display: none !important;
}

/* ——— Mobile: sticky submit + hide footer ——— */
@media (max-width: 639px) {
  .contact-v2-form__actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(
      180deg,
      rgb(255 255 255 / 0) 0%,
      rgb(255 255 255 / 0.92) 18%,
      #ffffff 100%
    );
    border-top: 1px solid rgb(0 0 0 / 0.04);
  }

  .contact-v2-form__row {
    gap: 0.625rem;
  }
}

@media (min-width: 640px) {
  .contact-v2-shell {
    padding-top: 1.25rem;
  }

  .contact-v2-summary {
    padding: 1.125rem 1.25rem;
  }
}
