:root{color-scheme:light;--portal-blue:#174a8b;--portal-text:#172b45;--portal-border:#b9cbe3}*{box-sizing:border-box}body{margin:0;background:#f4f7fb;color:var(--portal-text);font:16px/1.5 system-ui,sans-serif}.portal-header{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:16px max(20px,calc((100% - 1120px)/2));background:#fff;border-bottom:1px solid var(--portal-border)}.portal-header img{display:block;width:180px;max-width:100%;height:auto}.portal-header form{margin:0}.portal-main{max-width:1160px;margin:0 auto;padding:24px 20px}.portal-main h1{color:#07366c;font-size:1.7rem;margin:0 0 8px}.portal-main h2{font-size:1.2rem;margin:0 0 16px}.portal-panel{padding:22px;background:#fff;border:1px solid var(--portal-border);border-radius:12px;margin:18px 0}.portal-login{max-width:520px;margin:24px auto}.portal-nav,.portal-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.portal-nav{margin:18px 0}.portal-nav a,.portal-button,button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:9px 14px;border:1px solid var(--portal-border);border-radius:8px;background:#f0f5ff;color:#124584;font:inherit;font-weight:600;text-decoration:none;cursor:pointer}.portal-primary{background:var(--portal-blue);color:#fff;border-color:var(--portal-blue)}label{display:flex;flex-direction:column;gap:7px;margin:0 0 16px}input,textarea,.portal-login select{width:100%;min-width:0;min-height:44px;padding:10px 12px;border:1px solid #8295ae;border-radius:8px;background:#fff;color:var(--portal-text);font:inherit}textarea{min-height:160px;resize:vertical}a{color:#124584}a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,.portal-login select:focus-visible,summary:focus-visible{outline:3px solid #0867c9;outline-offset:3px}.portal-error{border-left:4px solid #b42332;padding:12px;background:#fff0f0;color:#8c1624}.portal-muted,.portal-footer,time{color:#40556c}.portal-footer{text-align:center;padding:24px}.portal-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:16px}.portal-grid>.portal-panel{margin:0}.portal-item{padding:16px 0;border-top:1px solid #dce4ee}.portal-item:first-of-type{border-top:0}.portal-item h3{margin:0 0 8px;font-size:1.05rem;overflow-wrap:anywhere}.portal-text{white-space:pre-wrap;overflow-wrap:anywhere}.portal-messages{padding-left:22px}.portal-messages li{padding:12px 0}.portal-status{font-weight:600}.portal-meta{display:flex;gap:12px;flex-wrap:wrap}.portal-page-nav{display:flex;gap:12px;margin-top:20px}@media(max-width:600px){.portal-main{padding:18px 12px}.portal-panel{padding:16px}.portal-header{padding:12px}.portal-header img{width:145px}}@media(forced-colors:active){.portal-panel,button,.portal-button,.portal-nav a{border:1px solid CanvasText}}
.portal-home-link{flex:0 0 auto}
.portal-login select{cursor:pointer;font-weight:600}
.portal-login-action{width:100%;min-height:48px;font-weight:700}
.portal-login-help{margin-top:18px}
.portal-login-help>summary{list-style:none;max-width:100%;text-align:center}
.portal-login-help>summary::-webkit-details-marker{display:none}
.portal-login-help[open]>summary{background:#e2edff}
.portal-login-help>p{margin:12px 0 0}
@media(max-width:400px){.portal-header{gap:12px;flex-wrap:wrap}.portal-home-link{margin-left:auto;font-size:.875rem}}
/* Area Clienti: schede e assistenza */
.portal-panel{border-color:#d6e1ee;box-shadow:0 4px 18px rgba(23,43,69,.035)}
.portal-grid>.portal-panel{display:flex;flex-direction:column}
.portal-grid>.portal-panel>.portal-button{align-self:flex-start;margin-top:auto}
.portal-button.portal-primary{background:var(--portal-blue);color:#fff;border-color:var(--portal-blue)}
.portal-button:hover,.portal-nav a:hover{background:#e3edfc}
.portal-button.portal-primary:hover,button.portal-primary:hover{background:#103c73}
.portal-section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:20px 0 16px}
.portal-section-heading h2{margin:0}
.portal-page-heading{margin:0 0 8px;gap:8px 16px}
.portal-page-heading h1{margin:0}
.portal-page-heading p{min-width:0;margin:0 0 0 auto;text-align:right}
.portal-assistance-card{border-top:3px solid var(--portal-blue)}
.portal-ticket-count{margin:0 0 10px;font-weight:600}
.portal-ticket-count strong{display:inline-block;font-size:2rem;line-height:1.2;margin-right:5px;color:#07366c}
.portal-ticket-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:24px 0}
.portal-ticket-summary>div{display:flex;flex-direction:column;align-items:flex-start;padding:18px 20px;border:1px solid #d6e1ee;border-radius:12px;background:#fff}
.portal-ticket-summary strong{font-size:1.8rem;line-height:1.2;color:#07366c}
.portal-ticket-summary span{font-weight:650;margin-top:6px}
.portal-ticket-summary small{color:#40556c;margin-top:4px}
.portal-ticket-list>.portal-section-heading:first-child{margin-top:0}
.portal-ticket-card{display:flex;align-items:center;justify-content:space-between;gap:20px}
.portal-ticket-content{flex:1;min-width:0}
.portal-ticket-content h3{margin:4px 0 10px;font-size:1.05rem;line-height:1.4}
.portal-ticket-card>.portal-button{flex:0 0 auto}
.portal-ticket-id{font-size:.85rem;color:#40556c}
.portal-ticket-card .portal-meta{align-items:center;font-size:.875rem}
.portal-badge{display:inline-flex;align-items:center;border:1px solid transparent;border-radius:999px;padding:4px 10px;font-size:.82rem;font-weight:650;line-height:1.4}
.portal-badge--open{color:#164a8a;background:#e8f1ff;border-color:#b9d0f0}
.portal-badge--in_progress{color:#684000;background:#fff3d9;border-color:#e7cc92}
.portal-badge--waiting{color:#62318b;background:#f4eaff;border-color:#d7beed}
.portal-badge--closed{color:#245642;background:#e9f4ee;border-color:#b8d6c6}
.portal-ticket-detail>h2{font-size:1.4rem;line-height:1.35;overflow-wrap:anywhere}
.portal-ticket-detail>.portal-section-heading{margin-top:0}
.portal-ticket-request{padding:16px 18px;background:#f5f8fd;border:1px solid #dce5f0;border-radius:10px;margin:20px 0 24px}
.portal-ticket-request h3{font-size:.9rem;margin:0 0 8px}
.portal-ticket-request p{margin:0}
.portal-ticket-detail .portal-messages{list-style:none;padding:0;margin:16px 0 24px;display:flex;flex-direction:column;gap:14px}
.portal-ticket-detail .portal-messages li{padding:16px 18px;border:1px solid #d6e1ee;border-radius:12px;max-width:92%;min-width:0}
.portal-ticket-detail .portal-message-client{align-self:flex-end;background:#edf4ff}
.portal-ticket-detail .portal-message-staff{align-self:flex-start;background:#f8fafc}
.portal-ticket-detail .portal-messages p{margin:8px 0}
.portal-ticket-detail .portal-messages time{font-size:.8rem}
.portal-ticket-detail form{padding-top:20px;border-top:1px solid #dce5f0}
.portal-ticket-editor .portal-actions{justify-content:flex-end}
.portal-empty{color:#40556c;padding:12px 0;margin:0}
@media(max-width:600px){
 .portal-ticket-summary{gap:8px}
 .portal-ticket-summary>div{padding:12px 10px}
 .portal-ticket-summary strong{font-size:1.5rem}
 .portal-ticket-summary span,.portal-ticket-summary small{font-size:.8rem}
 .portal-ticket-card{flex-direction:column;align-items:flex-start;gap:14px}
 .portal-ticket-detail .portal-messages li{max-width:100%}
}
@media(forced-colors:active){.portal-badge,.portal-ticket-summary>div,.portal-ticket-request,.portal-ticket-detail .portal-messages li{border:1px solid CanvasText}}
/* Panoramica e visibilità password */
.portal-overview-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:20px}
.portal-overview-details>.portal-panel{margin:0;min-width:0}
.portal-overview-details .portal-section-heading{margin-top:0}
.portal-overview-details .portal-item p{margin:8px 0}
.portal-password-field{position:relative;margin:-8px 0 18px}
.portal-password-field>input{padding-right:54px}
.portal-password-toggle{position:absolute;right:3px;top:50%;transform:translateY(-50%);width:44px;height:40px;min-height:40px;padding:10px;border:0;background:transparent;color:#124584}
.portal-password-toggle:hover{background:#e3edfc}
.portal-password-toggle[hidden],.portal-password-toggle[aria-pressed="false"] .portal-eye-slash{display:none}
@media(max-width:760px){.portal-overview-details{grid-template-columns:minmax(0,1fr)}}

.portal-file-upload progress{width:100%;height:22px}
.portal-file-upload input[type="file"]{padding:10px}
.portal-file-notes{margin-top:14px}
.portal-file-notes summary{cursor:pointer;color:#124584;font-weight:600}
.portal-pending-upload{margin-top:16px;padding:16px;border:1px solid #d6e1ee;border-radius:10px}
.portal-panel [hidden]{display:none!important}

/* Posizione corrente riconoscibile anche senza distinzione dei colori. */
.portal-nav a[aria-current="page"]{background:var(--portal-blue);color:#fff;border:2px solid var(--portal-blue);font-weight:750}
.portal-nav a[aria-current="page"]:hover{background:#103c73}
@media(forced-colors:active){.portal-nav a[aria-current="page"]{border:2px solid Highlight;text-decoration:underline}}

.portal-header-actions{justify-content:flex-end;margin-left:auto}
.portal-company-dialog{
  position:fixed;
  inset:0;
  width:min(32rem,calc(100% - 2rem));
  max-height:calc(100% - 2rem);
  margin:auto;
  padding:clamp(1rem,4vw,1.75rem);
  overflow:auto;
  border:1px solid var(--portal-border);
  border-radius:16px;
  background:#fff;
  color:var(--portal-text);
  box-shadow:0 20px 60px rgba(23,43,69,.25);
}
.portal-company-dialog::backdrop{background:rgba(23,43,69,.55)}
.portal-company-dialog h2{margin:0;color:#07366c;font-size:1.35rem}
.portal-company-dialog p{margin:.35rem 0 1.25rem}
.portal-company-list{display:grid;gap:.65rem;margin:0;padding:0;list-style:none}
.portal-company-choice,.portal-company-current{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.25rem .75rem;
  width:100%;
  padding:.65rem .9rem;
  text-align:left;
  overflow-wrap:anywhere;
}
.portal-company-choice>span:first-child,.portal-company-current>strong{min-width:0}
.portal-company-choice:hover{background:#e3edfc}
.portal-company-current{
  flex-wrap:wrap;
  border:1px solid var(--portal-border);
  border-radius:8px;
  background:#fff;
}
.portal-company-current>span{font-size:.875rem;color:#40556c}
.portal-company-actions{display:flex;justify-content:flex-end;margin-top:1.25rem}
@media(forced-colors:active){
  .portal-company-dialog,.portal-company-current{border-color:CanvasText}
}
