/* ==========================================================================
   COMPONENTES REUTILIZÁVEIS
   Botões, ícones, badges, card de produto, drawer, busca, toast, accordion
   ========================================================================== */

/* ---------- Ícones ---------- */

.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 18px;
  height: 18px;
}

.icon--lg {
  width: 32px;
  height: 32px;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* ---------- Botões ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-6);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

/* Celular pequeno: textos longos quebram linha em vez de vazar da tela */
@media (max-width: 479px) {
  .btn {
    max-width: 100%;
    padding-inline: var(--space-4);
    white-space: normal;
    text-align: center;
    letter-spacing: 0.08em;
  }
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(253, 204, 3, 0.3);
}

.btn--outline {
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--whatsapp {
  background: var(--whatsapp);
  color: var(--white);
}

.btn--whatsapp:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn--lg {
  min-height: 56px;
  padding: 0 var(--space-7);
}

/* Celular estreito (até 400 px): menos margem interna, o texto do botão cabe numa linha */
@media (max-width: 400px) {
  .btn--lg {
    padding: 0 var(--space-4);
    letter-spacing: 0.08em;
  }
}

/* Contorno amarelo sobre fotos (hero, sobre) */
.btn--ghost {
  border-color: var(--accent);
  color: var(--white);
  background: rgba(1, 12, 38, 0.25);
}

.btn--ghost:hover {
  background: var(--accent);
  color: var(--on-accent);
  transform: translateY(-2px);
}

.btn--sm {
  min-height: 40px;
  padding: 0 var(--space-4);
  font-size: var(--fs-xs);
}

.btn--block {
  width: 100%;
}

.btn .icon {
  transition: transform var(--dur) var(--ease);
}

.btn:hover .icon--arrow {
  transform: translateX(4px);
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  color: var(--text);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

.counter-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--radius-pill);
  transform: scale(0);
  transition: transform var(--dur) var(--ease);
}

.counter-badge.is-active {
  transform: scale(1);
}

.counter-badge.is-bump {
  animation: bump 420ms var(--ease);
}

@keyframes bump {
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ---------- Tag de desconto ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
}

.tag--discount {
  background: var(--accent);
  color: var(--on-accent);
}

.tag--dark {
  background: var(--navy-900);
  color: var(--white);
}

/* ---------- Card de produto (estilo vitrine: imagem sem fundo + nome + "+") ---------- */

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6%;
  transition: transform var(--dur-slow) var(--ease);
}

.product-card:hover .product-card__media img {
  transform: scale(1.05);
}

.product-card__badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--text);
  color: var(--bg-card, var(--white));
  border-radius: var(--radius-sm);
}

/* Selo "Oferta" ligado no painel */
.product-card__badge--promo,
.pdp-gallery__promo {
  background: var(--yellow-500);
  color: var(--navy-900);
  box-shadow: 0 2px 8px rgba(3, 29, 90, 0.15);
}

.product-card.is-sold-out .product-card__media img {
  opacity: 0.45;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-4);
}

.product-card__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.product-card__name {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 0;
  overflow-wrap: anywhere;   /* nomes longos quebram em vez de alargar o card */
}

.product-card__name a {
  transition: color var(--dur-fast);
}

.product-card__name a:hover {
  color: var(--link-hover, var(--accent));
}

@media (min-width: 768px) {
  .product-card__name {
    font-size: var(--fs-sm);
  }
}

/* Botão "+" — adiciona ao carrinho */
.product-card__add {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -6px -6px 0 0;
  border-radius: var(--radius-pill);
  color: var(--text);
  transition: background-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}

.product-card__add:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.product-card__add:active {
  transform: scale(0.9);
}

.product-card__add.is-added {
  background: var(--success);
  color: var(--white);
}

.product-card__add:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: none;
  color: var(--text);
}

.product-card__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.price-old {
  font-size: var(--fs-sm);
  color: var(--text-subtle);
  text-decoration: line-through;
}

.price-new {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--price-color, var(--accent));
}

@media (min-width: 768px) {
  .price-new {
    font-size: var(--fs-base);
  }
}

/* Skeleton de carregamento */
.product-card--skeleton .product-card__media,
.product-card--skeleton .skeleton-line {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius);
}

.skeleton-line {
  height: 12px;
  border-radius: var(--radius-sm);
  margin-top: var(--space-3);
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------- Tema claro (catálogo e páginas de produto) ----------
   Redefine os tokens dentro da seção: os componentes se adaptam sozinhos. */

.theme-light {
  --text: var(--ink);
  --text-muted: #4a5568;
  --text-subtle: #5d6980;   /* contraste ≥ 4.5:1 no branco (leitura confortável) */
  --border: rgba(3, 29, 90, 0.12);
  --border-strong: rgba(3, 29, 90, 0.25);
  --surface: #eef1f6;
  --surface-2: #e2e7ef;
  --price-color: var(--ink);
  --link-hover: var(--navy-700);
  --bg-card: var(--white);
  background: var(--white);
  color: var(--text);
}

.theme-light .eyebrow {
  color: var(--navy-900);
}

.theme-light .eyebrow::before {
  background: var(--accent);
}

/* Botão escuro com contorno (sobre fundo claro) */
.btn--outline-dark {
  border-color: var(--navy-900);
  color: var(--navy-900);
}

.btn--outline-dark:hover {
  background: var(--navy-900);
  color: var(--white);
}

/* ---------- Overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(5, 13, 28, 0.78);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur);
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ---------- Drawer (carrinho) ---------- */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-drawer);
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--navy-900);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform var(--dur-slow) var(--ease), visibility var(--dur-slow);
}

.drawer.is-open {
  transform: none;
  visibility: visible;
  transition: transform var(--dur-slow) var(--ease), visibility 0s; /* visível já ao abrir: o foco vai para o "fechar" */
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.drawer__title {
  font-size: var(--fs-lg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

.drawer__foot {
  padding: var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--navy-950);
}

.drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-8);
  text-align: center;
  color: var(--text-muted);
}

.drawer__empty .icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.cart-item__thumb {
  display: block;
  aspect-ratio: 1;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.cart-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cart-item__name {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
}

.cart-item__price {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--accent);
  font-weight: 700;
}

.cart-item__remove {
  color: var(--text-subtle);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast);
}

.cart-item__remove:hover {
  color: var(--danger);
}

.qty {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.qty button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: color var(--dur-fast);
}

.qty button:hover {
  color: var(--accent);
}

.qty button[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty span {
  min-width: 28px;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.drawer__total strong {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--accent);
}

.drawer__note {
  margin-bottom: var(--space-4);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

.drawer__clear {
  display: block;
  margin: var(--space-3) auto 0;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.drawer__clear:hover {
  color: var(--danger);
}

/* ---------- Busca ---------- */

.search-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-drawer);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--navy-900);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform var(--dur-slow) var(--ease), visibility var(--dur-slow);
}

.search-panel.is-open {
  transform: none;
  visibility: visible;
  /* Visível já no toque (o campo recebe o foco e o teclado do celular abre); ao fechar, some no fim */
  transition: transform var(--dur-slow) var(--ease), visibility 0s;
}

.search-panel__inner {
  padding-block: var(--space-5) var(--space-6);
}

.search-field {
  position: sticky; /* campo e botão Buscar continuam à vista ao rolar a prévia */
  top: 0;
  z-index: 1;
  background: var(--navy-900);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 2px solid var(--border-strong);
  transition: border-color var(--dur);
}

.search-field:focus-within {
  border-color: var(--accent);
}

.search-field input {
  flex: 1;
  min-width: 0;
  padding-block: var(--space-4);
  background: none;
  border: 0;
  outline: none;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
}

.search-field input::placeholder {
  color: var(--text-subtle);
}

/* Botão "Buscar": leva para o catálogo com todos os resultados */
.search-field__go {
  flex: none;
  padding: 0.7em 1.2em;
  font-size: var(--fs-sm);
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

@media (max-width: 480px) {
  .search-field { gap: var(--space-2); }
  .search-field input { font-size: var(--fs-lg); }
  .search-field__go { padding: 0.65em 0.9em; }
}

.search-all {
  display: block;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  text-align: center;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.search-all:hover {
  border-color: var(--accent);
}

.search-results {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.search-result {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-2);
  border-radius: var(--radius);
  transition: background-color var(--dur-fast);
  text-align: left;
  width: 100%;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--surface);
}

.search-result img {
  width: 56px;
  height: 56px;
  padding: 6px;
  object-fit: contain;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

.search-result__name {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.search-result__cat {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

.search-result__price {
  font-weight: 700;
  color: var(--accent);
  font-size: var(--fs-sm);
}

.search-hint {
  margin-top: var(--space-4);
  color: var(--text-subtle);
  font-size: var(--fs-sm);
}

/* "Veja os mais parecidos" (palavra escrita com erro): logo acima dos resultados */
.search-hint--fuzzy {
  margin-top: 0;
}

/* ---------- Toast ---------- */

.toast-region {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  z-index: var(--z-toast);
  display: grid;
  gap: var(--space-2);
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--white);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: toast-in var(--dur) var(--ease);
  pointer-events: auto;
}

.toast .icon {
  color: var(--success);
}

.toast.is-leaving {
  animation: toast-out var(--dur) var(--ease) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(16px); }
}

/* ---------- Accordion ---------- */

.accordion {
  border-top: 1px solid var(--border);
}

.accordion__item {
  border-bottom: 1px solid var(--border);
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  padding-block: var(--space-5);
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  transition: color var(--dur-fast);
}

.accordion__trigger:hover {
  color: var(--accent);
}

.accordion__icon {
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  transition: background-color var(--dur), border-color var(--dur), transform var(--dur) var(--ease);
}

.accordion__icon::before,
.accordion__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform var(--dur) var(--ease);
}

.accordion__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.accordion__item.is-open .accordion__icon {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  transform: rotate(180deg);
}

.accordion__item.is-open .accordion__icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease);
}

.accordion__item.is-open .accordion__panel {
  grid-template-rows: 1fr;
}

.accordion__content {
  overflow: hidden;
}

.accordion__content p {
  max-width: 70ch;
  padding-bottom: var(--space-5);
  padding-right: var(--space-7);
  color: var(--text-muted);
}

/* ---------- Botão flutuante WhatsApp ---------- */

.whatsapp-float {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: var(--z-header);
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: var(--whatsapp);
  color: var(--white);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
  transition: transform var(--dur) var(--ease);
}

.whatsapp-float:hover {
  transform: scale(1.08);
}

.whatsapp-float .icon {
  width: 28px;
  height: 28px;
}

/* Celular: nas telas de formulário o botão cobria campos e links (o WhatsApp
   continua no rodapé e nos botões da própria página) */
@media (max-width: 767px) {
  [data-page="login"] .whatsapp-float,
  [data-page="checkout"] .whatsapp-float,
  [data-page="account"] .whatsapp-float,
  [data-page="tracking"] .whatsapp-float {
    display: none;
  }

  .whatsapp-float {
    right: var(--space-3);
    bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
  }
}

/* ---------- WhatsApp obrigatório (main.js → requirePhone) ---------- */

.phone-gate {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-toast) - 1);
  display: grid;
  padding: var(--gutter);
  background: rgba(1, 12, 38, 0.6);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: welcome-fade 0.3s var(--ease);
}

.phone-gate__card {
  margin: auto; /* centraliza, e em tela baixa rola sem cortar o topo */
  width: min(420px, 100%);
  display: grid;
  gap: var(--space-4);
  padding: var(--space-7) var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(1, 12, 38, 0.35);
  text-align: left;
  animation: welcome-pop 0.45s var(--ease);
}

.phone-gate__icon {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: var(--white);
}

.phone-gate__icon .icon { width: 32px; height: 32px; }

.phone-gate__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  color: var(--navy-900);
}

.phone-gate__text {
  margin-top: calc(var(--space-2) * -1);
  text-align: center;
  color: #4a5568;
  font-size: var(--fs-sm);
}

.phone-gate .field__label { color: var(--ink); }
.phone-gate .field { display: grid; gap: 6px; }
.phone-gate .field__label { font-size: var(--fs-sm); font-weight: 600; }
.phone-gate .field__input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-3);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(3, 29, 90, 0.25);
  border-radius: var(--radius-sm);
}
.phone-gate .field__input:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 0; }
.phone-gate .form__error { color: #b42318; font-size: var(--fs-sm); }

.phone-gate__icon--lock { background: var(--navy-900); color: var(--yellow-500); }

/* Aceite da Política de Privacidade (conta nova, uma vez) */
.phone-gate__consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid rgba(3, 29, 90, 0.15);
  border-radius: var(--radius-sm);
  background: #f7f9fc;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
}
.phone-gate__consent input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--navy-900); }
.phone-gate__consent a { color: var(--navy-700); font-weight: 600; text-decoration: underline; }

/* "Mostrar senha" embaixo do campo de senha */
.show-pass { display: inline-flex; align-items: center; gap: 8px; margin-top: -4px; font-size: var(--fs-sm); font-weight: 600; color: var(--navy-900); cursor: pointer; user-select: none; }
.show-pass input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy-900); cursor: pointer; }

.phone-gate__later { margin-top: calc(var(--space-2) * -1); }
.phone-gate__hint {
  margin-top: calc(var(--space-2) * -1);
  text-align: center;
  font-size: var(--fs-xs);
  color: #667085;
}

.phone-gate__out {
  justify-self: center;
  font-size: var(--fs-sm);
  color: #4a5568;
  text-decoration: underline;
}

/* ---------- Boas-vindas depois do login (main.js → showWelcome) ---------- */

.welcome {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(1, 12, 38, 0.35);
  animation: welcome-fade 0.3s var(--ease);
  cursor: pointer;
}

.welcome__card {
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: #15803d;   /* verde com contraste para texto branco */
  color: var(--white);
  text-align: center;
  box-shadow: 0 24px 60px rgba(21, 128, 61, 0.45);
  animation: welcome-pop 0.45s var(--ease);
}

.welcome__check {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-2);
  border-radius: 50%;
  background: var(--white);
  color: #15803d;
}

.welcome__check .icon {
  width: 34px;
  height: 34px;
  stroke-width: 2.6;
}

.welcome__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.2;
}

.welcome__text {
  color: rgba(255, 255, 255, 0.9);
}

.welcome.is-leaving {
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

@keyframes welcome-fade { from { opacity: 0; } }
@keyframes welcome-pop { from { opacity: 0; transform: scale(0.85); } }

/* ---------- Modo manutenção ---------- */

.maintenance {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-5);
  padding: var(--gutter);
  text-align: center;
  background: var(--navy-900);
}

.maintenance p {
  max-width: 40ch;
  font-size: var(--fs-lg);
  color: var(--text-muted);
}

/* Entrada do dono, disfarçada de "© REDULE" no pé da tela (visitante não percebe;
   área de toque de 44 px, fácil de acertar no celular) */
.maintenance__login {
  position: absolute;
  left: 50%;
  bottom: max(var(--space-4), env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.28);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.maintenance__login:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

.maintenance-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-toast);
  padding: var(--space-2) var(--gutter);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-align: center;
  color: var(--on-accent);
  background: var(--accent);
}
