/* Esposas Brasil — estilo compartilhado (página inicial + /links) */

:root {
  --bg: #0a1520;
  --text: #eef3f8;
  --muted: #8a9aab;
  --bubble: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --accent: #1d6f80;
  --cyan: #14b4d6;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  background:
    radial-gradient(120% 60% at 50% 0%, #12304d 0%, rgba(10, 21, 32, 0) 65%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.is-locked {
  overflow: hidden;
}

/* Botões que fazem papel de link: aparência de link, sem menu/prévia ao segurar */
.cta,
.link-btn,
.gate__close,
.gate__back {
  font-family: var(--sans);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #7cc4d6;
  outline-offset: 2px;
}

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(0.75rem + env(safe-area-inset-top)) 0.75rem 0;
}

/* ---------- Card do topo ---------- */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 1.25rem 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(180deg, #1d5ea6 0%, #12407a 55%, #0d2f5c 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.avatar {
  position: relative;
  width: 92px;
  height: 92px;
  flex: none;
}

.avatar__img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 3px solid #0b2747;
  border-radius: 50%;
  background: #fff;
}

.avatar__img svg {
  width: 52%;
  height: 52%;
}

.avatar__img img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.has-photo .avatar__img img { display: block; }
.avatar.has-photo .avatar__img svg { display: none; }

.avatar__online {
  position: absolute;
  right: 2px;
  bottom: 4px;
  width: 20px;
  height: 20px;
  border: 3px solid #12407a;
  border-radius: 50%;
  background: #22c55e;
}

.profile__name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.handle {
  margin: 0.9rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Conversa ---------- */

.messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem 0 1rem;
}

.bubble {
  max-width: 82%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  font-size: 0.98rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  animation: bubble-in 0.28s ease both;
}

.bubble--in {
  align-self: flex-start;
  border-bottom-left-radius: 0.35rem;
  background: var(--bubble);
}

.bubble--out {
  align-self: flex-end;
  border-color: transparent;
  border-bottom-right-radius: 0.35rem;
  background: var(--cyan);
  color: #fff;
  font-weight: 500;
}

.bubble--card p {
  margin: 0 0 0.75rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.9rem;
  padding: 0.65rem 1.1rem;
  border: 0;
  border-radius: 0.75rem;
  background: linear-gradient(90deg, #14b4d6 0%, #3a6cf0 100%);
  box-shadow: 0 6px 18px rgba(36, 120, 230, 0.35);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.cta svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}

.cta:active { transform: scale(0.97); }

.typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 1rem 1.05rem;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-dot 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

/* Resposta rápida */
.quick {
  display: flex;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.quick__btn {
  min-height: 3.1rem;
  padding: 0.7rem 1.75rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0a1520;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: quick-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.quick__btn[hidden] { display: none; }
.quick__btn:active { transform: scale(0.96); }

/* Campo de mensagem */
.composer {
  position: sticky;
  bottom: 0;
  margin: 0 -0.75rem;
  padding: 0.6rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(10, 21, 32, 0) 0%, var(--bg) 35%);
}

.composer__box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.4rem 0.4rem 0.4rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.composer__field {
  flex: 1;
  min-width: 0;
  min-height: 2.6rem;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px; /* 16px evita o zoom automático do iPhone ao focar */
}

.composer__field::placeholder {
  color: var(--muted);
  opacity: 1;
}

.composer__send {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #bfe6ef;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.composer__send.is-ready {
  background: var(--cyan);
  color: #fff;
}

.composer__send svg { width: 1.15rem; height: 1.15rem; }

/* ---------- Página /links ---------- */

.links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.5rem 0 0;
  padding: 0 0 calc(2rem + env(safe-area-inset-bottom));
  list-style: none;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 4.6rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: inherit;
  text-align: left;
  text-decoration: none;
  animation: bubble-in 0.35s ease both;
  transition: border-color 0.2s ease;
}

.link-btn:hover { border-color: rgba(255, 255, 255, 0.22); }
.link-btn:active { transform: scale(0.98); }

.link-btn__logo {
  flex: none;
  width: 50px;
  height: 50px;
}

.link-btn__icon {
  flex: none;
  width: 34px;
  height: 34px;
}

.link-btn__logo svg,
.link-btn__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.link-btn__text {
  flex: 1;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
}

/* ---------- Aviso de idade ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  background:
    radial-gradient(60% 40% at 15% 10%, rgba(220, 38, 38, 0.18) 0%, transparent 70%),
    radial-gradient(60% 40% at 85% 95%, rgba(124, 58, 237, 0.16) 0%, transparent 70%),
    rgba(4, 6, 10, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade 0.3s ease both;
}

.gate[hidden] { display: none; }

.gate__box {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: auto;
  padding: 2rem 1.6rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.6rem;
  background: linear-gradient(160deg, #2a303b 0%, #1a1f28 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: rise 0.35s ease both;
}

.gate__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #c7cdd6;
  text-decoration: none;
}

.gate__close svg { width: 1.1rem; height: 1.1rem; }

.gate__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  margin: 0.25rem 0 1.25rem;
  border: 4px solid rgba(255, 120, 120, 0.55);
  border-radius: 50%;
  background: linear-gradient(160deg, #f05252 0%, #c81e1e 100%);
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.4);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.gate__badge sup {
  margin-left: 2px;
  font-size: 1rem;
  font-weight: 700;
}

.gate__title {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.gate__dest {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
}

.gate__dest[hidden] { display: none; }

.gate__dest-label {
  color: #8f98a6;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gate__dest-name {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.gate__text {
  margin: 0 0 1.6rem;
  color: #c3cad4;
  font-size: 1rem;
  line-height: 1.55;
}

.gate__confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 3.2rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.35);
  color: #fff;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.gate__confirm:active { transform: scale(0.98); }

.gate__back {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.4rem 1rem;
  border: 0;
  background: none;
  color: #8f98a6;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.gate__fine {
  margin: 1.4rem 0 0;
  color: #6f7886;
  font-size: 0.75rem;
  line-height: 1.5;
}

/* ---------- Animações ---------- */

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes typing-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

@keyframes quick-in {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gate,
  .gate__box,
  .bubble,
  .quick__btn,
  .link-btn,
  .typing span {
    animation: none;
  }
}
