/* =====================================================================
 * EasySW – pagine del portale: Dashboard e Account (rev. 09/10/2026)
 * Usa le variabili di esw-shell.css (--esw-*)
 * ===================================================================== */
.esw-page {
    font-family: var(--esw-font);
    color: var(--esw-ink);
    font-size: 14px;
    padding-top: 22px;
    padding-bottom: 40px;
}
/* il contenuto resta allineato a sinistra, accanto al menu: su schermi molto
   larghi si limita la larghezza delle righe invece di spostare la pagina */
.esw-page > * { max-width: 1500px; }
.esw-page h1, .esw-page h2, .esw-page h3 { font-family: var(--esw-font); color: var(--esw-ink); }
.esw-muted { color: var(--esw-muted); }

.esw-card {
    background: var(--esw-surface);
    border: 1px solid var(--esw-line);
    border-radius: 14px;
    padding: 18px 20px;
}
.esw-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.esw-card-head h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.esw-card-head p { margin: 2px 0 0; color: var(--esw-muted); font-size: 13px; }
.esw-card-ico {
    flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--esw-rail); color: var(--esw-muted); font-size: 14px;
}

/* ---------------------------------------------------------- DASHBOARD */
.dash-hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dash-hello h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.dash-hello p { margin: 6px 0 0; color: var(--esw-muted); font-size: 14px; }
.dash-hello p:first-letter { text-transform: uppercase; }

.dash-search { position: relative; flex: 1 1 320px; max-width: 460px; }
.dash-search > i, .dash-search > .svg-inline--fa {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--esw-muted); pointer-events: none;
}
.dash-search input {
    width: 100%; height: 46px; padding: 0 14px 0 42px;
    border: 1px solid var(--esw-line); border-radius: 12px;
    background: var(--esw-surface); color: var(--esw-ink);
    font: 15px var(--esw-font);
    box-shadow: 0 1px 2px rgba(16, 24, 20, .05);
}
.dash-search input:focus { outline: none; border-color: var(--esw-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--esw-accent) 22%, transparent); }

.dash-alert {
    display: flex; align-items: center; gap: 12px; width: 100%;
    margin-bottom: 18px; padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--esw-accent) 55%, transparent); border-radius: 12px;
    background: color-mix(in srgb, var(--esw-accent) 12%, transparent); color: var(--esw-ink);
    font: 600 14px var(--esw-font); text-align: left;
}
.dash-alert.hide { display: none; }
.dash-alert .dash-alert-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--esw-accent); color: var(--esw-on-accent); flex: none;
}
.dash-alert .dash-alert-go { margin-left: auto; color: var(--esw-accent-ink); white-space: nowrap; }

.dash-section { margin-bottom: 26px; }
.dash-section-head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; }
.dash-section-head h2 { margin: 0; font-size: 15px; font-weight: 800; }
.dash-section-head span { color: var(--esw-muted); font-size: 12px; }
.dash-section.hide, .dash-section.esw-filtered { display: none; }

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
}
.dash-tile {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    min-height: 64px; padding: 12px 14px;
    border: 1px solid var(--esw-line); border-radius: 12px;
    background: var(--esw-surface); color: var(--esw-ink);
    font-weight: 600; font-size: 14px; line-height: 1.25;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.dash-tile:hover, .dash-tile:focus-visible {
    color: var(--esw-ink);
    border-color: var(--esw-accent);
    box-shadow: 0 6px 18px -12px rgba(16, 24, 20, .45);
}
.dash-tile:focus-visible { outline: 2px solid var(--esw-accent); outline-offset: 2px; }
.dash-tile-ico {
    flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 11px;
    background: var(--esw-rail); color: var(--esw-accent-ink); font-size: 17px;
}
.dash-tile.esw-filtered { display: none; }

/* "Usati di recente": riga più evidente */
.dash-recent .dash-tile { background: var(--esw-brand); border-color: transparent; color: var(--esw-on-brand); }
.dash-recent .dash-tile:hover { color: var(--esw-on-brand); border-color: var(--esw-accent); }
.dash-recent .dash-tile-ico { background: var(--esw-on-brand-soft); color: var(--esw-on-brand); }

.dash-empty { padding: 40px 16px; text-align: center; color: var(--esw-muted); }
.dash-empty.hide { display: none; }
.dash-loading .dash-tile { pointer-events: none; }
.dash-skel {
    height: 64px; border-radius: 12px;
    background: linear-gradient(90deg, var(--esw-rail) 0%, #ebefea 50%, var(--esw-rail) 100%);
    background-size: 200% 100%;
    animation: dash-skel 1.2s linear infinite;
}
@keyframes dash-skel { to { background-position: -200% 0; } }

@media (max-width: 575.98px) {
    .esw-page { padding-top: 16px; }
    .dash-search { max-width: none; flex-basis: 100%; }
    .dash-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .dash-tile { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 96px; padding: 12px; font-size: 13.5px; }
}

/* ------------------------------------------------------------ ACCOUNT */
.acc-hero {
    display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
    padding: 22px; margin-bottom: 14px;
    border-radius: 16px;
    background: var(--esw-brand); color: var(--esw-on-brand);
}
.acc-hero h1 { margin: 0; color: inherit; font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; letter-spacing: -.02em; }
.acc-hero p { margin: 3px 0 0; opacity: .8; font-size: 14px; word-break: break-word; }
.acc-id { flex: 1 1 220px; min-width: 0; }
.acc-photo { position: relative; flex: none; width: 92px; height: 92px; }
.acc-photo img, .acc-photo .acc-initials {
    width: 92px; height: 92px; border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 4px var(--esw-on-brand-soft);
}
.acc-photo .acc-initials {
    display: flex; align-items: center; justify-content: center;
    background: var(--esw-accent); color: var(--esw-on-accent);
    font: 800 30px var(--esw-font);
}
.acc-photo-btn {
    position: absolute; right: -2px; bottom: -2px;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--esw-surface); color: var(--esw-ink);
    border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    cursor: pointer;
}
.acc-photo-btn:hover { background: var(--esw-rail); }
.acc-photo.is-loading::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: rgba(0, 0, 0, .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='18' fill='none' stroke='white' stroke-width='5' stroke-dasharray='80 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.9s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / 40px no-repeat;
}
.acc-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-hero-actions .btn {
    display: inline-flex; align-items: center; gap: 8px;
    border-radius: 10px; font: 600 13px var(--esw-font);
    background: var(--esw-on-brand-soft); color: var(--esw-on-brand); border: 0;
    padding: 8px 14px;
}
.acc-hero-actions .btn:hover { background: var(--esw-surface); color: var(--esw-ink); }
.acc-hero-actions .btn.hide { display: none; }

.acc-tabs {
    position: sticky; top: var(--esw-header-h); z-index: 5;
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    margin: 0 -4px 14px; padding: 8px 4px;
    background: var(--bs-body-bg, #fff);
}
.acc-tabs::-webkit-scrollbar { display: none; }
.acc-tabs a {
    flex: none; padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--esw-line); background: var(--esw-surface);
    color: var(--esw-ink); font-weight: 600; font-size: 13px; text-decoration: none;
}
.acc-tabs a:hover, .acc-tabs a.active { border-color: var(--esw-accent); background: color-mix(in srgb, var(--esw-accent) 14%, transparent); }
.acc-tabs a.hide { display: none; }

.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.acc-grid > .esw-card { scroll-margin-top: calc(var(--esw-header-h) + 64px); }
.acc-grid .acc-wide { grid-column: 1 / -1; }
@media (max-width: 991.98px) { .acc-grid { grid-template-columns: 1fr; } }

.acc-dl { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 0; margin: 0; }
.acc-dl dt, .acc-dl dd { padding: 9px 0; border-bottom: 1px solid var(--esw-line); margin: 0; }
.acc-dl dt { color: var(--esw-muted); font-weight: 500; font-size: 13px; }
.acc-dl dd { font-weight: 600; word-break: break-word; }
.acc-dl dd:empty::before { content: "—"; color: var(--esw-muted); font-weight: 400; }
.acc-dl > :nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 420px) {
    .acc-dl { grid-template-columns: 1fr; }
    .acc-dl dt { padding-bottom: 0; border-bottom: 0; }
    .acc-dl dd { padding-top: 2px; }
}

.acc-field { margin-bottom: 14px; }
.acc-field label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; }
.acc-field .form-control {
    height: 44px; border-radius: 10px; font: 15px var(--esw-font);
    border-color: var(--esw-line);
}
.acc-field .form-control:focus { border-color: var(--esw-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--esw-accent) 22%, transparent); }
.acc-field .acc-hint { margin-top: 4px; color: var(--esw-muted); font-size: 12px; }
.acc-field .invalid-feedback { font-size: 12.5px; }
.acc-subhead { margin: 16px 0 10px; font-size: 13px; font-weight: 700; color: var(--esw-muted); }

.acc-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.acc-actions .btn {
    height: 42px; padding: 0 18px; border-radius: 10px;
    font: 700 14px var(--esw-font);
}
.acc-status { font-size: 13px; font-weight: 600; }
.acc-status.ok { color: #2f7a16; }
.acc-status.err { color: #b42318; }

.acc-pw-wrap { position: relative; }
.acc-pw-wrap .form-control { padding-right: 46px; }
.acc-pw-eye {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 36px; border: 0; border-radius: 8px;
    background: none; color: var(--esw-muted);
}
.acc-pw-eye:hover { background: var(--esw-rail); color: var(--esw-ink); }
.acc-rules { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--esw-muted); }
.acc-rules li { display: flex; align-items: center; gap: 8px; }
.acc-rules li::before {
    content: ""; width: 16px; height: 16px; border-radius: 50%; flex: none;
    border: 2px solid var(--esw-line);
}
.acc-rules li.ok { color: var(--esw-ink); }
.acc-rules li.ok::before {
    border-color: var(--esw-accent);
    background: var(--esw-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%231d2a07' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
html.esw-accent-dark .acc-rules li.ok::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.acc-meter { height: 6px; border-radius: 6px; background: var(--esw-rail); overflow: hidden; margin: -6px 0 6px; }
.acc-meter span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .2s ease, background-color .2s ease; }

/* veicolo */
.acc-plate {
    display: inline-flex; align-items: stretch; overflow: hidden;
    border: 2px solid #1c2421; border-radius: 6px; background: #fff;
    font: 800 20px/1 var(--esw-font); letter-spacing: .08em; color: #1c2421;
}
.acc-plate::before { content: "I"; display: flex; align-items: flex-end; padding: 4px 5px; background: #1f4fbf; color: #fff; font-size: 11px; }
.acc-plate span { padding: 7px 12px 6px; }
.acc-car { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 14px; }
.acc-car b { display: block; font-size: 15px; }
.acc-car small { color: var(--esw-muted); }
.acc-due { list-style: none; margin: 0; padding: 0; }
.acc-due li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--esw-line); }
.acc-due li > span:first-child { color: var(--esw-muted); font-size: 13px; }
.acc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; text-align: right; }
.acc-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.acc-chip.ok { background: #e8f5e1; color: #2f7a16; }
.acc-chip.warn { background: #fef0c7; color: #93370d; }
.acc-chip.bad { background: #fee4e2; color: #b42318; }
.acc-chip.na { background: var(--esw-rail); color: var(--esw-muted); }

#acc-push.esw-push { padding: 12px; border-radius: 12px; background: var(--esw-rail); }

/* l'icona di errore di Bootstrap non deve coprire il pulsante "mostra password" */
.acc-pw-wrap .form-control.is-invalid,
.acc-pw-wrap .form-control.is-valid { background-image: none; padding-right: 46px; }
@media (max-width: 575.98px) {
    .dash-tile { min-height: 84px; }
    .acc-hero { padding: 18px; }
}
.dash-tile > span:last-child { min-width: 0; overflow-wrap: anywhere; }

/* foto profilo: foto e iniziali sovrapposte, se c'è la foto le iniziali spariscono */
.acc-photo img, .acc-photo .acc-initials { position: absolute; inset: 0; }
.acc-photo img.hide, .acc-photo .acc-initials.hide { display: none !important; }
#img-exist { opacity: 0; transition: opacity .25s ease; }
#img-exist.is-in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #img-exist { transition: none; } }

/* ------------------------------------------------ PRIMO ACCESSO (changePassword.php) */
body.esw-auth-body { min-height: 100vh; background: var(--esw-brand); }
.esw-auth {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px 16px; font-family: var(--esw-font); color: var(--esw-ink); font-size: 14px;
}
.esw-auth-card {
    width: 100%; max-width: 420px; padding: 28px 26px 22px;
    background: var(--esw-surface); border-radius: 18px;
    box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .6);
}
.esw-auth-logo { text-align: center; margin-bottom: 18px; }
.esw-auth-logo img { max-height: 56px; max-width: 70%; }
.esw-auth h1 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.esw-auth > .esw-auth-card > p { margin-bottom: 18px; }
.esw-auth-alert {
    display: flex; gap: 8px; align-items: flex-start;
    margin-bottom: 16px; padding: 10px 12px; border-radius: 10px;
    background: #fee4e2; color: #912018; font-weight: 600;
}
.esw-auth .form-control[readonly] { background: var(--esw-rail); color: var(--esw-muted); }
.esw-auth-btn { height: 46px; border-radius: 10px; font: 700 15px var(--esw-font); }
.esw-auth-foot { margin: 14px 0 0; text-align: center; font-size: 13px; }
.esw-auth-foot a { color: var(--esw-muted); }
.acc-field .form-control.is-invalid { border-color: #e5484d; }
.acc-field .form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(229, 72, 77, .18); }
.esw-auth-icon {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; margin: 0 0 14px; border-radius: 16px;
    background: color-mix(in srgb, var(--esw-accent) 22%, transparent); color: var(--esw-accent-ink); font-size: 24px;
}
.esw-auth-icon.warn { background: #fef0c7; color: #93370d; }
.esw-auth .hide { display: none !important; }
.esw-auth a.esw-auth-btn { display: flex; align-items: center; justify-content: center; }
