/* ==========================================================
   Sorteios IFRN — estilos da área administrativa e páginas públicas
   ========================================================== */
@font-face { font-family: "Open Sans"; src: url("../vendor/fonts/OpenSans.woff") format("woff"); font-weight: 300 800; font-display: block; }
@font-face { font-family: "Montserrat"; src: url("../vendor/fonts/Montserrat.woff") format("woff"); font-weight: 100 900; font-display: swap; }

:root {
  --ifrn: #2f9e41;
  --ifrn-esc: #1d7a2e;
  --ifrn-prof: #0f4d1c;
  --ifrn-verm: #cd191e;
  --ifrn-claro: #e9f6eb;
  --fundo: #f3f6f4;
  --borda: #e1e7e3;
  --texto: #1f2a22;
  --bs-font-sans-serif: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-primary: #2f9e41;
  --bs-primary-rgb: 47, 158, 65;
  --bs-link-color: #1d7a2e;
  --bs-link-color-rgb: 29, 122, 46;
  --bs-link-hover-color: #0f4d1c;
}
body { font-family: var(--bs-font-sans-serif); color: var(--texto); background: var(--fundo); }

/* ---------- Marca IFRN (grade 3x3, círculo vermelho) ---------- */
.ifrn-logo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 42px; height: 42px; flex: none; }
.ifrn-logo span { background: var(--ifrn); border-radius: 3px; }
.ifrn-logo span:first-child { background: var(--ifrn-verm); border-radius: 50%; }
.ifrn-logo.logo-sm { width: 28px; height: 28px; gap: 2px; }
.ifrn-logo.logo-sm span { border-radius: 2px; }
.ifrn-logo.logo-sm span:first-child { border-radius: 50%; }
.topbar .ifrn-logo span:not(:first-child) { background: #fff; opacity: .92; }

/* ---------- Botões ---------- */
.btn-ifrn {
  --bs-btn-color: #fff; --bs-btn-bg: var(--ifrn); --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ifrn-esc); --bs-btn-active-bg: var(--ifrn-prof);
  background-image: linear-gradient(135deg, #38b04b 0%, #2f9e41 50%, #23863a 100%);
  box-shadow: 0 6px 16px -8px rgba(47, 158, 65, .8);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s;
}
.btn-ifrn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 10px 20px -10px rgba(47, 158, 65, .9); }
.btn-primary { --bs-btn-bg: var(--ifrn); --bs-btn-border-color: var(--ifrn); --bs-btn-hover-bg: var(--ifrn-esc); --bs-btn-hover-border-color: var(--ifrn-esc); --bs-btn-active-bg: var(--ifrn-prof); --bs-btn-disabled-bg: var(--ifrn); --bs-btn-disabled-border-color: var(--ifrn); }
.btn-outline-primary { --bs-btn-color: var(--ifrn-esc); --bs-btn-border-color: var(--ifrn); --bs-btn-hover-bg: var(--ifrn); --bs-btn-hover-border-color: var(--ifrn); --bs-btn-active-bg: var(--ifrn-esc); }
.btn-festa {
  --bs-btn-color: #3b2600; --bs-btn-hover-color: #3b2600; border: 0; font-weight: 800; letter-spacing: .03em;
  background: linear-gradient(135deg, #ffe58a, #ffc72c 45%, #f2a900); box-shadow: 0 8px 18px -10px rgba(242, 169, 0, .9);
}
.btn-festa:hover { filter: brightness(1.05); }
.form-check-input:checked { background-color: var(--ifrn); border-color: var(--ifrn); }
.form-control:focus, .form-select:focus { border-color: #7fcc8b; box-shadow: 0 0 0 .2rem rgba(47, 158, 65, .18); }
.nav-pills .nav-link.active { background: var(--ifrn); }
.text-ifrn { color: var(--ifrn-esc) !important; }
.bg-ifrn-claro { background: var(--ifrn-claro) !important; }

/* ---------- Estrutura admin ---------- */
.topbar { background: linear-gradient(90deg, #0f4d1c 0%, #1d7a2e 55%, #2f9e41 100%); box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.topbar .navbar-brand { font-size: 1rem; }
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 250px; background: #fff; border-right: 1px solid var(--borda); }
@media (min-width: 992px) { .sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); } .sidebar .offcanvas-body { display: flex; height: 100%; } }
.sidebar .nav-link { color: #3b4a40; border-radius: .6rem; padding: .62rem .9rem; margin: 1px 0; display: flex; align-items: center; gap: .7rem; font-weight: 500; font-size: .93rem; }
.sidebar .nav-link i { font-size: 1.05rem; color: #6b7d70; }
.sidebar .nav-link:hover { background: var(--ifrn-claro); color: var(--ifrn-prof); }
.sidebar .nav-link.active { background: linear-gradient(90deg, rgba(47,158,65,.16), rgba(47,158,65,.04)); color: var(--ifrn-prof); font-weight: 700; box-shadow: inset 3px 0 0 var(--ifrn); }
.sidebar .nav-link.active i { color: var(--ifrn); }
.conteudo { flex: 1; min-width: 0; padding: 1.5rem; }
@media (max-width: 576px) { .conteudo { padding: 1rem; } }

.card { border: 1px solid var(--borda); border-radius: .9rem; box-shadow: 0 1px 2px rgba(16, 40, 22, .04); }
.card-header { background: #fff; border-bottom: 1px solid var(--borda); font-weight: 700; border-radius: .9rem .9rem 0 0 !important; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7d70; font-weight: 700; background: #fafcfb; }

/* KPIs */
.kpi { background: #fff; border: 1px solid var(--borda); border-radius: .9rem; padding: 1rem; display: flex; gap: .9rem; align-items: center; height: 100%; }
.kpi-icone { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex: none; }
.kpi-valor { font-size: 1.55rem; font-weight: 800; line-height: 1; }
.kpi-rotulo { font-size: .8rem; color: #6b7d70; margin-top: .2rem; }
.kpi-extra { font-size: .72rem; color: #8a988e; }
.kpi-success .kpi-icone { background: #e3f4e6; color: var(--ifrn); }
.kpi-warning .kpi-icone { background: #fff4d6; color: #b07d00; }
.kpi-danger .kpi-icone { background: #fde5e5; color: var(--ifrn-verm); }
.kpi-info .kpi-icone { background: #e2f1fb; color: #1673a8; }
.kpi-dark .kpi-icone { background: #eceff1; color: #37474f; }

.atalho { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border: 1px solid var(--borda); border-radius: .8rem; background: #fff; color: inherit; text-decoration: none; transition: all .15s; }
.atalho:hover { border-color: #9fd6a8; background: #f7fcf8; transform: translateY(-1px); }
.atalho i { font-size: 1.4rem; color: var(--ifrn); }

.premio-thumb { width: 52px; height: 52px; border-radius: .6rem; object-fit: cover; background: var(--ifrn-claro); display: grid; place-items: center; color: var(--ifrn); font-size: 1.4rem; flex: none; }
.grupo-chip { display: inline-block; font-size: .72rem; padding: .15rem .5rem; border-radius: 1rem; background: #eef2ef; color: #3b4a40; margin: 1px; }
.bastidores { border: 1px dashed #c9a227; background: #fffbea; border-radius: .7rem; padding: .8rem 1rem; }
.bastidores-titulo { font-size: .75rem; font-weight: 800; text-transform: uppercase; color: #8a6d00; letter-spacing: .05em; }

.ao-vivo-ponto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2fbf4a; box-shadow: 0 0 0 0 rgba(47,191,74,.7); animation: pulso 1.6s infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(47,191,74,.7) } 70% { box-shadow: 0 0 0 10px rgba(47,191,74,0) } 100% { box-shadow: 0 0 0 0 rgba(47,191,74,0) } }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(1200px 600px at 10% -10%, #c9ecd0 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #d6f0da 0%, transparent 55%), #f3f6f4; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 1.2rem; padding: 2rem; box-shadow: 0 20px 50px -20px rgba(15, 77, 28, .35); }
.login-marca { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.login-titulo { font-weight: 800; font-size: 1.25rem; }

/* ---------- Páginas públicas (mobile first) ---------- */
.publico { min-height: 100vh; background: linear-gradient(160deg, #0f4d1c 0%, #1d7a2e 45%, #2f9e41 100%); color: #fff; position: relative; overflow-x: hidden; }
.publico::before { content: ""; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 80% 0%, rgba(255, 213, 74, .25), transparent 70%), radial-gradient(500px 400px at 0% 100%, rgba(255,255,255,.12), transparent 70%); }
.pub-wrap { position: relative; max-width: 560px; margin: 0 auto; padding: 1.25rem 1rem 2.5rem; }
.pub-topo { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: .9rem; opacity: .95; margin-bottom: 1.2rem; }
.pub-topo .ifrn-logo span:not(:first-child) { background: #fff; }
.pub-card { background: #fff; color: var(--texto); border-radius: 1.3rem; padding: 1.5rem; box-shadow: 0 25px 60px -25px rgba(0,0,0,.55); position: relative; overflow: hidden; }
.pub-card-banner { margin: -1.5rem -1.5rem 1.2rem; height: 170px; background-size: cover; background-position: center; }
.pub-evento { font-weight: 800; font-size: 1.5rem; line-height: 1.15; }
.pub-meta { color: #6b7d70; font-size: .9rem; }
.btn-participar { font-size: 1.2rem; font-weight: 800; padding: 1rem; border-radius: 1rem; letter-spacing: .02em; }
.pub-sucesso-icone { width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 1rem; display: grid; place-items: center; font-size: 3rem; color: #fff;
  background: linear-gradient(135deg, #38b04b, #1d7a2e); box-shadow: 0 0 0 10px #e3f4e6; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.2); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.pub-numero { font-family: "Montserrat"; font-weight: 900; font-size: 2.6rem; letter-spacing: .08em; color: var(--ifrn-esc); }
.pub-rodape { text-align: center; font-size: .78rem; opacity: .85; margin-top: 1.2rem; }
.pub-rodape a { color: #fff; }
.privacidade-box { font-size: .82rem; background: #f6f8f7; border-radius: .8rem; padding: .8rem 1rem; color: #516056; }

.lista-resultados .item { display: flex; gap: .8rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid #eef2ef; }
.lista-resultados .item:last-child { border-bottom: 0; }
.trofeu { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #ffe58a, #f2a900); color: #5c3d00; flex: none; }

/* ---------- Impressão (relatórios / PDF) ---------- */
@media print {
  .topbar, .sidebar, .no-print, .btn, .alert { display: none !important; }
  body, .conteudo { background: #fff !important; padding: 0 !important; }
  .card { border: 0; box-shadow: none; }
  .print-only { display: block !important; }
  a { color: inherit; text-decoration: none; }
  table { font-size: 10pt; }
}
.print-only { display: none; }

.qr-box { width: 220px; height: 220px; background: #fff; padding: 6px; border-radius: .6rem; border: 1px solid var(--borda); }
.qr-box svg { width: 100%; height: 100%; display: block; }
body.ctrl-ocupado { cursor: progress; }
.ctrl-atual { border-width: 2px; }
.min-w-0 { min-width: 0; }
#listaPremios .btn { min-width: 44px; min-height: 40px; }

/* ---------- Marca IF (SVG conforme manual) ---------- */
svg.marca-if, svg[class^="marca-"], svg[class*=" marca-"] { display: block; width: auto; flex: none; }
.marca-topo { height: 38px; }
.marca-topo-simbolo { height: 32px; }
.topo-app { font-weight: 700; font-size: 1rem; padding-left: .8rem; margin-left: .2rem; border-left: 1px solid rgba(255,255,255,.35); }
.marca-login { height: 56px; }
.marca-publico { height: 40px; }
.marca-relatorio { height: 46px; }
.pub-topo { margin-bottom: 1.4rem; }

.qr-box-sm { width: 132px; height: 132px; padding: 4px; }
.flex-none { flex: none; }
.ctrl-link .card-header { font-size: .95rem; }

.premio-linha { cursor: pointer; }
.premio-linha:hover > td { background: #f7fcf8; }
.premio-linha[aria-expanded="true"] .seta { transform: rotate(180deg); }
.premio-linha .seta { display: inline-block; transition: transform .2s; }
.premio-detalhe > td { border-top: 0; padding-top: 0; }
