/* Contact verification modal — deferred-onboarding gate fired at first
   goal/community/inbox attempt. Visually distinct from whatsapp-gate
   (login entry page) by namespace: same WhatsApp green family, modal
   layout instead of full-page split. */

.contact-verification-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.contact-verification-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 16, 24, 0.78);
  backdrop-filter: blur(2px);
}

.contact-verification-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated, #ffffff);
  color: var(--text-primary, #0d1b2a);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-verification-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(120, 140, 160, 0.12);
  color: var(--text-muted, #5b7186);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.contact-verification-close:hover {
  background: rgba(120, 140, 160, 0.22);
  color: var(--text-primary, #0d1b2a);
}

.contact-verification-close:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
}

.contact-verification-phone {
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .contact-verification-card {
    background: #131c24;
    color: #e6edf3;
  }
}

.contact-verification-header { display: flex; flex-direction: column; gap: 6px; }

.contact-verification-eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #5b7186);
}

.contact-verification-title {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  margin: 0;
}

.contact-verification-title-accent {
  color: #16a34a;
}

.contact-verification-subtitle {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary, #354859);
}

.contact-verification-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  background: #16a34a;
  color: #ffffff;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.05s ease;
}

.contact-verification-submit:hover  { background: #15803d; }
.contact-verification-submit:active { transform: translateY(1px); }

.contact-verification-submit--whatsapp {
  background: #25d366;
}
.contact-verification-submit--whatsapp:hover { background: #1faa50; }

.contact-verification-submit--secondary {
  background: transparent;
  border: 1px solid #16a34a;
  color: #16a34a;
}
.contact-verification-submit--secondary:hover {
  background: rgba(22, 163, 74, 0.08);
}

.contact-verification-submit-icon {
  width: 18px;
  height: 18px;
}

.contact-verification-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted, #6b7c8c);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-verification-divider-rule {
  flex: 1;
  height: 1px;
  background: rgba(120, 140, 160, 0.3);
}

.contact-verification-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.contact-verification-qr-svg {
  background: #ffffff;
  border-radius: 10px;
  padding: 8px;
}

.contact-verification-qr-label {
  font-size: 12px;
  color: var(--text-muted, #6b7c8c);
  margin: 0;
}

.contact-verification-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary, #354859);
}

.contact-verification-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  animation: contact-verification-pulse 1.6s ease-in-out infinite;
}

@keyframes contact-verification-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50%      { opacity: 1.0; transform: scale(1.05); }
}

.contact-verification-status--verified .contact-verification-status-dot {
  background: #16a34a;
  animation: none;
}

.contact-verification-help {
  font-size: 13px;
  color: var(--text-muted, #6b7c8c);
  margin: 0;
}

.contact-verification-help-link {
  color: #16a34a;
  text-decoration: underline;
}

/* Email path */
.contact-verification-email-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-verification-email-instruction {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary, #354859);
}

.contact-verification-email-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-verification-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #354859);
}

.contact-verification-email-input {
  font-size: 22px;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(120, 140, 160, 0.35);
  background: transparent;
  color: inherit;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.contact-verification-email-input:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.contact-verification-error {
  color: #dc2626;
  font-size: 13px;
  margin: 0;
}

.contact-verification-success {
  color: #15803d;
  font-size: 13px;
  margin: 0;
}

.contact-verification-edit-link {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted, #6b7c8c);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.contact-verification-edit-link:hover {
  color: #16a34a;
  text-decoration-style: solid;
}

/* ─────────────────────────────────────────────────────────────
   Phone substitution card — /verificacao/telefone
   Football substitution metaphor: "sai" old number, "entra" new.
   Distinct from the main contact-verification modal: more
   editorial, sport-broadcast feel.
   ───────────────────────────────────────────────────────────── */

.phone-sub-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--bg-elevated, #ffffff);
  color: var(--text-primary, #0d1b2a);
  border-radius: 18px;
  padding: 32px 28px 28px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(22, 163, 74, 0.08);
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
  animation: phone-sub-card-enter 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.phone-sub-card::before {
  /* Subtle pitch-line decoration top-right — green chalk hint */
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background:
    radial-gradient(circle at 100% 0%, rgba(22, 163, 74, 0.08), transparent 60%);
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .phone-sub-card {
    background: #0f1620;
    color: #e6edf3;
  }
}

@keyframes phone-sub-card-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.phone-sub-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 32px; /* keep clear of close button */
}

.phone-sub-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #16a34a;
  width: fit-content;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.10);
  border: 1px solid rgba(22, 163, 74, 0.22);
}

.phone-sub-eyebrow-icon {
  flex-shrink: 0;
}

.phone-sub-title {
  font-family: var(--font-display, 'Sora', system-ui, sans-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 4px 0 0;
}

.phone-sub-lede {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary, #4b5d6f);
  margin: 0;
}

/* Substitution board (the two rows) */
.phone-sub-board {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-sub-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(120, 140, 160, 0.06);
  position: relative;
  transition: background 200ms ease, border-color 200ms ease;
}

.phone-sub-row--out {
  background: rgba(220, 38, 38, 0.04);
  border-color: rgba(220, 38, 38, 0.14);
}

.phone-sub-row--in {
  background: rgba(22, 163, 74, 0.05);
  border-color: rgba(22, 163, 74, 0.25);
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 16px 16px;
}

.phone-sub-row--in:focus-within {
  background: rgba(22, 163, 74, 0.08);
  border-color: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

/* The "sai" / "entra" tag */
.phone-sub-row-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px 3px 6px;
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  flex-shrink: 0;
  width: fit-content;
}

.phone-sub-row-tag--in {
  background: rgba(22, 163, 74, 0.18);
  color: #15803d;
}

.phone-sub-row-number {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary, #4b5d6f);
  text-decoration: line-through;
  text-decoration-color: rgba(220, 38, 38, 0.5);
  text-decoration-thickness: 2px;
  flex: 1;
  font-variant-numeric: tabular-nums;
}

.phone-sub-combo {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.phone-sub-country-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 8px 8px 4px;
  border-bottom: 2px solid rgba(22, 163, 74, 0.35);
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: inherit;
  transition: border-color 200ms ease;
  flex-shrink: 0;
}

.phone-sub-country-wrap:focus-within {
  border-bottom-color: #16a34a;
}

.phone-sub-country-plus {
  opacity: 0.7;
}

.phone-sub-country {
  width: 2.6ch;
  min-width: 2.6ch;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: none;
  text-align: left;
  padding: 0;
}

.phone-sub-country:focus {
  outline: none;
}

.phone-sub-input {
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  padding: 8px 4px 4px;
  border: none;
  border-bottom: 2px solid rgba(22, 163, 74, 0.35);
  background: transparent;
  color: inherit;
  width: 100%;
  outline: none;
  transition: border-color 200ms ease;
  flex: 1;
  min-width: 0;
}

.phone-sub-input::placeholder {
  color: rgba(120, 140, 160, 0.5);
  font-weight: 400;
}

.phone-sub-input:focus {
  border-bottom-color: #16a34a;
}

/* Form layout below the input row */
.phone-sub-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phone-sub-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted, #6b7c8c);
  margin: 0;
  padding: 0 4px;
}

.phone-sub-error {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.22);
  padding: 10px 12px;
  border-radius: 10px;
  margin: 0;
}

.phone-sub-error svg {
  flex-shrink: 0;
}

.phone-sub-submit {
  font-family: var(--font-display, 'Sora', system-ui, sans-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 13px 20px;
  border: none;
  border-radius: 11px;
  background: #16a34a;
  color: #ffffff;
  cursor: pointer;
  margin-top: 4px;
  transition: background 180ms ease, transform 100ms ease, box-shadow 180ms ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 14px -4px rgba(22, 163, 74, 0.45);
}

.phone-sub-submit:hover {
  background: #15803d;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 18px -4px rgba(22, 163, 74, 0.55);
}

.phone-sub-submit:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 4px 10px -4px rgba(22, 163, 74, 0.4);
}

.phone-sub-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted, #6b7c8c);
  text-decoration: none;
  padding: 8px 6px;
  border-radius: 6px;
  transition: color 180ms ease, background 180ms ease;
}

.phone-sub-back:hover {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.06);
}

/* Mobile tightening */
@media (max-width: 480px) {
  .phone-sub-card {
    padding: 26px 22px 22px;
    border-radius: 14px;
  }

  .phone-sub-title {
    font-size: 24px;
  }

  .phone-sub-input {
    font-size: 20px;
  }

  .phone-sub-row-number {
    font-size: 16px;
  }
}
