:root{
  --ccoored:#E30613;
  --bg:#f5f5f5;
  --card:#fff;
  --muted:#666;
  --text:#111;
}

*{box-sizing:border-box}

body{
  background:var(--bg);
  margin:0;
  padding:0;
  font-family:Arial,Helvetica,sans-serif;
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* ================= Header ================= */
header{
  background:#fff;
  color:var(--text);
  padding:10px 18px;
  font-size:1rem;
  font-weight:bold;
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  position:sticky;
  top:0;
  z-index:20;
  border-bottom:4px solid var(--ccoored);
  box-shadow:0 3px 14px rgba(0,0,0,.08);
}

header img{
  height:54px;
  width:auto;
  border-radius:6px;
}

.brand{display:flex;align-items:center;gap:14px;text-decoration:none;color:inherit}
.brand span{display:block}
.title{font-size:18px;font-weight:900}
.subtitle{font-size:13px;color:var(--muted);font-weight:400;opacity:1}
.switch-personal{display:inline-flex;align-items:center;justify-content:center;border:2px solid var(--ccoored);border-radius:999px;color:var(--ccoored);background:#fff;text-decoration:none;font-weight:900;padding:10px 14px;white-space:nowrap}
.switch-personal:hover{background:var(--ccoored);color:#fff}

/* ================= Layout ================= */
.wrap{
  max-width:920px;
  margin:12px auto;
  padding:12px;
  width:calc(100% - 24px);
}

.card{
  background:var(--card);
  padding:12px;
  border-radius:10px;
  box-shadow:0 4px 12px rgba(0,0,0,0.08);
  margin-bottom:12px;
}

.form-title{font-weight:800;margin-bottom:8px}
.section-h{margin-top:12px;margin-bottom:6px}

label{
  font-weight:700;
  margin-top:10px;
  display:block;
  font-size:.95rem;
}

label.req{color:var(--ccoored)}

select,input{
  width:100%;
  padding:10px 12px;
  border:1px solid #d0d0d0;
  border-radius:8px;
  margin-top:6px;
  font-size:0.95rem;
  background:#fff;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

.row{display:flex;gap:10px}
.col{flex:1;min-width:0}

/* ================= Botones ================= */
button{
  width:100%;
  padding:12px 14px;
  background:var(--ccoored);
  color:#fff;
  border:none;
  border-radius:8px;
  font-size:1.05rem;
  font-weight:700;
  cursor:pointer;
  margin-top:10px;
}

.btn-secondary{background:#666}

.center-actions{
  display:flex;
  justify-content:center;
  gap:10px;
  margin-top:6px;
  flex-wrap:wrap;
}

.center-actions button{
  width:260px;
  max-width:100%;
  margin-top:0;
}

/* ================= Resultados ================= */
.result{
  font-size:0.95rem;
  margin-top:6px;
  line-height:1.38;
  position:relative;
  overflow:hidden;
}

.value{
  font-size:1.25rem;
  font-weight:800;
  color:#064b00;
}

.concept{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:6px 0;
  border-bottom:1px dashed #eee;
}

.concept:last-child{border-bottom:none}

.small{font-size:.85rem;color:var(--muted)}

/* ================= Marca d'aigua CCOO (PANTALLA) — V4.06.03 ================= */
.result::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:520px;
  height:220px;
  transform:translate(-50%, -50%) rotate(-25deg);
  background-image:url("../../assets/img/logo-ccoo.jpg");
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  opacity:0.25;
  pointer-events:none;
  z-index:0;
}

.result > *{
  position:relative;
  z-index:1;
}

/* ================= Responsive ================= */
@media (max-width:640px){
  header{padding:10px}
  .row{flex-direction:column}
  label{font-size:.92rem}
  button{font-size:1rem}
  .value{font-size:1.05rem}
  .center-actions{gap:8px}

  .result::after{
    width:380px;
    height:160px;
    opacity:0.22;
  }
}

@media (max-width:640px){header{align-items:flex-start}.switch-personal{width:100%;margin-top:8px}header img{height:46px}.title{font-size:16px}}
@media print{.switch-personal{display:none!important}}


/* Capçalera comuna segons referència */
.site-header{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  background:#fff;
  padding:11px 12px 6px 12px;
  border-bottom:none;
  box-shadow:none;
}
.brand-block,.brand{
  display:flex;
  align-items:center;
  gap:14px;
  text-decoration:none;
  color:inherit;
}
.site-header img{
  width:222px;
  height:54px;
  object-fit:contain;
  border-radius:14px;
  display:block;
}
.brand-text{display:block;line-height:1.08}
.title{font-weight:900;font-size:21px;color:#111;letter-spacing:.1px}
.subtitle{display:block;font-size:14px;color:#666;font-weight:400;margin-top:3px}
.switch-personal{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid #e30613;
  border-radius:999px;
  color:#e30613;
  background:#fff;
  text-decoration:none;
  font-weight:900;
  padding:10px 14px;
  white-space:nowrap;
}
.switch-personal:hover{background:#e30613;color:#fff}
@media (max-width:640px){
  .site-header{align-items:flex-start;padding:10px 12px 8px 12px}
  .brand-block,.brand{gap:10px}
  .site-header img{width:170px;height:auto}
  .title{font-size:18px}
  .subtitle{font-size:13px}
  .switch-personal{width:100%;margin-top:6px}
}
@media print{.site-header,.switch-personal{display:none!important}}

header.site-header{font-size:1rem;font-weight:normal}


/* ===== Header i footer ajustats segons referència ===== */
.site-header{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
  background:#fff;
  padding:18px 16px 12px 16px;
  border-bottom:1px solid #ececec;
  box-shadow:0 3px 14px rgba(0,0,0,.06);
}
.site-header .brand-block{display:block}
.site-header .brand{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:14px;
  text-decoration:none;
  color:inherit;
}
.site-header img{
  width:220px;
  height:auto;
  object-fit:contain;
  border-radius:0;
  display:block;
}
.brand-text{display:block;line-height:1.08}
.title{
  display:block;
  font-weight:900;
  font-size:32px;
  color:#111;
  letter-spacing:-0.02em;
}
.brand-version{
  display:block;
  margin-top:6px;
  font-size:22px;
  font-weight:900;
  color:#111;
}
.subtitle{display:none!important}
.switch-personal{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid #e30613;
  border-radius:999px;
  color:#e30613;
  background:#fff;
  text-decoration:none;
  font-weight:900;
  padding:10px 14px;
  white-space:nowrap;
  margin-top:8px;
}
.switch-personal:hover{background:#e30613;color:#fff}
.site-footer{
  margin-top:28px;
  padding:18px 16px 26px;
  text-align:center;
  font-size:16px;
  font-weight:800;
  color:#111;
}
@media (max-width:640px){
  .site-header{padding:14px 12px 10px}
  .site-header img{width:170px}
  .title{font-size:22px}
  .brand-version{font-size:18px}
  .switch-personal{width:100%;margin-top:0}
  .site-footer{font-size:15px;padding:16px 12px 22px}
}
@media print{.site-header,.switch-personal,.site-footer{display:none!important}}


/* ===== v4.03.00 capçalera bilingüe ===== */
.site-header{
  position:sticky;
  top:0;
  z-index:40;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  flex-wrap:nowrap;
  background:#fff;
  padding:18px 20px 14px;
  border-bottom:4px solid #cc1d12;
  box-shadow:0 4px 12px rgba(0,0,0,.06);
}
.site-header .brand-wrap,
.site-header .brand{
  display:flex;
  align-items:center;
  gap:18px;
  text-decoration:none;
  color:inherit;
  min-width:0;
}
.site-header .brand-wrap{flex:1 1 auto}
.site-header img{
  width:180px;
  max-width:38vw;
  height:auto;
  object-fit:contain;
  border-radius:0;
  flex:0 0 auto;
}
.brand-text{
  display:block;
  min-width:0;
}
.title,
.brand-title{
  display:block;
  font-size:28px;
  line-height:1.05;
  font-weight:900;
  color:#111;
  letter-spacing:-0.02em;
  margin:0;
}
.brand-version{
  display:block;
  margin-top:6px;
  font-size:20px;
  line-height:1.1;
  font-weight:800;
  color:#444;
}
.lang-switcher{
  display:flex;
  gap:10px;
  flex:0 0 auto;
}
.lang-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:78px;
  min-height:78px;
  border-radius:22px;
  border:2px solid #d8d8d8;
  background:#fff;
  color:#111;
  text-decoration:none;
  font-weight:900;
  font-size:20px;
  box-shadow:0 1px 0 rgba(0,0,0,.04) inset;
}
.lang-btn.is-active{
  background:#cc1d12;
  color:#fff;
  border-color:#cc1d12;
}
.subnav{
  max-width:980px;
  margin:16px auto 0;
  padding:0 14px;
}
.subnav .switch-personal{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid #e30613;
  border-radius:999px;
  color:#e30613;
  background:#fff;
  text-decoration:none;
  font-weight:900;
  padding:10px 16px;
  white-space:nowrap;
  margin:0;
}
.subnav .switch-personal:hover{background:#e30613;color:#fff}
.site-footer{
  margin-top:28px;
  padding:18px 16px 26px;
  text-align:center;
  font-size:16px;
  font-weight:800;
  color:#111;
}
@media (max-width:760px){
  .site-header{align-items:flex-start;gap:14px;flex-wrap:wrap;padding:14px 12px 12px}
  .site-header .brand-wrap,.site-header .brand{gap:12px}
  .site-header img{width:150px;max-width:44vw}
  .title,.brand-title{font-size:21px}
  .brand-version{font-size:17px}
  .lang-switcher{margin-left:auto}
  .lang-btn{min-width:66px;min-height:66px;border-radius:18px;font-size:18px}
}
@media (max-width:560px){
  .site-header .brand-wrap{width:100%}
  .lang-switcher{width:100%;justify-content:flex-end}
  .title,.brand-title{font-size:18px}
  .brand-version{font-size:15px}
  .lang-btn{min-width:58px;min-height:58px;border-radius:16px;font-size:17px}
}
@media print{.site-header,.lang-switcher,.subnav,.site-footer{display:none!important}}


/* Easter egg: cinc clics sobre el peu */
.site-footer{
  user-select:none;
  -webkit-user-select:none;
}


/* ===== v4.03.04 alineació horitzontal de marca ===== */
.site-header .brand-wrap,
.site-header .brand{
  flex-direction:row !important;
  align-items:center !important;
}
.site-header .brand-text{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
}
.site-header .brand-title,
.site-header .brand-version{
  width:auto;
  text-align:left;
}
@media (max-width:760px){
  .site-header .brand-wrap,
  .site-header .brand{
    flex-direction:row !important;
    align-items:center !important;
  }
}


/* ===== V4.05.04 — botons coherents amb CAT/ES i Calcular nòmina ===== */
button:not(.mobile-stepper-btn):not(.mobile-carousel-arrow):not(.pwa-install-close){
  min-height:58px;
  border:2px solid #CC0000;
  border-radius:18px;
  font-weight:900;
  box-shadow:none;
}
#calc{
  background:#CC0000;
  color:#fff;
  border-color:#CC0000;
}
#calc:hover,#calc:focus-visible{
  filter:brightness(.94);
  outline:none;
  box-shadow:0 0 0 4px rgba(204,0,0,.16);
}
.btn-secondary{
  background:#fff;
  color:#CC0000;
  border-color:#CC0000;
}
.btn-secondary:hover,.btn-secondary:focus-visible{
  background:#CC0000;
  color:#fff;
  outline:none;
  filter:none;
}
.subnav .switch-personal{
  width:100%;
  min-height:58px;
  border:2px solid #CC0000;
  border-radius:18px;
  color:#CC0000;
  font-size:1.05rem;
  padding:12px 18px;
}
.subnav .switch-personal:hover,
.subnav .switch-personal:focus-visible{
  background:#CC0000;
  color:#fff;
  outline:none;
}
@media (max-width:720px){
  .center-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }
  .center-actions button{
    width:100%;
    max-width:none;
    margin:0;
  }
}
