/* =========================================
   POCO MUSIC — Design system (mobile-first)
   Base = telemóvel; min-width = progressão.
   ========================================= */

:root {
  --c-bg:         #080806;
  --c-bg-elev:    #0e0e0b;
  --c-surf:       #141410;
  --c-surf2:      #1c1c16;
  --c-border:     #2e2c22;
  --c-border-hi:  rgba(255, 255, 255, 0.09);
  --c-green:      #e8731a;
  --c-green-dim:  rgba(232, 115, 26, 0.14);
  --c-green-glow: rgba(232, 115, 26, 0.40);
  --c-green-h:    #f5892a;
  --c-purple:     #a78bfa;
  --c-purple-dim: rgba(167, 139, 250, 0.12);
  --c-text:       #f5f3ef;
  --c-text2:      #a39f96;
  --c-text3:      #56524a;
  --c-danger:     #f87171;
  --c-warn:       #fbbf24;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);

  --bnav-h:       4rem;
  /* Navbar ligeiramente “descolada” das bordas e do fundo */
  --bnav-float-gap: 0.45rem;
  --bnav-edge: clamp(0.45rem, 2.2vw, 0.65rem);
  --bnav-reserve: calc(
    var(--bnav-float-gap) + var(--bnav-h) + env(safe-area-inset-bottom, 0px) + 0.45rem
  );
  --r:            1rem;
  --r-sm:         0.5rem;
  --shadow:       0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-soft:  0 2px 16px rgba(0, 0, 0, 0.35);

  --pad-x:        clamp(0.875rem, 3.5vw, 1.25rem);
  --content-max:  100%;
  --touch-min:    2.75rem;
}

@media (min-width: 480px) {
  :root {
    --content-max: 28rem;
  }
}

@media (min-width: 640px) {
  :root {
    --content-max: 32rem;
    --bnav-h: 4.25rem;
  }
}

@media (min-width: 900px) {
  :root {
    --content-max: 36rem;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  background: var(--c-bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(232, 115, 26, 0.10), transparent 55%),
    radial-gradient(ellipse 100% 60% at 100% 100%, rgba(180, 50, 10, 0.07), transparent 50%);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
  font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  line-height: 1.45;
  min-height: 100dvh;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  /* Padding para a barra inferior + home indicator */
  padding-bottom: var(--bnav-reserve);
}

/* Página sem bottom nav (selecionar música) */
body.page-no-bnav {
  padding-bottom: max(1.5rem, var(--safe-b));
}

body.page-no-bnav .toast {
  bottom: max(1rem, var(--safe-b));
}

/* Início (index): sem bounce no topo nem scroll na página */
html.page-home {
  height: 100%;
  overflow: hidden;
}

body.page-home {
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  overflow: hidden;
}

/* Mensagens de erro/config na index: scroll só dentro do aviso se precisar */
body.page-home .sys-msg {
  max-height: calc(100svh - var(--bnav-reserve) - 2rem);
  max-height: calc(100dvh - var(--bnav-reserve) - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

a { color: inherit; text-decoration: none; }
button {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
input, button { outline-offset: 2px; }

/* Previne o 300ms delay em dispositivos touch */
a, button, [role="button"] { touch-action: manipulation; }

:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 2px;
}

/* ── Scrollbar (não essencial em touch) ── */
@media (hover: hover) {
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 99px; }
}

/* =========================================
   Background foto (index) — rotação 90° + ofuscada
   ========================================= */

/* Elemento raiz: ocupa todo o viewport e bloqueia overflow */
.lp-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

/* Mobile (portrait): dimensões invertidas + rotação 90° */
.lp-bg::before {
  content: "";
  position: absolute;
  width: 100vh;
  height: 100vw;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center;
  background: url("../img/back.jpg") center / cover no-repeat;
  will-change: transform;
}

/* Desktop (≥ 768px): sem rotação, imagem normal */
@media (min-width: 768px) {
  .lp-bg::before {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: none;
  }
}

/* Camada escura — mais opaca para ofuscar bem a foto */
.lp-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 5, 0.88);
}

/* =========================================
   Blobs (reduzidos no telemóvel)
   ========================================= */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
  animation: blob-drift 22s ease-in-out infinite;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; opacity: 0.08; }
}

.blob-g {
  width: min(22rem, 70vw);
  height: min(22rem, 70vw);
  background: radial-gradient(circle, #e8731a 0%, #6b2f06 100%);
  top: max(-6rem, -18vw);
  left: max(-5rem, -15vw);
  animation-delay: 0s;
}

.blob-p {
  width: min(26rem, 85vw);
  height: min(26rem, 85vw);
  background: radial-gradient(circle, #c04010 0%, #3a1004 100%);
  bottom: max(-8rem, -22vw);
  right: max(-5rem, -18vw);
  animation-delay: -9s;
}

@media (min-width: 640px) {
  .blob { filter: blur(90px); opacity: 0.18; }
  .blob-g {
    width: 34rem;
    height: 34rem;
    top: -10rem;
    left: -7.5rem;
  }
  .blob-p {
    width: 40rem;
    height: 40rem;
    bottom: -14rem;
    right: -10rem;
  }
}

@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(1rem, -0.6rem) scale(1.03); }
  66%      { transform: translate(-0.75rem, 1rem) scale(0.98); }
}

/* Fila, perfil: mesmo glow de fundo que na fila (blob visível, conteúdo por cima) */
body.app-inner-page {
  position: relative;
}

body.app-inner-page > .blob.blob-g {
  opacity: 0.08;
}

@media (prefers-reduced-motion: reduce) {
  body.app-inner-page > .blob.blob-g {
    opacity: 0.06;
  }
}

/* =========================================
   Bottom navbar (fixa em baixo, ligeiramente inset das bordas)
   ========================================= */
.bnav {
  position: fixed;
  z-index: 100;
  left: max(var(--bnav-edge), var(--safe-l));
  right: max(var(--bnav-edge), var(--safe-r));
  bottom: calc(var(--bnav-float-gap) + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: none;
  min-height: var(--bnav-h);
  box-sizing: border-box;
  padding: 0.35rem min(var(--pad-x), 1rem) 0.42rem;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 0.15rem;
  background: rgba(8, 8, 6, 0.97);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  border: 1px solid var(--c-border-hi);
  border-radius: 1.05rem;
  /* Luz de cima: reflexo no topo + halo laranja suave para o conteúdo */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    var(--shadow-soft),
    0 12px 36px rgba(0, 0, 0, 0.42),
    0 -10px 36px rgba(232, 115, 26, 0.14),
    0 -24px 48px rgba(232, 115, 26, 0.08);
}

.bnav::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 1px;
  height: 1px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 248, 235, 0.22),
    rgba(232, 115, 26, 0.45),
    rgba(255, 248, 235, 0.22),
    transparent
  );
  pointer-events: none;
  z-index: 2;
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  color: var(--c-text3);
  transition: color 0.18s, transform 0.12s;
  padding: 0.4rem 0.2rem;
  position: relative;
  border-radius: 0.85rem;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

/* Aba ativa: linha luminosa em cima + brilho no ícone (sem bloco laranja) */
.bnav-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 2px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, transparent, var(--c-green-h), var(--c-green), var(--c-green-h), transparent);
  box-shadow:
    0 0 10px rgba(232, 115, 26, 0.55),
    0 0 20px rgba(232, 115, 26, 0.25);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.bnav-item.is-active {
  color: var(--c-green);
}

.bnav-item.is-active::before {
  opacity: 1;
}

.bnav-item.is-active .bnav-ico {
  filter: drop-shadow(0 0 6px rgba(232, 115, 26, 0.55));
}

@media (hover: hover) {
  .bnav-item:hover:not(.is-active) {
    color: var(--c-text2);
  }
}

.bnav-item:active {
  transform: scale(0.98);
  opacity: 0.95;
}

.bnav-ico {
  width: 1.45rem;
  height: 1.45rem;
  flex-shrink: 0;
}

.bnav-lbl {
  font-size: clamp(0.625rem, 2.8vw, 0.6875rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* =========================================
   Page wrapper
   ========================================= */
.page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  /* O body já tem o padding base da navbar; aqui só acrescenta espaço extra */
  padding-bottom: 1rem;
}

.page-inner {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

/* =========================================
   Landing (index)
   ========================================= */
.lp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* min-height usa svh p/ corrigir bug do viewport em browsers mobile */
  min-height: 100svh;
  padding:
    max(1.25rem, var(--safe-t))
    var(--pad-x)
    /* Espaço extra acima do navbar (body já tem padding base) */
    1.75rem;
  text-align: center;
  gap: 0;
  width: 100%;
  max-width: min(100%, 26rem);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

@media (min-width: 480px) {
  .lp {
    max-width: 28rem;
    padding-bottom: 2.25rem;
  }
}

/* Index: altura = viewport menos padding da navbar (evita scroll vertical) */
body.page-home .lp {
  min-height: calc(100svh - var(--bnav-reserve));
  min-height: calc(100dvh - var(--bnav-reserve));
  max-height: calc(100svh - var(--bnav-reserve));
  max-height: calc(100dvh - var(--bnav-reserve));
  padding-top: max(0.65rem, var(--safe-t));
  padding-bottom: max(0.5rem, var(--safe-b));
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  box-sizing: border-box;
  overflow: hidden;
  justify-content: center;
}

@media (min-width: 480px) {
  body.page-home .lp {
    padding-bottom: 0.75rem;
  }
}

body.page-home .lp-sub {
  margin-bottom: clamp(1rem, 3.5vw, 1.75rem);
}

body.page-home .np-card {
  margin-bottom: clamp(0.85rem, 3vw, 1.35rem);
}

body.page-home .lp-queue-badge {
  margin-bottom: clamp(1rem, 3vw, 1.35rem);
}

.lp-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.55rem;
  width: 100%;
}

.lp-brand-heading {
  margin: 0;
  font-size: 0;
  line-height: 0;
}

.lp-logo-img {
  display: block;
  width: min(100%, 22rem);
  max-height: clamp(4rem, 14vw, 6.5rem);
  height: auto;
  object-fit: contain;
}

@media (min-width: 480px) {
  .lp-logo-img {
    max-height: clamp(5rem, 12vw, 7.5rem);
    width: min(100%, 26rem);
  }
}

.lp-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--c-green);
  box-shadow: 0 0 14px var(--c-green-glow);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .lp-dot { animation: none; }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 8px var(--c-green-glow); }
  50%      { box-shadow: 0 0 20px var(--c-green-glow), 0 0 36px rgba(232, 115, 26, 0.22); }
}

.lp-title {
  font-size: clamp(1.75rem, 1.3rem + 2.5vw, 2.25rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}

.lp-title-accent {
  color: var(--c-green);
}

.lp-sub {
  font-size: clamp(0.8rem, 0.75rem + 0.3vw, 0.9rem);
  color: var(--c-text2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: -0.25rem;
  margin-bottom: clamp(1.75rem, 5vw, 2.25rem);
}

/* Now playing */
.np-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid var(--c-border-hi);
  border-radius: var(--r);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 1rem);
  padding: clamp(0.75rem, 3vw, 1rem);
  margin-bottom: clamp(1.25rem, 4vw, 1.5rem);
  min-height: 4.5rem;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.np-art {
  width: clamp(3rem, 12vw, 3.5rem);
  height: clamp(3rem, 12vw, 3.5rem);
  border-radius: 0.5rem;
  background: var(--c-surf2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.np-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.np-art-ico {
  color: var(--c-text3);
  width: 1.35rem;
  height: 1.35rem;
}

.np-info {
  flex: 1;
  min-width: 0;
}

.np-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-green);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.np-track {
  font-weight: 700;
  font-size: clamp(0.875rem, 0.8rem + 0.4vw, 0.95rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 0.8rem;
  color: var(--c-text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.np-bar {
  margin-top: 0.55rem;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.np-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-green), var(--c-green-h));
  border-radius: 99px;
  transition: width 0.45s linear;
}

/* Queue badge */
.lp-queue-badge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  padding: 0.4rem 1rem;
  font-size: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  color: var(--c-text2);
  margin-bottom: clamp(1.5rem, 4vw, 1.75rem);
  max-width: 100%;
}

.lp-queue-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-green);
  box-shadow: 0 0 8px var(--c-green-glow);
  flex-shrink: 0;
}

/* CTA */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: var(--touch-min);
  background: linear-gradient(180deg, var(--c-green-h) 0%, var(--c-green) 100%);
  color: #fff;
  font-weight: 900;
  font-size: clamp(0.875rem, 0.85rem + 0.2vw, 1rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 1.5rem;
  border-radius: 99px;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 4px 24px rgba(232, 115, 26, 0.40);
}

@media (hover: hover) {
  .btn-cta:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.15) inset,
      0 8px 32px rgba(232, 115, 26, 0.50);
  }
}

.btn-cta:active { transform: translateY(0) scale(0.98); }

.btn-cta svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

@media (min-width: 400px) {
  .btn-cta {
    width: auto;
    min-width: min(100%, 17.5rem);
    padding-inline: 2rem;
  }
}

/* =========================================
   Fila
   ========================================= */
.fila-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 8, 6, 0.88);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-bottom: 1px solid var(--c-border-hi);
  padding:
    max(0.65rem, var(--safe-t))
    max(var(--pad-x), var(--safe-r))
    0.65rem
    max(var(--pad-x), var(--safe-l));
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 3.5rem;
}

.fila-header-title {
  font-weight: 800;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.1875rem);
  letter-spacing: -0.02em;
}

.fila-header-count {
  font-size: 0.8125rem;
  color: var(--c-text2);
  margin-top: 0.15rem;
}

.action-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem var(--pad-x);
  margin: 0.75rem var(--pad-x) 0;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  border: 1px solid transparent;
}

/* Banner neutro (visitante / pode votar) */
.action-banner-info {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--c-border);
  color: var(--c-text2);
}

.action-banner svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.action-banner-added {
  background: var(--c-green-dim);
  border-color: rgba(232, 115, 26, 0.30);
  color: var(--c-green-h);
}

.action-banner-voted {
  background: var(--c-purple-dim);
  border-color: rgba(167, 139, 250, 0.25);
  color: var(--c-purple);
}

.btn-add-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  background: var(--c-green);
  color: #fff;
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  border-radius: 99px;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(232, 115, 26, 0.30);
}

@media (hover: hover) {
  .btn-add-fab:hover:not(:disabled):not(.disabled) {
    filter: brightness(1.06);
    box-shadow: 0 4px 20px rgba(232, 115, 26, 0.40);
  }
}

.btn-add-fab:active:not(:disabled):not(.disabled) { transform: scale(0.97); }

.btn-add-fab svg {
  width: 1rem;
  height: 1rem;
}

.btn-add-fab:disabled,
.btn-add-fab.disabled {
  background: var(--c-surf2);
  color: var(--c-text3);
  cursor: not-allowed;
  box-shadow: none;
}

/* Lista */
.qi-list {
  list-style: none;
  padding: 0.5rem max(var(--pad-x), var(--safe-l)) 1.5rem max(var(--pad-x), var(--safe-r));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(100%, 40rem);
  margin-inline: auto;
}

@media (min-width: 768px) {
  .qi-list {
    max-width: 42rem;
  }
}

.qi {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2.5vw, 0.875rem);
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: clamp(0.65rem, 2.5vw, 0.85rem);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
  min-height: 3.25rem;
}

.qi::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(105deg, var(--c-green-dim) 0%, transparent 55%);
  transition: opacity 0.25s;
  pointer-events: none;
}

@media (hover: hover) {
  .qi:hover:not(.qi-no-action)::before { opacity: 1; }
}

.qi:active:not(.qi-no-action) { transform: scale(0.992); }

.qi.qi-is-added {
  border-color: rgba(232, 115, 26, 0.45);
  background: rgba(232, 115, 26, 0.07);
}

.qi.qi-is-voted {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.06);
}

.qi.qi-is-sent { opacity: 0.68; }

.qi.qi-no-action {
  cursor: default;
}

.qi.qi-no-action::before { display: none; }

.qi-rank {
  width: 1.65rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--c-text3);
  flex-shrink: 0;
}

@media (min-width: 400px) {
  .qi-rank {
    width: 1.85rem;
    font-size: 0.8125rem;
  }
}

.qi-rank.top1 { color: var(--c-green-h); }
.qi-rank.top2 { color: #eab308; }
.qi-rank.top3 { color: #d97706; }

.qi-art {
  width: clamp(2.75rem, 11vw, 3rem);
  height: clamp(2.75rem, 11vw, 3rem);
  border-radius: 0.375rem;
  background: var(--c-surf2);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.qi-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qi-info {
  flex: 1;
  min-width: 0;
}

.qi-name {
  font-weight: 700;
  font-size: clamp(0.8125rem, 0.78rem + 0.25vw, 0.9rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qi-sub {
  font-size: 0.72rem;
  color: var(--c-text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.12rem;
}

@media (min-width: 400px) {
  .qi-sub { font-size: 0.75rem; }
}

.qi-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.3rem;
  flex-shrink: 0;
  min-width: 0;
}

.qi-votes {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--c-text2);
}

.qi-votes svg {
  width: 0.85rem;
  height: 0.85rem;
}

.qi.qi-is-voted .qi-votes { color: var(--c-purple); }
.qi.qi-is-added .qi-votes { color: var(--c-text3); }

.qi-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border-radius: 99px;
  max-width: 100%;
  text-align: center;
  line-height: 1.2;
}

.qi-badge-added {
  background: var(--c-green-dim);
  color: var(--c-green-h);
  border: 1px solid rgba(232, 115, 26, 0.32);
}

.qi-badge-voted {
  background: var(--c-purple-dim);
  color: var(--c-purple);
  border: 1px solid rgba(167, 139, 250, 0.28);
}

.qi-badge-sent {
  background: rgba(251, 191, 36, 0.1);
  color: var(--c-warn);
  border: 1px solid rgba(251, 191, 36, 0.28);
}

.qi-badge-playing {
  background: linear-gradient(135deg, rgba(232, 115, 26, 0.22) 0%, rgba(232, 115, 26, 0.08) 100%);
  color: var(--c-green-h);
  border: 1px solid rgba(232, 115, 26, 0.48);
  animation: playing-pulse 2s ease-in-out infinite;
}

@keyframes playing-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 115, 26, 0); }
  50%       { box-shadow: 0 0 0 3px rgba(232, 115, 26, 0.18); }
}

@keyframes vote-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.qi-vote-anim { animation: vote-pulse 0.28s ease; }

.empty-state {
  text-align: center;
  padding: clamp(2rem, 8vw, 3.5rem) var(--pad-x);
  color: var(--c-text3);
  max-width: 22rem;
  margin-inline: auto;
}

.empty-state svg {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  opacity: 0.85;
}

.empty-state h2 {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--c-text2);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.empty-state p {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* =========================================
   Perfil / login
   ========================================= */
.auth-guest-wrap {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  /* dvh evita “saltos” com barra do browser no telemóvel */
  min-height: calc(100svh - var(--bnav-reserve));
  min-height: calc(100dvh - var(--bnav-reserve));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding:
    max(0.75rem, var(--safe-t))
    max(var(--pad-x), var(--safe-l))
    max(1rem, var(--safe-b))
    max(var(--pad-x), var(--safe-r));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-guest-inner {
  flex: 0 1 auto;
  width: 100%;
  max-width: min(22.5rem, 100%);
  min-width: 0;
  margin-inline: auto;
  padding-bottom: max(0.75rem, var(--safe-b));
}

.auth-hero {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-kicker {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-green);
  margin: 0 0 0.5rem;
  opacity: 0.92;
}

.auth-main-title {
  font-size: clamp(1.375rem, 1.15rem + 1.2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  margin: 0 0 0.5rem;
  background: linear-gradient(105deg, var(--c-text) 0%, var(--c-text2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not (background-clip: text) {
  .auth-main-title {
    color: var(--c-text);
    background: none;
  }
}

.auth-lead {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--c-text2);
  margin: 0;
  max-width: 20rem;
  margin-inline: auto;
}

.auth-view--hidden {
  display: none !important;
}

.auth-card--flush {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text2);
  letter-spacing: 0.02em;
}

.auth-switch {
  text-align: center;
  font-size: 0.875rem;
  color: var(--c-text2);
  margin-top: 1.25rem;
  line-height: 1.5;
}

.auth-switch-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--c-green);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-switch-link:active {
  opacity: 0.85;
}

.profile-logged-shell {
  width: 100%;
  max-width: min(100%, 26rem);
  min-width: 0;
  margin-inline: auto;
  box-sizing: border-box;
  padding-inline: max(var(--pad-x), var(--safe-l)) max(var(--pad-x), var(--safe-r));
  padding-bottom: max(0.5rem, var(--safe-b));
  overflow-x: hidden;
}

.profile-logged-shell > .page-title {
  padding-inline: 0;
}

.profile-logged-shell .profile-card,
.profile-logged-shell .info-card,
.profile-logged-shell .admin-card {
  margin-left: 0;
  margin-right: 0;
}

/* Perfil logado: texto e blocos centrados, alinhados ao botão Terminar sessão */
.profile-logged-shell .profile-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-logged-shell .info-card {
  text-align: center;
}

.profile-logged-shell .info-card h3 {
  text-align: center;
}

.profile-logged-shell .info-row {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
}

.profile-logged-shell .info-row-val {
  text-align: center;
}

.profile-logged-shell .admin-card {
  text-align: center;
}

.profile-logged-shell .admin-card .row {
  justify-content: center;
}

.profile-logged-shell .stack-footer {
  display: flex;
  justify-content: center;
  padding: 0.35rem 0;
}

.profile-logged-shell .btn-danger {
  width: auto;
  max-width: 100%;
  min-width: min(100%, 14rem);
  padding-left: 1.75rem;
  padding-right: 1.75rem;
}

.auth-view {
  min-width: 0;
}

.profile-logged-shell .profile-name,
.profile-logged-shell .info-row-val {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Telemóvel: blocos admin em coluna, tipografia um pouco mais compacta */
@media (max-width: 420px) {
  .profile-logged-shell .admin-card .row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .profile-logged-shell .admin-card .row .btn-spotify {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .auth-lead {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .auth-hero {
    margin-bottom: 1rem;
  }

  .auth-card {
    padding: 1rem 0.95rem;
  }

  .auth-switch {
    font-size: 0.8125rem;
    margin-top: 1rem;
  }
}

.page-title--center {
  text-align: center;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.page-title {
  font-size: clamp(1.375rem, 1.2rem + 1vw, 1.625rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  padding:
    max(1rem, var(--safe-t))
    max(var(--pad-x), var(--safe-r))
    0.75rem
    max(var(--pad-x), var(--safe-l));
  max-width: min(100%, 40rem);
  margin-inline: auto;
}

.auth-card,
.profile-card,
.info-card,
.admin-card {
  width: 100%;
  max-width: min(100%, 40rem);
  margin-left: auto;
  margin-right: auto;
}

.auth-card {
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: clamp(1.1rem, 4vw, 1.35rem);
  margin: 0 max(var(--pad-x), var(--safe-r)) 0.75rem max(var(--pad-x), var(--safe-l));
  box-shadow: var(--shadow-soft);
}

.auth-card h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

.auth-card .auth-hint {
  font-size: 0.8125rem;
  color: var(--c-text2);
  margin-bottom: 1rem;
  line-height: 1.55;
  padding: 0.65rem 0.75rem;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--c-border-hi);
}

.auth-card .auth-hint code {
  font-size: 0.78em;
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  background: var(--c-surf2);
  color: var(--c-text);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.form-input {
  width: 100%;
  min-height: var(--touch-min);
  background: var(--c-surf2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-text);
  font: inherit;
  font-size: 1rem;
  padding: 0.65rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--c-green);
  box-shadow: 0 0 0 3px var(--c-green-dim);
}

.form-input::placeholder { color: var(--c-text3); }

.btn-primary {
  width: 100%;
  min-height: var(--touch-min);
  background: linear-gradient(180deg, var(--c-green-h) 0%, var(--c-green) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  padding: 0.65rem 1rem;
  border-radius: 99px;
  transition: transform 0.15s, filter 0.2s;
}

@media (hover: hover) {
  .btn-primary:hover { filter: brightness(1.05); }
}

.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  width: 100%;
  min-height: var(--touch-min);
  background: transparent;
  color: var(--c-text);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.65rem 1rem;
  border-radius: 99px;
  border: 1px solid var(--c-border);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

@media (hover: hover) {
  .btn-ghost:hover {
    background: var(--c-surf2);
    border-color: var(--c-text3);
  }
}

.btn-ghost:active { transform: scale(0.98); }

.form-error {
  font-size: 0.8125rem;
  color: var(--c-danger);
  margin-top: 0.5rem;
  display: none;
}

.form-error.visible { display: block; }

.profile-card {
  background: linear-gradient(145deg, var(--c-surf) 0%, var(--c-bg-elev) 100%);
  border: 1px solid var(--c-border-hi);
  border-radius: var(--r);
  padding: clamp(1.25rem, 4vw, 1.5rem);
  margin: 0 max(var(--pad-x), var(--safe-r)) 1rem max(var(--pad-x), var(--safe-l));
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-soft);
}

.profile-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--c-green-h) 0%, #7a3008 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(232, 115, 26, 0.30);
}

.profile-name {
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.profile-email {
  font-size: 0.8125rem;
  color: var(--c-text3);
  margin-top: 0.25rem;
  word-break: break-all;
}

.profile-role {
  font-size: 0.8125rem;
  color: var(--c-text2);
  margin-top: 0.2rem;
}

.profile-admin {
  color: var(--c-green-h);
  font-weight: 700;
}

.info-card {
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 1rem 1.15rem;
  margin: 0 max(var(--pad-x), var(--safe-r)) 0.75rem max(var(--pad-x), var(--safe-l));
}

.info-card h3 {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--c-text2);
  margin-bottom: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
}

.info-row + .info-row {
  border-top: 1px solid var(--c-border);
}

.info-row-label {
  font-size: 0.875rem;
  color: var(--c-text2);
  flex-shrink: 0;
}

.info-row-val {
  font-size: 0.875rem;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.badge-on { color: var(--c-green-h); }
.badge-off { color: var(--c-text3); }

.btn-danger {
  width: 100%;
  max-width: min(100%, 40rem);
  margin-inline: auto;
  display: block;
  min-height: var(--touch-min);
  background: transparent;
  color: var(--c-danger);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.65rem 1rem;
  border-radius: 99px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  transition: background 0.2s, transform 0.15s;
}

@media (hover: hover) {
  .btn-danger:hover { background: rgba(248, 113, 113, 0.08); }
}

.btn-danger:active { transform: scale(0.98); }

/* =========================================
   Selecionar
   ========================================= */
.sel-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 8, 6, 0.92);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-bottom: 1px solid var(--c-border-hi);
  padding:
    max(0.65rem, var(--safe-t))
    max(var(--pad-x), var(--safe-r))
    0.85rem
    max(var(--pad-x), var(--safe-l));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sel-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  border-radius: 50%;
  background: var(--c-surf2);
  color: var(--c-text);
  flex-shrink: 0;
  border: 1px solid var(--c-border);
  transition: background 0.2s, transform 0.15s;
}

@media (hover: hover) {
  .btn-back:hover { background: var(--c-surf); }
}

.btn-back:active { transform: scale(0.95); }

.btn-back svg {
  width: 1.125rem;
  height: 1.125rem;
}

.sel-title {
  font-weight: 800;
  font-size: clamp(1rem, 0.92rem + 0.4vw, 1.125rem);
  flex: 1;
  letter-spacing: -0.02em;
}

.search-wrap {
  position: relative;
}

.search-ico {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text3);
  width: 1.125rem;
  height: 1.125rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: var(--touch-min);
  background: var(--c-surf2);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  color: var(--c-text);
  font: inherit;
  font-size: 1rem;
  padding: 0.65rem 1rem 0.65rem 2.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--c-green);
  box-shadow: 0 0 0 3px var(--c-green-dim);
}

.search-input::placeholder { color: var(--c-text3); }

.sel-results {
  list-style: none;
  padding: 0.65rem max(var(--pad-x), var(--safe-l)) 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(100%, 40rem);
  margin-inline: auto;
}

.sel-status {
  text-align: center;
  padding: 1.25rem var(--pad-x);
  font-size: 0.875rem;
  color: var(--c-text3);
  max-width: 24rem;
  margin-inline: auto;
  line-height: 1.5;
}

.sr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  background: var(--c-surf);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 0.65rem;
  transition: border-color 0.2s, background 0.2s;
}

@media (hover: hover) {
  .sr:hover {
    background: var(--c-surf2);
    border-color: var(--c-border-hi);
  }
}

.sr-art {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.35rem;
  background: var(--c-surf2);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.sr-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sr-info {
  flex: 1 1 12rem;
  min-width: 0;
}

.sr-name {
  font-weight: 700;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-sub {
  font-size: 0.72rem;
  color: var(--c-text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.btn-add-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1 1 100%;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  background: transparent;
  border: 1px solid var(--c-green);
  color: var(--c-green-h);
  font-weight: 800;
  font-size: 0.8125rem;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

@media (min-width: 420px) {
  .sr {
    flex-wrap: nowrap;
    gap: 0.875rem;
    padding: 0.75rem;
  }

  .sr-art {
    width: 2.75rem;
    height: 2.75rem;
  }

  .btn-add-track {
    flex: 0 0 auto;
    min-height: auto;
    width: auto;
    padding: 0.5rem 0.9rem;
  }
}

@media (hover: hover) {
  .btn-add-track:hover:not(:disabled) {
    background: var(--c-green);
    color: #fff;
  }
}

.btn-add-track:active:not(:disabled) { transform: scale(0.98); }

.btn-add-track:disabled {
  border-color: var(--c-text3);
  color: var(--c-text3);
  cursor: not-allowed;
  background: transparent;
}

.btn-add-track svg {
  width: 0.85rem;
  height: 0.85rem;
}

.btn-add-track.adding { opacity: 0.6; cursor: wait; }

.btn-add-track.added {
  border-color: var(--c-text3);
  color: var(--c-text3);
  pointer-events: none;
}

/* =========================================
   Admin (perfil)
   ========================================= */
.admin-card {
  background: rgba(232, 115, 26, 0.06);
  border: 1px solid rgba(232, 115, 26, 0.22);
  border-radius: var(--r);
  padding: 1rem 1.15rem;
  margin: 0 max(var(--pad-x), var(--safe-r)) 0.75rem max(var(--pad-x), var(--safe-l));
}

.admin-card h3 {
  font-size: 0.75rem;
  color: var(--c-green-h);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.65rem;
}

.admin-card p {
  font-size: 0.8125rem;
  color: var(--c-text2);
  margin-bottom: 0.875rem;
  line-height: 1.55;
}

.admin-card .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.btn-spotify {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.8125rem;
  transition: transform 0.15s, filter 0.2s;
}

.btn-spotify:active { transform: scale(0.97); }

.btn-spotify-on {
  background: var(--c-green);
  color: #fff;
}

@media (hover: hover) {
  .btn-spotify-on:hover { filter: brightness(1.06); }
}

.btn-spotify-off {
  background: var(--c-surf2);
  color: var(--c-danger);
  border: 1px solid rgba(248, 113, 113, 0.28);
}

@media (hover: hover) {
  .btn-spotify-off:hover { background: rgba(248, 113, 113, 0.08); }
}

/* =========================================
   Toast
   ========================================= */
.toast {
  position: fixed;
  bottom: calc(var(--bnav-reserve) + 0.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(0.75rem);
  max-width: min(calc(100vw - 2 * max(var(--pad-x), var(--safe-l))), 22rem);
  width: max-content;
  min-width: 0;
  background: var(--c-surf2);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  padding: 0.65rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
  box-shadow: var(--shadow);
  z-index: 200;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  word-wrap: break-word;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

@media (max-width: 359px) {
  .toast {
    width: calc(100% - 2 * var(--pad-x));
    max-width: none;
    left: var(--pad-x);
    right: var(--pad-x);
    transform: translateY(0.75rem);
    border-radius: var(--r);
  }

  .toast.show {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 360px) {
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.toast.t-ok {
  border-color: rgba(232, 115, 26, 0.45);
  color: var(--c-green-h);
}

.toast.t-err {
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--c-danger);
}

/* Spinner */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 2rem auto;
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--c-border); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Misc */
.divider {
  height: 1px;
  background: var(--c-border);
  margin: 0.75rem max(var(--pad-x), var(--safe-l));
  max-width: min(100%, 40rem);
}

.text-dim { color: var(--c-text3); }
.text-sm { font-size: 0.8125rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* Bloco de ação alinhado aos cartões (perfil) */
.stack-footer {
  padding: 0 max(var(--pad-x), var(--safe-l)) 0.5rem max(var(--pad-x), var(--safe-r));
  max-width: min(100%, 40rem);
  margin-inline: auto;
}

/* Mensagens de erro de sistema (inline nos PHP) */
.sys-msg {
  padding: clamp(1.5rem, 6vw, 2rem) var(--pad-x);
  text-align: center;
  max-width: 28rem;
  margin: 0 auto;
  line-height: 1.55;
}

.sys-msg--muted { color: var(--c-text2); }
.sys-msg--err { color: var(--c-danger); }

.sys-msg code {
  font-size: 0.85em;
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
  background: var(--c-surf);
  border: 1px solid var(--c-border);
}
