/* Pagine di assistenza (modulo ticket, thread, area clienti).
   Fascia scura in cima, sfondo tinta verde-grigio, pannelli bianchi con bordo
   ben visibile e un riquadro scuro laterale con le informazioni utili. */

:root {
    --sp-ink: #13261b;
    --sp-bg: #dde6e0;
    --sp-line: #aebdb4;
    --sp-field: #6f8279;
    --sp-text: #151f19;
    --sp-soft: #3f4b44;
}

/* ------------------------------------------------------------ fascia titolo */
.support-band {
    background: var(--sp-ink);
    color: #fff;
    padding: 40px 0 36px;
    border-bottom: 5px solid var(--color-primary);
}

.support-band__inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

.support-band__back {
    display: inline-block;
    margin-bottom: 14px;
    color: #a6e6c3;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.support-band h1 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.005em;
}

.support-band__sub { margin: 10px 0 0; max-width: 62ch; font-size: 1.1rem; color: rgba(255, 255, 255, 0.84); }
.support-band .status-badge { margin-top: 14px; }
.support-band__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.support-band__actions form { margin: 0; }
.support-band .btn-outline { border-color: rgba(255, 255, 255, 0.7); color: #fff; }
.support-band .btn-outline:hover { background: #fff; color: var(--sp-ink); border-color: #fff; }

/* ------------------------------------------------------------ impaginazione */
.support-page { background: var(--sp-bg); padding: 36px 0 76px; }

.support-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

.support-layout--single { grid-template-columns: minmax(0, 560px); justify-content: center; }

.panel {
    background: #fff;
    border: 1px solid var(--sp-line);
    border-radius: 10px;
    padding: 32px;
    margin-bottom: 22px;
    box-shadow: 0 2px 0 rgba(19, 38, 27, 0.08);
    color: var(--sp-text);
}

.panel > :last-child { margin-bottom: 0; }
.panel h2:not(.form-section__title) { margin: 0 0 6px; font-size: 1.35rem; line-height: 1.2; font-weight: 800; }
.panel__lead { margin: 0 0 22px; color: var(--sp-soft); }

/* ------------------------------------------------------------ modulo */
.form-section__title {
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #cdd9d2;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--sp-ink);
}

.form-section + .form-section { margin-top: 30px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field--full { grid-column: 1 / -1; }

.field label { display: block; margin-bottom: 7px; font-size: 0.97rem; font-weight: 700; color: var(--sp-text); }
.field .optional { font-weight: 500; color: var(--sp-soft); }
.field .hint { margin: 6px 0 0; font-size: 0.9rem; color: var(--sp-soft); }

.support-page input[type=text],
.support-page input[type=email],
.support-page input[type=password],
.support-page textarea,
.support-page select {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--sp-field);
    border-radius: 8px;
    background: #f7faf8;
    font-size: 1.02rem;
    color: var(--sp-text);
}

.support-page textarea { min-height: 170px; line-height: 1.5; }

.support-page input:focus,
.support-page textarea:focus,
.support-page select:focus {
    outline: none;
    background: #fff;
    border-color: var(--color-primary-dark);
    box-shadow: 0 0 0 4px rgba(0, 128, 57, 0.22);
}

.field--file {
    padding: 16px;
    border: 2px dashed var(--sp-field);
    border-radius: 8px;
    background: #eef3f0;
}

.field--file input[type=file] { width: 100%; font-size: 0.97rem; color: var(--sp-text); }

.field--file input[type=file]::file-selector-button {
    margin-right: 14px;
    padding: 9px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--sp-ink);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.form-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 28px; padding-top: 24px; border-top: 2px solid #cdd9d2; }
.form-actions p { margin: 0; flex: 1; min-width: 220px; font-size: 0.93rem; color: var(--sp-soft); }

/* ------------------------------------------------------------ riquadro laterale */
.aside-panel {
    padding: 28px;
    border-radius: 10px;
    background: var(--sp-ink);
    color: #fff;
}

.aside-panel h2 { margin: 0 0 14px; font-size: 1.15rem; font-weight: 800; }
.aside-panel h2:not(:first-child) { margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.22); }
.aside-panel p { margin: 0 0 10px; color: rgba(255, 255, 255, 0.86); }
.aside-panel a { color: #a6e6c3; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.aside-panel .aside-phone a { font-size: 1.6rem; font-weight: 800; color: #fff; text-decoration: none; }

.aside-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.aside-steps li { position: relative; padding-left: 38px; color: rgba(255, 255, 255, 0.9); counter-increment: s; }
.aside-steps li::before {
    content: counter(s);
    position: absolute;
    left: 0;
    top: -1px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
}

.facts { margin: 0; display: grid; gap: 16px; }
.facts dt { font-size: 0.86rem; color: rgba(255, 255, 255, 0.68); }
.facts dd { margin: 3px 0 0; font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ conversazione */
.msg {
    margin-bottom: 16px;
    padding: 18px 22px;
    border: 1px solid var(--sp-line);
    border-left: 6px solid #5f7168;
    border-radius: 8px;
    background: #fff;
    color: var(--sp-text);
}

.msg--staff { background: #d9eee1; border-color: #8cc2a3; border-left-color: var(--color-primary-dark); }

.msg__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: 0.92rem; color: var(--sp-soft); }
.msg__author { font-size: 1.02rem; font-weight: 800; color: var(--sp-text); }

.msg__role {
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #e8eeeb;
    border: 1px solid var(--sp-line);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--sp-soft);
}

.msg--staff .msg__role { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }
.msg__body { font-size: 1.04rem; line-height: 1.6; color: #0e1511; }
.msg__attachment { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(19, 38, 27, 0.18); font-size: 0.95rem; }
.msg__attachment a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.reply-note { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: #fff3d1; border: 1px solid #e6c866; color: #5c4300; font-weight: 600; }

/* ------------------------------------------------------------ elenco ticket cliente */
.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
    padding: 18px 22px;
    border: 1px solid var(--sp-line);
    border-left: 6px solid var(--color-primary);
    border-radius: 8px;
    background: #fff;
    color: var(--sp-text);
}

.ticket-row:hover { background: #f1f7f3; border-color: var(--sp-ink); border-left-color: var(--sp-ink); }
.ticket-row--chiuso { border-left-color: #7c8a83; }
.ticket-row__title { display: block; font-size: 1.12rem; font-weight: 800; }
.ticket-row__meta { display: block; margin-top: 4px; font-size: 0.93rem; color: var(--sp-soft); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 960px) {
    .support-layout { grid-template-columns: minmax(0, 1fr); }
    .support-layout--single { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .support-band { padding: 30px 0 28px; }
    .support-page { padding: 24px 0 52px; }
    .panel { padding: 22px 18px; }
    .aside-panel { padding: 22px 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-actions .btn { width: 100%; }
    .ticket-row { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 18px; }
    .support-band__actions .btn, .support-band__actions form { width: 100%; }
    .support-band__actions form .btn { width: 100%; }
}
