#form_container
{
	margin:0 auto;
	text-align:left;
	max-width:640px;
}

#top
{
	display:block;
	height:10px;
	margin:20px auto 0;
	max-width:650px;
}

#bottom
{
	display:block;
	height:10px;
	margin:0 auto;
	max-width:650px;
	overflow:hidden;
}

form.appnitro
{
	margin:20px 20px 0;
	padding:0 0 20px;
}


/**** Form Section ****/
.appnitro
{
	font-family:Lucida Grande, Tahoma, Arial, Verdana, sans-serif;
	font-size:small;
}

form ul
{
	font-size:100%;
	list-style-type:none;
	margin:0;
	padding:0;
	width:100%;
}

form li
{
	display:block;
	margin:0;
	padding:4px 5px 2px 9px;
	position:relative;
}

form li:after
{
	clear:both;
	content:".";
	display:block;
	height:0;
	visibility:hidden;
}

.buttons:after
{
	clear:both;
	content:".";
	display:block;
	height:0;
	visibility:hidden;
}

.buttons
{
	clear:both;
	display:block;
	margin-top:10px;
}

* html form li
{
	height:1%;
}

* html .buttons
{
	height:1%;
}

* html form li div
{
	display:inline-block;
}

form li div
{
	color:#444;
	margin:0 4px 0 0;
	padding:0 0 8px;
}

form li span
{
	color:#444;
	margin:0 4px 0 0;
	padding:0 0 8px;
}

form li div.left
{
	display:inline;
	float:left;
	width:48%;
}

form li div.right
{
	display:inline;
	float:right;
	width:48%;
}

form li div.left .medium
{
	width:100%;
}

form li div.right .medium
{
	width:100%;
}

.clear
{
	clear:both;
}

form li div label
{
	clear:both;
	color:#444;
	display:block;
	margin:0;
	padding-top:3px;
}

form li span label
{
	clear:both;
	color:#444;
	display:block;
	font-size:0.5em;
	line-height:9px;
	margin:0;
	padding-top:3px;
}

form li .datepicker
{
	cursor:pointer !important;
	float:left;
	height:16px;
	margin:.1em 5px 0 0;
	padding:0;
	width:16px;
}

.form_description
{
	border-bottom:1px dotted #ccc;
	clear:both;
	display:inline-block;
	margin:0 0 1em;
}

.form_description[class]
{
	display:block;
}

.form_description h2
{
	clear:left;
	font-size:160%;
	font-weight:400;
	margin:0 0 3px;
}

.form_description p
{
	font-size:95%;
	line-height:130%;
	margin:0 0 12px;
}

form hr
{
	display:none;
}

form li.section_break
{
	border-top:1px dotted #ccc;
	margin-top:9px;
	padding-bottom:0;
	padding-left:9px;
	padding-top:13px;
	width:97% !important;
}

form ul li.first
{
	border-top:none !important;
	margin-top:0 !important;
	padding-top:0 !important;
}

form .section_break h3
{
	font-size:110%;
	font-weight:400;
	line-height:130%;
	margin:0 0 2px;
}

form .section_break p
{
	font-size:85%;

	margin:0 0 10px;
}

/**** Buttons ****/
input.button_text
{
	overflow:visible;
	padding:0 7px;
	width:auto;
}

.buttons input
{
	font-size:120%;
	margin-right:5px;
}

/**** Inputs and Labels ****/
label.description
{
	border:none;
	color:#222;
	display:block;
	font-size:95%;
	font-weight:700;
	line-height:150%;
	padding:0 0 1px;
}

span.symbol
{
	font-size:115%;
	line-height:130%;
}

input.text
{
	background:#fff url(../../../images/shadow.gif) repeat-x top;
	border-bottom:1px solid #ddd;
	border-left:1px solid #c3c3c3;
	border-right:1px solid #c3c3c3;
	border-top:1px solid #7c7c7c;
	color:#333;
	font-size:100%;
	margin:0;
	padding:2px 0;
}

input.file
{
	color:#333;
	font-size:100%;
	margin:0;
	padding:2px 0;
}

textarea.textarea
{
	background:#fff url(../../../images/shadow.gif) repeat-x top;
	border-bottom:1px solid #ddd;
	border-left:1px solid #c3c3c3;
	border-right:1px solid #c3c3c3;
	border-top:1px solid #7c7c7c;
	color:#333;
	font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
	font-size:100%;
	margin:0;
	width:99%;
}

select.select
{
	color:#333;
	font-size:100%;
	margin:1px 0;
	padding:1px 0 0;
	background:#fff url(../../../images/shadow.gif) repeat-x top;
	border-bottom:1px solid #ddd;
	border-left:1px solid #c3c3c3;
	border-right:1px solid #c3c3c3;
	border-top:1px solid #7c7c7c;
}


input.currency
{
	text-align:right;
}

input.checkbox
{
	display:block;
	height:13px;
	line-height:1.4em;
	margin:6px 0 0 3px;
	width:13px;
}

input.radio
{
	display:block;
	height:13px;
	line-height:1.4em;
	margin:6px 0 0 3px;
	width:13px;
}

label.choice
{
	color:#444;
	display:block;
	font-size:100%;
	line-height:1.4em;
	margin:-1.55em 0 0 25px;
	padding:4px 0 5px;
	width:90%;
}

select.select[class]
{
	margin:0;
	padding:1px 0;
}

*:first-child+html select.select[class]
{
	margin:1px 0;
}

.safari select.select
{
	font-size:120% !important;
	margin-bottom:1px;
}

input.small
{
	width:25%;
}

select.small
{
	width:25%;
}

input.medium
{
	width:50%;
}

select.medium
{
	width:50%;
}

input.large
{
	width:99%;
}

select.large
{
	width:100%;
}

textarea.small
{
	height:5.5em;
}

textarea.medium
{
	height:10em;
}

textarea.large
{
	height:20em;
}

/**** Errors ****/
#error_message
{
	background:#fff;
	border:1px dotted red;
	margin-bottom:1em;
	padding-left:0;
	padding-right:0;
	padding-top:4px;
	text-align:center;
	width:99%;
}

#error_message_title
{
	color:#DF0000;
	font-size:125%;
	margin:7px 0 5px;
	padding:0;
}

#error_message_desc
{
	color:#000;
	font-size:100%;
	margin:0 0 .8em;
}

#error_message_desc strong
{
	background-color:#FFDFDF;
	color:red;
	padding:2px 3px;
}

form li.error
{
	background-color:#FFDFDF !important;
	border-bottom:1px solid #EACBCC;
	border-right:1px solid #EACBCC;
	margin:3px 0;
}

form li.error label
{
	color:#DF0000 !important;
}

form p.error
{
	clear:both;
	color:red;
	font-size:0.625em;
	font-weight:700;
	margin:0 0 5px;
}

form .required
{
	color:red;
	float:none;
	font-weight:700;
}

/**** Guidelines and Error Highlight ****/
form li.highlighted
{
	background-color:#fff7c0;
}

form .guidelines
{
	background:#f5f5f5;
	border:1px solid #e6e6e6;
	color:#444;
	font-size:80%;
	left:100%;
	line-height:130%;
	margin:0 0 0 8px;
	padding:8px 10px 9px;
	position:absolute;
	top:0;
	visibility:hidden;
	width:42%;
	z-index:1000;
}

form .guidelines small
{
	font-size:105%;
}

form li.highlighted .guidelines
{
	visibility:visible;
}

form li:hover .guidelines
{
	visibility:visible;
}

.no_guidelines .guidelines
{
	display:none !important;
}

.no_guidelines form li
{
	width:97%;
}

.no_guidelines li.section
{
	padding-left:9px;
}

/*** Success Message ****/
.form_success 
{
	clear: both;
	margin: 0;
	padding: 90px 0pt 100px;
	text-align: center
}

.form_success h2 {
    clear:left;
    font-size:160%;
    font-weight:normal;
    margin:0pt 0pt 3px;
}

/*** Password ****/
ul.password{
    margin-top:60px;
    margin-bottom: 60px;
    text-align: center;
}
.password h2{
    color:#DF0000;
    font-weight:bold;
    margin:0pt auto 10px;
}

.password input.text {
   font-size:170% !important;
   width:380px;
   text-align: center;
}
.password label{
   display:block;
   font-size:120% !important;
   padding-top:10px;
   font-weight:bold;
}

#li_captcha{
   padding-left: 5px;
}


#li_captcha span{
	float:none;
}

/** Embedded Form **/

.embed #form_container{
	border: none;
}

.embed #top, .embed #bottom, .embed h1{
	display: none;
}

.embed #form_container{
	width: 100%;
}

.embed #footer{
	text-align: left;
	padding-left: 10px;
	width: 99%;
}

.embed #footer.success{
	text-align: center;
}

.embed form.appnitro
{
	margin:0px 0px 0;
	
}

.divres { float:left; width:20px; }
.divpr { float:left; }
.description { margin:0 0 20px 20px; }
.blr { clear:both; }
.imatgepersona { width:130px; margin:auto; }
.imatgepersona img { width:100%; }
#bottom { margin-bottom:20px; }

   .status-bar {
        display: flex;
        justify-content: space-between;
        background-color: #f0f0f0;
        padding: 10px;
        margin-bottom: 15px;
        border-radius: 5px;
        font-weight: bold;
    }
    .timer-box { color: #d9534f; }
    .progress-box { color: #337ab7; }
    .nom-input { margin-bottom: 15px; }

	.trivial-ui .card {
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.06);
}

.trivial-ui .imatgepersona {
  width: 150px;
  margin: 10px auto 6px;
}
.trivial-ui .imatgepersona img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
}

/* --- Level selector --- */
.trivial-ui .trivial-level { padding-top: 10px; }

.trivial-ui .level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
@media (max-width: 640px) {
  .trivial-ui .level-grid { grid-template-columns: 1fr; }
}

.trivial-ui .level-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.trivial-ui .level-card {
  display: block;
  height: 100%;
  padding: 14px 14px 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.9);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.trivial-ui .level-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0,0,0,.10);
}
.trivial-ui .level-radio:checked + .level-card {
  border-color: rgba(13,110,253,.70);
  box-shadow: 0 14px 30px rgba(13,110,253,.18);
}

.trivial-ui .level-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(13,110,253,.10);
  margin-bottom: 10px;
}
.trivial-ui .level-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.trivial-ui .level-desc {
  opacity: .85;
  line-height: 1.25em;
}

/* --- Answers --- */
.trivial-ui .fill {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

/* neutralitza floats antics només dins trivial */
.trivial-ui .divres, .trivial-ui .divpr { float: none; width: auto; }

.trivial-ui .answer-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.trivial-ui .answer-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0,0,0,.08);
}

/* puntet “radio” */
.trivial-ui .answer-card::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.28);
  background: transparent;
  flex: 0 0 auto;
}

/* marcador ok/ko */
.trivial-ui .answer-mark {
  width: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* amaga el radio però manté accessibilitat */
.trivial-ui .answer-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.trivial-ui .answer-text {
  line-height: 1.25em;
}

/* Estat seleccionat (modern browsers amb :has) */
.trivial-ui .blr:has(input[type="radio"]:checked) .answer-card {
  border-color: rgba(13,110,253,.70);
  box-shadow: 0 14px 26px rgba(13,110,253,.14);
}

/* Fallback per browsers sense :has (via JS -> .is-selected) */
.trivial-ui .blr.is-selected .answer-card {
  border-color: rgba(13,110,253,.70);
  box-shadow: 0 14px 26px rgba(13,110,253,.14);
}

.trivial-ui .blr:has(input[type="radio"]:checked) .answer-card::before,
.trivial-ui .blr.is-selected .answer-card::before {
  border-color: rgba(13,110,253,.95);
  background: radial-gradient(circle, rgba(13,110,253,.95) 0 42%, transparent 43% 100%);
}

/* --- Progress dots --- */
.trivial-ui .trivial-progress{
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 30px 10px;
  margin: 0 0 10px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
}

.trivial-ui .progress-head{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  margin-bottom: 8px;
}

.trivial-ui .progress-text{
  font-weight: 700;
  opacity: .85;
}

.trivial-ui .progress-dots{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trivial-ui .progress-dot{
  width: 10px;
  height: 10px;
  background: rgba(0,0,0,.16);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.trivial-ui .progress-dot.is-answered{
  background: rgba(13,110,253,.85);
}

.trivial-ui li.buttons{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.trivial-ui .progress-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.trivial-ui .timer-text{
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.08);
}

.trivial-ui .timer-text.is-urgent{
  background: rgba(220,53,69,.10);
  border-color: rgba(220,53,69,.25);
}

/* --- Accordion & Ranking Tabs --- */
.accordion {
  background-color: #f8f9fa;
  color: #333;
  cursor: pointer;
  padding: 15px 20px;
  width: 100%;
  border: 1px solid rgba(0,0,0,.125);
  text-align: left;
  outline: none;
  font-size: 16px;
  font-weight: 700;
  transition: 0.3s;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion:after {
  content: '\002B'; 
  font-weight: bold;
  font-size: 20px;
}
.accordion.active:after {
  content: "\2212"; 
}

.panel-ranking {
  padding: 0 18px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background-color: white;
  border: 1px solid rgba(0,0,0,.125);
  border-top: none;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  margin-bottom: 20px;
}

.ranking-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.rank-select {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #ddd;
  font-size: 14px;
  font-weight: 600;
  background-color: white;
  cursor: pointer;
}

.tab-btn {
  padding: 6px 16px;
  cursor: pointer;
  border-radius: 20px;
  background: #f1f1f1;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #ddd;
}
.tab-btn.active {
  background-color: #0d6efd;
  color: white;
  border-color: #0d6efd;
}

/* Estil pel selector d'anys */
.year-select {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #ddd;
  font-size: 14px;
  font-weight: 600;
  background-color: white;
  cursor: pointer;
  display: none; /* Ocult per defecte si estem a Global */
}
.year-select.visible {
  display: inline-block;
}

.rank-table-wrapper {
  display: none;
  padding-bottom: 15px;
}
.rank-table-wrapper.active {
  display: block;
}

#sel_Year {
  display: none; /* Ocult per defecte en mode Global */
}
#sel_Year.visible {
  display: inline-block;
}

.timer-text {
    font-weight: 800;
    font-size: 1.2em;
    padding: 4px 12px;
    border-radius: 20px;
    background: #e9ecef;
    color: #333;
    transition: all 0.3s ease;
}

.timer-text.danger {
    background-color: #f8d7da;
    color: #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}