/* ======================================================================
   FutStory — Design System
   ====================================================================== */
:root {
  /* Brand */
  --fs-dark: #0b1220;
  --fs-navy: #122038;
  --fs-blue: #1e90ff;
  --fs-cyan: #25d0ff;
  --fs-green: #22c55e;

  /* Surfaces & text */
  --fs-bg: #f2f5fa;
  --fs-surface: #ffffff;
  --fs-border: #e6eaf1;
  --fs-text: #1b2534;
  --fs-muted: #6b7688;

  /* Effects */
  --fs-radius: 14px;
  --fs-radius-sm: 10px;
  --fs-shadow-sm: 0 1px 3px rgba(16, 30, 54, .06), 0 1px 2px rgba(16, 30, 54, .04);
  --fs-shadow: 0 4px 16px rgba(16, 30, 54, .08);
  --fs-shadow-lg: 0 12px 32px rgba(16, 30, 54, .14);

  /* Bootstrap overrides */
  --bs-primary: var(--fs-blue);
  --bs-body-color: var(--fs-text);
  --bs-border-color: var(--fs-border);
  --bs-link-color: #1668c9;
  --bs-link-hover-color: #0f4d97;
}

/* ===== Tema escuro ===== */
[data-bs-theme="dark"] {
  --fs-bg: #0d1420;
  --fs-surface: #16202f;
  --fs-border: #243043;
  --fs-text: #e6ebf3;
  --fs-muted: #93a0b4;
  --fs-shadow-sm: 0 1px 3px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .3);
  --fs-shadow: 0 4px 16px rgba(0, 0, 0, .45);
  --fs-shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);

  /* Harmoniza os componentes Bootstrap com a paleta FutStory. */
  --bs-body-bg: #16202f;
  --bs-body-color: #e6ebf3;
  --bs-border-color: #243043;
  --bs-secondary-color: #93a0b4;
  --bs-tertiary-bg: #1c2839;
  --bs-link-color: #4da3ff;
  --bs-link-hover-color: #7db9ff;
}

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  margin-bottom: 60px;
  background: var(--fs-bg);
  color: var(--fs-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .display-4, .display-6 {
  font-family: "Poppins", "Inter", sans-serif;
  letter-spacing: -.01em;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }
.nav-link, .btn, .card a, .list-group-item { text-decoration: none !important; }

/* ===== Focus ===== */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 .2rem rgba(30, 144, 255, .25);
}

/* Foco de teclado bem visível (acessibilidade) sem atrapalhar o mouse. */
a:focus-visible, button:focus-visible, [data-href]:focus-visible,
.list-group-item:focus-visible, .dropdown-item:focus-visible, .card.fs-card:focus-visible {
  outline: 3px solid var(--fs-cyan);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ===== Navbar ===== */
.fs-navbar {
  background: linear-gradient(100deg, var(--fs-dark), var(--fs-navy));
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 12px rgba(11, 18, 32, .25);
  padding-top: .55rem;
  padding-bottom: .55rem;
}

.fs-navbar .navbar-brand {
  color: #f3f6fb !important;
  font-weight: 800;
  font-size: 1.35rem;
  padding: 0;
}

/* Logo oficial: fundo escuro da arte se mistura com a navbar. */
.fs-logo {
  height: 44px;
  width: auto;
  display: block;
  border-radius: 8px;
}

.fs-logo-hero {
  max-width: min(420px, 80%);
  height: auto;
  border-radius: 14px;
}

.fs-navbar .nav-link {
  color: #cdd6e5 !important;
  font-weight: 500;
  border-radius: 8px;
  padding: .4rem .7rem !important;
  transition: color .15s ease, background .15s ease;
}

.fs-navbar .nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, .08);
}

.fs-navbar .nav-link.active {
  color: #fff !important;
  background: rgba(37, 208, 255, .16);
}

.fs-navbar .nav-link.active::after {
  content: "";
  display: block;
  height: 2px;
  border-radius: 2px;
  margin-top: 3px;
  background: var(--fs-cyan);
}

/* ===== Hero ===== */
.fs-hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(1200px 400px at 20% -10%, rgba(37, 208, 255, .25), transparent 60%),
              linear-gradient(120deg, var(--fs-dark), #14243f);
  color: #fff;
  border-radius: var(--fs-radius);
  padding: 3.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--fs-shadow);
}

.fs-hero h1 {
  font-weight: 800;
  letter-spacing: -1px;
}

.fs-hero .lead { color: #dbe4f0; }

/* ===== Cards ===== */
.card {
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius);
  background: var(--fs-surface);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--fs-border);
  padding: .85rem 1.1rem;
  font-weight: 600;
}

.fs-card {
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius);
  box-shadow: var(--fs-shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.fs-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--fs-shadow-lg);
  border-color: #d3ddec;
}

/* Clickable launcher tiles */
a.fs-card { color: inherit; }
a.fs-card:hover { text-decoration: none; }

/* Padrão global: card inteiro clicável (ver site.js) */
[data-href] { cursor: pointer; }

/* ===== Buttons ===== */
.btn {
  border-radius: 10px;
  font-weight: 600;
  padding: .5rem 1.05rem;
  transition: transform .1s ease, box-shadow .15s ease, filter .15s ease;
}

.btn:active { transform: translateY(1px); }
.btn-sm { border-radius: 8px; padding: .3rem .7rem; }
.btn-lg { border-radius: 12px; }

.btn-info {
  --bs-btn-bg: var(--fs-blue);
  --bs-btn-border-color: var(--fs-blue);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: #1878d6;
  --bs-btn-hover-border-color: #1878d6;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #1668c9;
  --bs-btn-active-color: #fff;
  box-shadow: 0 4px 12px rgba(30, 144, 255, .28);
}

.btn-primary {
  --bs-btn-bg: var(--fs-blue);
  --bs-btn-border-color: var(--fs-blue);
  --bs-btn-hover-bg: #1878d6;
  --bs-btn-hover-border-color: #1878d6;
}

/* ===== Badges ===== */
.badge { font-weight: 600; border-radius: 8px; padding: .38em .6em; }
.text-bg-info { background-color: var(--fs-blue) !important; color: #fff !important; }

/* ===== Lists ===== */
.list-group-item-action { transition: background .12s ease; }
.list-group-item-action:hover { background: #f6f9fe; }

/* ===== Forms ===== */
.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--fs-border);
  padding: .55rem .8rem;
}

.form-label { font-weight: 600; font-size: .9rem; }

/* ===== Alerts / toasts ===== */
main .alert {
  border: none;
  border-radius: 12px;
  box-shadow: var(--fs-shadow);
}

.alert-success {
  background: #eafaf0;
  color: #0f7a3d;
  border-left: 4px solid var(--fs-green);
}

/* ===== Crests ===== */
.fs-team-crest {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--fs-border);
  background: #f8f9fa;
}

.fs-crest-lg {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--fs-border);
  background: #f8f9fa;
}

.fs-color-dot {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .2);
  vertical-align: middle;
}

.fs-scoreboard {
  font-size: 2.2rem;
  font-weight: 800;
}

/* ===== Footer ===== */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
  background: var(--fs-surface);
  border-top: 1px solid var(--fs-border) !important;
  color: var(--fs-muted);
}

/* ===== Bottom nav estilo app (mobile) ===== */
.fs-bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040;
  display: flex;
  background: var(--fs-surface);
  border-top: 1px solid var(--fs-border);
  box-shadow: 0 -4px 16px rgba(16, 30, 54, .08);
  padding-bottom: env(safe-area-inset-bottom);
}

.fs-bottomnav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .45rem 0 .4rem;
  font-size: .68rem; font-weight: 500; line-height: 1;
  color: var(--fs-muted); text-decoration: none !important;
}

.fs-bottomnav a .bn-ico { font-size: 1.3rem; line-height: 1; }
.fs-bottomnav a .badge { position: absolute; top: -4px; left: 60%; font-size: .58rem; }
.fs-bottomnav a.active { color: var(--fs-blue); font-weight: 700; }

@media (max-width: 991.98px) {
  /* Espaço para a bottom nav; o footer institucional some no mobile. */
  body { margin-bottom: 84px; }
  .footer { display: none; }
}

/* ===== Page entrance =====
   Sem fill-mode "both": o transform NÃO pode persistir após a animação,
   senão o elemento vira containing block e quebra position:fixed (ex.: gaveta do banco). */
main[role="main"] > * {
  animation: fs-fade-in .28s ease;
}

@keyframes fs-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Ajustes de componentes no tema escuro ===== */
[data-bs-theme="dark"] .list-group-item-action:hover { background: #1c2839; }
[data-bs-theme="dark"] .alert-success { background: #10331f; color: #7ee2a8; }
[data-bs-theme="dark"] .fs-team-crest,
[data-bs-theme="dark"] .fs-crest-lg { background: #1c2839; border-color: var(--fs-border); }
[data-bs-theme="dark"] .fs-card:hover { border-color: #33425c; }
[data-bs-theme="dark"] .badge.text-bg-light {
  background: #223047 !important; color: #cdd6e5 !important; border-color: var(--fs-border) !important;
}
[data-bs-theme="dark"] .table-light { --bs-table-bg: #1c2839; --bs-table-color: #cdd6e5; --bs-table-border-color: #243043; }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #aab6c8; --bs-btn-border-color: #3a4a63; --bs-btn-hover-bg: #223047; --bs-btn-hover-border-color: #3a4a63; --bs-btn-hover-color: #e6ebf3; }
[data-bs-theme="dark"] .alert-light { background: #1c2839; color: var(--fs-muted); border-color: var(--fs-border); }

/* ===== Botão de tema (navbar) ===== */
.fs-theme-btn {
  background: none; border: none; font-size: 1.25rem; line-height: 1;
  padding: .3rem .45rem; border-radius: 8px; cursor: pointer;
}
.fs-theme-btn:hover { background: rgba(255, 255, 255, .1); }

/* ===== Sino de notificações (navbar) ===== */
.fs-bell-btn {
  position: relative; background: none; border: none; font-size: 1.25rem; line-height: 1;
  padding: .3rem .45rem; border-radius: 8px; cursor: pointer;
}
.fs-bell-btn:hover { background: rgba(255, 255, 255, .1); }

.fs-bell-badge {
  position: absolute; top: -3px; right: -1px;
  background: #dc3545; color: #fff; font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--fs-dark);
}

.fs-bell-menu {
  width: 330px; max-width: 92vw; max-height: 70vh; overflow-y: auto;
  border-radius: 12px; border: 1px solid var(--fs-border);
  box-shadow: var(--fs-shadow-lg); padding: .5rem .4rem .3rem;
}

/* No mobile o menu alinhado ao sino estoura pela esquerda; fixa na viewport */
@media (max-width: 575.98px) {
  .fs-bell-menu.dropdown-menu {
    position: fixed;
    top: 62px; left: 4vw; right: 4vw;
    width: auto; max-width: none;
  }
}

.fs-notif {
  display: flex; gap: .6rem; align-items: flex-start;
  white-space: normal; border-radius: 8px; padding: .5rem .6rem; font-size: .88rem;
}
.fs-notif .fn-ico { font-size: 1.15rem; flex: none; line-height: 1.2; }
.fs-notif .fn-time { font-size: .72rem; color: var(--fs-muted); }
.fs-notif.unread { background: rgba(30, 144, 255, .1); font-weight: 600; }

/* Item "novo" na página de notificações */
.fs-notif-new { background: rgba(30, 144, 255, .07); }

/* ===== Modal de compartilhar imagem (escalação / súmula) ===== */
.share-overlay {
  position: fixed; inset: 0; background: rgba(5, 9, 18, .82); z-index: 2100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.share-dialog {
  background: #0b1220; color: #fff; border-radius: 16px; max-width: 420px; width: 100%;
  max-height: 94vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.6); border: 1px solid #243043;
}
.share-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .8rem 1rem; font-weight: 700; border-bottom: 1px solid #243043;
}
.share-body { overflow-y: auto; padding: .8rem; text-align: center; }
.share-body img { max-width: 100%; border-radius: 10px; }
.share-actions { display: flex; gap: .6rem; padding: .8rem 1rem; border-top: 1px solid #243043; }
.share-actions .btn { flex: 1; }

/* ===== Pop na curtida ===== */
.like-pop { animation: fs-like-pop .3s ease; display: inline-block; }
@keyframes fs-like-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

/* ===== Card do jogador estilo FIFA ===== */
.fifa-card {
  position: relative;
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.4rem 1.3rem 1.1rem;
  border-radius: 20px;
  color: #f7f2d8;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(37, 208, 255, .35), transparent 55%),
    linear-gradient(160deg, #1a2c4a 0%, #0b1220 60%, #12233f 100%);
  border: 2px solid #d9b64e;
  box-shadow: 0 18px 44px rgba(6, 12, 24, .45), inset 0 0 40px rgba(217, 182, 78, .08);
  overflow: hidden;
}

.fifa-card::before {
  /* brilho diagonal sutil */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .06) 50%, transparent 60%);
  pointer-events: none;
}

.fifa-top {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
}

.fifa-rating {
  text-align: center;
  line-height: 1;
  flex: none;
  min-width: 62px;
}
.fifa-ovr {
  font-family: "Poppins", sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  color: #f6d878;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.fifa-pos {
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #f6d878;
  margin-top: .1rem;
}
.fifa-rating .fifa-num {
  font-size: .8rem;
  font-weight: 600;
  color: #cdd9ea;
  margin-top: .35rem;
}

.fifa-photo {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.fifa-photo img,
.fifa-photo .fifa-ph {
  width: 118px;
  height: 118px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(246, 216, 120, .5);
  background: #1c2a3f;
}
.fifa-photo .fifa-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 3.4rem;
}

.fifa-name {
  margin-top: .7rem;
  text-align: center;
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #fff;
  border-bottom: 2px solid rgba(246, 216, 120, .35);
  padding-bottom: .5rem;
}
.fifa-nick { font-size: .8rem; font-weight: 600; color: #f6d878; text-transform: none; }

.fifa-tier {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .8rem; border-radius: 999px;
  font-family: "Poppins", sans-serif; font-weight: 700; font-size: .82rem;
  letter-spacing: .02em; border: 1px solid transparent;
}
.fifa-tier.tier-ouro { background: rgba(244,196,48,.18); color: #f4c430; border-color: rgba(244,196,48,.5); }
.fifa-tier.tier-prata { background: rgba(192,199,208,.16); color: #d4dae2; border-color: rgba(192,199,208,.45); }
.fifa-tier.tier-bronze { background: rgba(205,139,78,.18); color: #d89a63; border-color: rgba(205,139,78,.5); }
.fifa-tier.tier-base { background: rgba(159,176,200,.14); color: #9fb0c8; border-color: rgba(159,176,200,.4); }

.fifa-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .3rem;
  margin-top: .7rem;
}
.fifa-stats.cols-5 { grid-template-columns: repeat(5, 1fr); }
.fifa-stat { text-align: center; }
.fifa-stat .v { font-family: "Poppins", sans-serif; font-size: 1.5rem; font-weight: 800; color: #fff; line-height: 1; }
.fifa-stat .l { font-size: .62rem; font-weight: 700; letter-spacing: .06em; color: #9fb0c8; text-transform: uppercase; margin-top: .2rem; }

/* ===== Conquistas / medalhas ===== */
.fs-badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.fs-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .7rem;
  border-radius: 999px;
  background: var(--fs-surface);
  border: 1px solid var(--fs-border);
  box-shadow: var(--fs-shadow-sm);
  font-size: .82rem; font-weight: 600;
}
.fs-badge .fb-ico { font-size: 1.1rem; line-height: 1; }
.fs-badge small { color: var(--fs-muted); font-weight: 500; }

/* ===== Pódio de artilharia ===== */
.fs-podium {
  display: flex; align-items: flex-end; justify-content: center; gap: .6rem;
  padding: 1rem .5rem .3rem;
}
.fs-podium-step { flex: 1; max-width: 150px; text-align: center; }
.fs-podium-av {
  width: 62px; height: 62px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--fs-border); background: var(--fs-surface);
  margin: 0 auto .35rem;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.fs-podium-step.p1 .fs-podium-av { width: 76px; height: 76px; border-color: #f4c430; box-shadow: 0 0 0 3px rgba(244,196,48,.25); }
.fs-podium-step.p2 .fs-podium-av { border-color: #c0c7d0; }
.fs-podium-step.p3 .fs-podium-av { border-color: #cd8b4e; }
.fs-podium-name { font-weight: 700; font-size: .9rem; }
.fs-podium-goals { color: var(--fs-muted); font-size: .8rem; }
.fs-podium-bar {
  margin-top: .5rem; border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, var(--fs-navy), var(--fs-dark));
  color: #fff; font-family: "Poppins", sans-serif; font-weight: 800; font-size: 1.4rem;
  display: flex; align-items: flex-start; justify-content: center; padding-top: .5rem;
}
.fs-podium-step.p1 .fs-podium-bar { height: 96px; background: linear-gradient(180deg, #b8942e, #7a611b); }
.fs-podium-step.p2 .fs-podium-bar { height: 72px; background: linear-gradient(180deg, #7d8593, #565d68); }
.fs-podium-step.p3 .fs-podium-bar { height: 56px; background: linear-gradient(180deg, #a06a3a, #6d4622); }

/* Botão em estado "copiado" */
.fs-copied { color: var(--fs-green) !important; border-color: var(--fs-green) !important; }

/* QR Code do Pix */
.fs-pix-qr { background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--fs-border); line-height: 0; }
.fs-pix-qr svg { width: 150px; height: 150px; display: block; }

/* Banner "próximo compromisso" na home */
.fs-next { border-left: 4px solid var(--fs-blue); }
.fs-next-when { min-width: 52px; color: var(--fs-blue); }

/* Botão Criar central na bottom nav */
.fs-bottomnav a.bn-criar { color: var(--fs-blue); font-weight: 700; }
.fs-bottomnav a.bn-criar .bn-ico { font-size: 1.5rem; }

/* ===== Estado vazio ===== */
.fs-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--fs-border);
  border-radius: var(--fs-radius);
  background: var(--fs-surface);
}
.fs-empty .fs-empty-ico { font-size: 3rem; line-height: 1; margin-bottom: .5rem; }
.fs-empty h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.fs-empty p { color: var(--fs-muted); max-width: 32rem; margin: 0 auto 1rem; }

/* ===== Floating helpers ===== */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}
