/* ACAMPMAIS - estilos do painel. Paleta institucional + ajustes de acessibilidade (contraste WCAG AA). */
:root {
    --ac-primary: #16A765;
    --ac-support: #08C7A1;
    --ac-dark: #087443;
    --ac-orange: #FF7A1A;
    --ac-yellow: #FFD447;
    --ac-text: #123B40;
    --ac-bg: #F1FCF7;
    --ac-wine: #740839;
    --ac-sidebar: 270px;

    --bs-body-color: var(--ac-text);
    --bs-body-bg: var(--ac-bg);
    --bs-link-color: #087443;
    --bs-link-hover-color: #065a33;
    --bs-border-radius: .6rem;
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Botão principal: verde institucional escuro (contraste 6,4:1 com texto branco) */
.btn-primary {
    --bs-btn-bg: var(--ac-dark);
    --bs-btn-border-color: var(--ac-dark);
    --bs-btn-hover-bg: #065a33;
    --bs-btn-hover-border-color: #065a33;
    --bs-btn-active-bg: #054a2a;
    --bs-btn-active-border-color: #054a2a;
    --bs-btn-disabled-bg: var(--ac-dark);
    --bs-btn-disabled-border-color: var(--ac-dark);
    --bs-btn-focus-shadow-rgb: 22, 167, 101;
}
.btn-outline-primary {
    --bs-btn-color: var(--ac-dark);
    --bs-btn-border-color: var(--ac-dark);
    --bs-btn-hover-bg: var(--ac-dark);
    --bs-btn-hover-border-color: var(--ac-dark);
}
.btn-accent { --bs-btn-bg: var(--ac-orange); --bs-btn-border-color: var(--ac-orange); --bs-btn-color: #2a1300; --bs-btn-hover-bg: #e86d10; --bs-btn-hover-border-color: #e86d10; --bs-btn-hover-color: #2a1300; }
.form-control:focus, .form-select:focus { border-color: var(--ac-primary); box-shadow: 0 0 0 .2rem rgba(22, 167, 101, .25); }
:focus-visible { outline: 3px solid var(--ac-orange); outline-offset: 2px; }
.card { border-color: #d6ece2; box-shadow: 0 1px 2px rgba(18, 59, 64, .04); }
.table > :not(caption) > * > * { padding-top: .65rem; padding-bottom: .65rem; }

.skip-link { position: absolute; z-index: 2000; left: .5rem; top: .5rem; padding: .5rem .75rem; background: #fff; border-radius: .4rem; }

/* ---------- Login e páginas de erro ---------- */
.auth-body { background: linear-gradient(160deg, var(--ac-dark) 0%, var(--ac-primary) 55%, var(--ac-support) 100%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth-card { background: #fff; width: 100%; max-width: 420px; border-radius: 1rem; padding: 2rem 1.75rem; box-shadow: 0 12px 40px rgba(8, 40, 30, .28); }
.auth-brand { display: flex; align-items: center; gap: .6rem; justify-content: center; margin-bottom: 1.5rem; }
.auth-brand-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--ac-dark); color: #fff; display: grid; place-items: center; font-size: 1.4rem; }
.auth-brand-name { font-size: 1.6rem; font-weight: 800; letter-spacing: .06em; color: var(--ac-dark); }
.auth-footer { color: rgba(255, 255, 255, .92); margin: 1.25rem 0 0; font-size: .9rem; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--ac-dark); line-height: 1; margin-bottom: .5rem; }

/* ---------- Estrutura do painel ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { width: var(--ac-sidebar); background: var(--ac-dark); color: #fff; flex-shrink: 0; display: flex; flex-direction: column; }
@media (min-width: 992px) {
    .app-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
@media (max-width: 991.98px) {
    .app-sidebar { --bs-offcanvas-width: var(--ac-sidebar); background: var(--ac-dark); }
}
.side-brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.25rem; font-weight: 800; letter-spacing: .06em; font-size: 1.15rem; }
.side-brand-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; }
.side-nav { padding: 0 .75rem 1.5rem; display: flex; flex-direction: column; gap: 2px; }
.side-group { margin: 1rem .5rem .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #b7e8d0; font-weight: 700; }
.side-link { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: .55rem; color: #fff; text-decoration: none; font-size: .93rem; }
.side-link i { width: 1.25rem; text-align: center; font-size: 1.05rem; }
a.side-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.side-link.active { background: #fff; color: var(--ac-dark); font-weight: 700; }
.side-link.disabled { color: #b7e8d0; cursor: not-allowed; }
.side-soon { margin-left: auto; font-size: .65rem; padding: .1rem .4rem; border-radius: 1rem; background: rgba(255, 255, 255, .14); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: #fff; border-bottom: 1px solid #d6ece2; position: sticky; top: 0; z-index: 100; }
.app-content { padding: 1.25rem; max-width: 1400px; width: 100%; }
@media (min-width: 992px) { .app-content { padding: 1.75rem 2rem; } }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.form-narrow { max-width: 520px; }

.event-switch { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.event-switch .form-select { max-width: 320px; }
.user-menu { display: flex; align-items: center; gap: .5rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ac-dark); color: #fff; font-size: .8rem; font-weight: 700; display: grid; place-items: center; }

/* ---------- Indicadores ---------- */
.stat-card { display: flex; gap: .85rem; align-items: center; background: #fff; border: 1px solid #d6ece2; border-radius: .85rem; padding: 1rem; height: 100%; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .85rem; color: #3f6166; }
.stat-hint { font-size: .75rem; color: #5b7377; }
.tone-green .stat-icon { background: #dff5ea; color: var(--ac-dark); }
.tone-orange .stat-icon { background: #ffe9d6; color: #a64600; }
.tone-yellow .stat-icon { background: #fff4c7; color: #7a5b00; }
.tone-wine .stat-icon { background: #f6dde7; color: var(--ac-wine); }
.tone-teal .stat-icon { background: #d5f6ef; color: #04685a; }
.type-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .25rem; }

/* ---- Eventos (Etapa 4) ---- */
.event-header { margin-bottom: 1.25rem; }
.event-tabs { overflow-x: auto; overflow-y: hidden; white-space: nowrap; -webkit-overflow-scrolling: touch; border-bottom: 1px solid #dee2e6; }
.event-tabs .nav-link { color: #123B40; white-space: nowrap; }
.event-tabs .nav-link.active { color: #087443; font-weight: 600; border-color: #dee2e6 #dee2e6 #fff; }
.badge-wine { background-color: #740839; color: #fff; }
.text-prewrap { white-space: pre-wrap; }
.event-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: .5rem; flex: 0 0 72px; }
.info-list dt { color: #5b6b6e; font-weight: 600; }
.info-list dd { margin-bottom: .6rem; }
.type-dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; margin-right: .4rem; border: 1px solid rgba(0,0,0,.2); }
.min-w-0 { min-width: 0; }
.form-wide { max-width: 920px; }

/* ---- Páginas públicas do evento (Etapa 5) ---- */
.pub-body { background: var(--ac-bg); min-height: 100vh; display: flex; flex-direction: column; }
.pub-header { background: #fff; border-bottom: 3px solid var(--ac-primary); }
.pub-header-inner { display: flex; align-items: center; min-height: 56px; }
.pub-brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ac-text); font-weight: 700; text-decoration: none; }
.pub-brand img { width: 40px; height: 40px; object-fit: cover; border-radius: .5rem; }
.pub-brand-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: .5rem; background: var(--ac-primary); color: #fff; font-size: 1.3rem; }
.pub-main { flex: 1 0 auto; padding-top: 1.25rem; padding-bottom: 2rem; max-width: 1080px; }
.pub-footer { padding: 1.25rem 0; text-align: center; color: #4d6a6d; border-top: 1px solid #d5e8de; background: #fff; }
.pub-hero { background: linear-gradient(135deg, var(--ac-dark), var(--ac-text)); background-size: cover; background-position: center; color: #fff; border-radius: 1rem; padding: 2rem 1.25rem; }
.pub-hero h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 800; }
.pub-hero .alert { color: var(--ac-text); }
.pub-facts li { margin-bottom: .25rem; }
.pub-sticky { position: sticky; top: 1rem; }
@media (max-width: 991.98px) { .pub-sticky { position: static; } }

.type-card { display: block; height: 100%; padding: .85rem 1rem; background: #fff; border: 2px solid #cfe3d8; border-radius: .75rem; cursor: pointer; }
.type-card:hover { border-color: var(--ac-primary); }
.btn-check:checked + .type-card { border-color: var(--ac-dark); box-shadow: 0 0 0 3px rgba(22, 167, 101, .25); background: #f4fdf8; }
.btn-check:focus-visible + .type-card { outline: 3px solid var(--ac-orange); outline-offset: 2px; }
.type-card.is-disabled { opacity: .55; cursor: not-allowed; }

.term-box { padding: .75rem 0; border-bottom: 1px solid #e3efe8; }
.term-box:last-of-type { border-bottom: 0; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.reg-code { display: inline-block; padding: .75rem 1.75rem; border: 2px dashed var(--ac-primary); border-radius: .75rem; background: #f4fdf8; }
.reg-code-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 2rem; font-weight: 800; letter-spacing: .15em; color: var(--ac-dark); }
.pub-form .form-label { font-weight: 600; }
