:root {
    --st-yellow: #EEDC52; --st-lime: #B0D561; --st-green: #5AC888; --st-teal: #05B8AE;
    --st-blue: #2C7A9A; --st-indigo: #3C3A69; --st-plum: #521647; --st-wine: #930D3E;
    --st-red: #C8033A; --st-coral: #FF5A33; --st-orange: #FF8B1F;
    --bs-primary: #2C7A9A; --bs-primary-rgb: 44, 122, 154;
    --bs-link-color: #2C7A9A; --bs-link-color-rgb: 44, 122, 154;
    --bs-link-hover-color: #C8033A; --bs-link-hover-color-rgb: 200, 3, 58;
    --bs-body-bg: #f6f7fb;
}
body { background: var(--bs-body-bg); }
.btn-primary { --bs-btn-bg: var(--st-blue); --bs-btn-border-color: var(--st-blue); --bs-btn-hover-bg: #24657f; --bs-btn-hover-border-color: #24657f; --bs-btn-active-bg: #1e566c; --bs-btn-disabled-bg: #7aa9bd; --bs-btn-disabled-border-color: #7aa9bd; }
.btn-outline-primary { --bs-btn-color: var(--st-blue); --bs-btn-border-color: var(--st-blue); --bs-btn-hover-bg: var(--st-blue); --bs-btn-hover-border-color: var(--st-blue); --bs-btn-active-bg: var(--st-blue); }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--st-red); --bs-btn-border-color: var(--st-red); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--st-wine); --bs-btn-hover-border-color: var(--st-wine); --bs-btn-active-bg: var(--st-wine); --bs-btn-disabled-bg: #e48aa3; --bs-btn-disabled-border-color: #e48aa3; --bs-btn-disabled-color: #fff; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--st-teal); box-shadow: 0 0 0 .2rem rgba(5, 184, 174, .2); }
.form-check-input:checked { background-color: var(--st-teal); border-color: var(--st-teal); }

/* Franja de colors de la marca */
.brand-stripes { display: flex; height: 8px; }
.brand-stripes.thin { height: 4px; }
.brand-stripes span { flex: 1; }
.brand-stripes span:nth-child(1) { background: var(--st-yellow); } .brand-stripes span:nth-child(2) { background: var(--st-lime); }
.brand-stripes span:nth-child(3) { background: var(--st-green); }  .brand-stripes span:nth-child(4) { background: var(--st-teal); }
.brand-stripes span:nth-child(5) { background: var(--st-blue); }   .brand-stripes span:nth-child(6) { background: var(--st-indigo); }
.brand-stripes span:nth-child(7) { background: var(--st-plum); }   .brand-stripes span:nth-child(8) { background: var(--st-wine); }
.brand-stripes span:nth-child(9) { background: var(--st-red); }    .brand-stripes span:nth-child(10) { background: var(--st-coral); }
.brand-stripes span:nth-child(11) { background: var(--st-orange); }

.brand-word { font-weight: 900; letter-spacing: .04em; font-size: 1.35rem; color: var(--st-indigo); text-decoration: none; text-transform: uppercase; }
.brand-word span { color: var(--st-teal); }
.brand-word-light, .brand-word-light:hover { color: #fff; }

/* ---------- Web pública ---------- */
.public-header { background: #fff; border-bottom: 1px solid #eceef3; }
.public-footer { background: #fff; border-top: 1px solid #eceef3; color: #4b5563; }
.hero { background: #fff; border-radius: 1.25rem; overflow: hidden; box-shadow: 0 10px 30px rgba(60, 58, 105, .08); }
.hero-head { padding: 0; background: #fff; border-bottom: 1px solid #eef0f4; line-height: 0; }
.hero-img { display: block; width: 100%; height: auto; }
.hero-body { max-width: 760px; margin: 0 auto; padding: 2rem 1.5rem 2.5rem; }
.hero-foot { padding: 1.5rem; border-top: 1px solid #eef0f4; background: #fff; }
.footer-logos { display: block; width: 100%; max-width: 820px; height: auto; margin: 0 auto; }
.hero h1 { font-weight: 900; color: var(--st-indigo); letter-spacing: .02em; }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; gap: .85rem; padding: .7rem 0; border-bottom: 1px dashed #e5e7eb; }
.info-list li:last-child { border-bottom: 0; }
.info-list .ico { flex: 0 0 2.4rem; height: 2.4rem; border-radius: .7rem; display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.ico-1 { background: var(--st-teal); } .ico-2 { background: var(--st-blue); } .ico-3 { background: var(--st-red); } .ico-4 { background: var(--st-orange); }
.form-card { background: #fff; border-radius: 1.25rem; box-shadow: 0 10px 30px rgba(60, 58, 105, .08); }
.form-card .card-head { padding: 1.5rem 1.75rem; border-bottom: 1px solid #eef0f4; }
.form-card .card-body { padding: 1.75rem; }
.required::after { content: " *"; color: var(--st-red); }
.ambit-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.ambit-options .btn { padding: .8rem .5rem; font-weight: 600; }
.btn-check:checked + .btn-outline-ambit { background: var(--st-teal); border-color: var(--st-teal); color: #fff; }
.btn-outline-ambit { border: 2px solid #d6dae3; color: #374151; background: #fff; }
.btn-outline-ambit:hover { border-color: var(--st-teal); color: var(--st-teal); }
.privacy-box { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: .75rem; }
.privacy-box summary { cursor: pointer; padding: .75rem 1rem; font-weight: 600; color: var(--st-blue); list-style: none; }
.privacy-box summary::-webkit-details-marker { display: none; }
.privacy-box summary::before { content: "\F285"; font-family: bootstrap-icons; margin-right: .4rem; display: inline-block; transition: transform .2s; }
.privacy-box[open] summary::before { transform: rotate(90deg); }
.privacy-box .privacy-text { padding: 0 1rem 1rem; font-size: .85rem; color: #4b5563; max-height: 320px; overflow: auto; }
.privacy-text p { margin-bottom: .5rem; }
.status-box { background: #fff; border-radius: 1.25rem; padding: 2.5rem 1.5rem; text-align: center; box-shadow: 0 10px 30px rgba(60, 58, 105, .08); }
.status-box .big-ico { font-size: 3rem; }
.status-box p { font-size: 1.2rem; margin-bottom: .35rem; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.ticket { max-width: 420px; margin: 0 auto; background: #fff; border-radius: 1.25rem; overflow: hidden; box-shadow: 0 10px 30px rgba(60, 58, 105, .12); }
.ticket .qr svg, .ticket .qr img { width: 100%; max-width: 280px; height: auto; }

/* ---------- Panell ---------- */
.panel-topbar { background: var(--st-indigo); }
.panel-wrap { display: flex; min-height: calc(100vh - 60px); }
.panel-sidebar { width: 260px; flex: 0 0 260px; background: #fff; border-right: 1px solid #e7e9f0; }
@media (min-width: 992px) { .panel-sidebar .offcanvas-body { position: sticky; top: 60px; height: calc(100vh - 64px); display: flex; overflow-y: auto; } }
.panel-sidebar .nav-link { color: #374151; border-radius: .6rem; }
.panel-sidebar .nav-link:hover { background: #f1f5f9; }
.panel-sidebar .nav-link.active { background: var(--st-indigo); color: #fff; }
.panel-main { flex: 1; min-width: 0; padding: 1.5rem; max-width: 1400px; }
.panel-main.mx-auto { max-width: 980px; }
@media (max-width: 575.98px) { .panel-main { padding: 1rem .75rem; } }
.page-title { font-weight: 800; color: var(--st-indigo); }
.card { border: 0; border-radius: 1rem; box-shadow: 0 4px 18px rgba(60, 58, 105, .06); }
.stat { border-radius: 1rem; padding: 1.1rem 1.25rem; color: #fff; position: relative; overflow: hidden; }
.stat .num { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.stat .lbl { opacity: .9; font-size: .9rem; }
.stat i.bg-ico { position: absolute; right: .75rem; bottom: -.4rem; font-size: 3.6rem; opacity: .2; }
.stat-1 { background: linear-gradient(135deg, var(--st-indigo), var(--st-blue)); }
.stat-2 { background: linear-gradient(135deg, var(--st-wine), var(--st-red)); }
.stat-3 { background: linear-gradient(135deg, var(--st-blue), var(--st-teal)); }
.stat-4 { background: linear-gradient(135deg, var(--st-coral), var(--st-orange)); }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #e5e7eb; flex: 0 0 auto; }
.avatar-sm { width: 30px; height: 30px; }
.avatar-lg { width: 128px; height: 128px; border: 4px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; white-space: nowrap; }
.table td { vertical-align: middle; }
.login-wrap { min-height: calc(100vh - 8px); display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 420px; }

/* Contrasenya */
.strength { height: 8px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.strength-bar { height: 100%; width: 0; transition: width .25s, background-color .25s; }
.password-checklist li { padding: .12rem 0; color: #6b7280; }
.password-checklist li.ok { color: #15803d; }
.password-checklist li.ok i::before { content: "\F26B"; }
.password-checklist li.ko { color: #b91c1c; }
.password-checklist li.ko i::before { content: "\F623"; }
.password-checklist li.optional.ko { color: #a16207; }
.password-checklist li.optional.ko i::before { content: "\F431"; }
.tips-card { background: linear-gradient(160deg, #f0fbfa, #eef4f8); border: 1px solid #d6efed; border-radius: 1rem; padding: 1.1rem 1.25rem; }
.tips-card li { margin-bottom: .45rem; }

/* Escàner */
body.scanner { background: #0f1020; color: #fff; }
.scanner-top { display: flex; align-items: center; justify-content: space-between; padding: .6rem .9rem; background: var(--st-indigo); }
.scanner-top a, .scanner-top button { color: #fff; }
.scan-stage { position: relative; width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 1 / 1; background: #000; overflow: hidden; }
.scan-stage video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 14%; border-radius: 1.25rem; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); pointer-events: none; }
.scan-frame::before, .scan-frame::after { content: ""; position: absolute; inset: 0; border-radius: 1.25rem; border: 4px solid rgba(255, 255, 255, .9); clip-path: polygon(0 0, 22% 0, 22% 4px, 4px 4px, 4px 22%, 0 22%, 0 78%, 4px 78%, 4px calc(100% - 4px), 22% calc(100% - 4px), 22% 100%, 78% 100%, 78% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 78%, 100% 78%, 100% 22%, calc(100% - 4px) 22%, calc(100% - 4px) 4px, 78% 4px, 78% 0, 100% 0, 100% 100%, 0 100%); }
.scan-line { position: absolute; left: 16%; right: 16%; height: 3px; background: var(--st-teal); box-shadow: 0 0 12px var(--st-teal); top: 20%; animation: scan 2.2s ease-in-out infinite; }
@keyframes scan { 0%, 100% { top: 18%; } 50% { top: 80%; } }
.scan-stage.paused .scan-line { display: none; }
.scan-placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 2rem; color: #cbd5e1; }
.result-card { max-width: 560px; margin: 0 auto; border-radius: 0 0 1rem 1rem; padding: 1.1rem 1.25rem; min-height: 120px; transition: background .2s; }
.result-idle { background: #1d1f36; color: #cbd5e1; }
.result-ok { background: #15803d; }
.result-already { background: #b45309; }
.result-invalid { background: #b91c1c; }
.result-notyet, .result-ended { background: linear-gradient(135deg, var(--st-indigo), var(--st-blue)); }
.result-notyet .r-title, .result-ended .r-title { font-size: 1.25rem; }
.window-notice { max-width: 560px; margin: 0 auto; display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 1rem; background: linear-gradient(135deg, var(--st-indigo), var(--st-blue)); color: #fff; font-size: .9rem; }
.window-notice i { font-size: 1.6rem; line-height: 1; }
.window-notice span { opacity: .9; }
.window-notice.test { background: linear-gradient(135deg, #92400e, var(--st-orange)); }
.ticket-note { background: #eef6f9; border-radius: .75rem; padding: .65rem .8rem; font-size: .85rem; color: var(--st-indigo); }
.result-card .r-title { font-size: 1.35rem; font-weight: 800; }
.result-card .r-name { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.scanner .counter { font-size: .9rem; color: #cbd5e1; }
.scanner .list-group-item { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .scan-line { animation: none; } }

/* Portada: tria del formulari d'inscripció (dins del panell principal) */
.inscriu-box { border-top: 1px solid #eceef3; padding-top: 1.5rem; }
@media (max-width: 575.98px) { .hero-body { padding: 1.5rem 1rem 2rem; } }
.choice-row { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; height: 100%; padding: 1rem; background: #fff; border: 2px solid #e5e7eb; border-radius: 1rem; color: #374151; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.choice-row:hover, .choice-row:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(60, 58, 105, .12); color: #374151; }
.choice-registre:hover, .choice-registre:focus-visible { border-color: var(--st-red); }
.choice-protocol:hover, .choice-protocol:focus-visible { border-color: var(--st-blue); }
.choice-sub { font-size: .8rem; color: #6b7280; line-height: 1.3; }
.choice-ico { margin-bottom: .25rem; }
.choice-ico { flex: 0 0 2.8rem; width: 2.8rem; height: 2.8rem; border-radius: .85rem; display: grid; place-items: center; color: #fff; font-size: 1.3rem; }
.choice-registre .choice-ico { background: linear-gradient(135deg, var(--st-coral), var(--st-red)); }
.choice-protocol .choice-ico { background: linear-gradient(135deg, var(--st-teal), var(--st-blue)); }
.choice-title { font-size: 1.05rem; font-weight: 800; color: var(--st-indigo); }
@media (prefers-reduced-motion: reduce) { .choice-row { transition: none; } .choice-row:hover { transform: none; } }
