/* ============================================================
   Spoilery — assets/css/pages/support.css
   Cartella: /assets/css/pages/
   Centro assistenza: modulo con tipi a riquadri, screenshot, captcha,
   "Le tue richieste" e conversazione in stile chat.
   ============================================================ */
.st-support { max-width: 720px; padding-top: 1.2rem; padding-bottom: 2.5rem; }

/* ---------- Intestazione ---------- */
.st-support-head { text-align: center; margin: .5rem 0 1.4rem; }
.st-support-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 58px; height: 58px; margin-bottom: .7rem;
    border-radius: 18px; background: rgba(218, 9, 21, .14); color: var(--st-accent-hi); font-size: 1.8rem;
}
.st-support-head h1 { font-size: 1.8rem; margin-bottom: .4rem; }
.st-support-head p { max-width: 520px; margin: 0 auto; color: var(--st-muted); }

.st-support-card {
    margin-bottom: 1rem; padding: 1.15rem;
    background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-radius-lg);
}
.st-support-h2 { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: 1.1rem; }
.st-support-h2 .bi { color: var(--st-accent-hi); }
.st-support .form-control { background-color: var(--st-ink); }
.st-support-alert { display: flex; gap: .5rem; align-items: center; border-radius: var(--st-radius-sm); font-size: .9rem; }
.st-opt { color: var(--st-muted); font-weight: 400; font-size: .85em; }
.st-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Tipi di richiesta ---------- */
.st-support-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1.2rem; border: 0; padding: 0; }
.st-support-cats legend { grid-column: 1 / -1; margin-bottom: .2rem; }
@media (min-width: 640px) { .st-support-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.st-cat { position: relative; cursor: pointer; }
.st-cat input { position: absolute; opacity: 0; pointer-events: none; }
.st-cat-box {
    display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; height: 100%;
    padding: .8rem .85rem; border: 1px solid var(--st-line); border-radius: var(--st-radius);
    background: var(--st-ink); transition: border-color .15s, background .15s;
}
.st-cat-box .bi { font-size: 1.35rem; color: var(--st-accent-hi); margin-bottom: .2rem; }
.st-cat-box strong { font-size: .92rem; line-height: 1.2; }
.st-cat-box small { color: var(--st-muted); font-size: .76rem; line-height: 1.25; }
.st-cat:hover .st-cat-box { border-color: #4a4a50; }
.st-cat input:checked + .st-cat-box { border-color: var(--st-accent); background: rgba(218, 9, 21, .1); box-shadow: 0 0 0 1px var(--st-accent) inset; }
.st-cat input:focus-visible + .st-cat-box { outline: 2px solid var(--st-accent-hi); outline-offset: 2px; }

/* Con JavaScript: i campi compaiono dopo aver scelto il tipo */
.st-support-form.is-js:not(.has-cat) [data-st-fields] { display: none; }
.st-support-count { text-align: right; }

/* ---------- Screenshot ---------- */
.st-shots-add {
    display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem;
    padding: .75rem .9rem; border: 1px dashed var(--st-line); border-radius: var(--st-radius);
    cursor: pointer; color: var(--st-text);
}
.st-shots-add:hover { border-color: var(--st-accent); }
.st-shots-add .bi { font-size: 1.2rem; color: var(--st-accent-hi); }
.st-shots-add span { font-weight: 600; font-size: .92rem; }
.st-shots-add small { flex-basis: 100%; color: var(--st-muted); font-size: .78rem; }
.st-shots-add.is-full { display: none; }
.st-shots-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.st-shots-list:empty { display: none; }
.st-shot { position: relative; width: 84px; height: 84px; border-radius: var(--st-radius-sm); overflow: hidden; background: var(--st-raised); }
.st-shot img { width: 100%; height: 100%; object-fit: cover; }
.st-shot button {
    position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0;
    border: 0; border-radius: 50%; background: rgba(0, 0, 0, .75); color: #fff; font-size: .8rem;
}

/* ---------- Informazioni tecniche ---------- */
.st-support-check { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 1.2rem; cursor: pointer; }
.st-support-check .form-check-input { flex-shrink: 0; margin-top: .2rem; }
.st-support-check span { display: flex; flex-direction: column; }
.st-support-check strong { font-size: .92rem; font-weight: 600; }
.st-support-check small { color: var(--st-muted); font-size: .8rem; }

/* ---------- Captcha ---------- */
.st-captcha { margin-bottom: 1.2rem; }
.st-captcha-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.st-captcha-row img { width: 220px; max-width: calc(100% - 56px); height: auto; border-radius: var(--st-radius-sm); border: 1px solid var(--st-line); background: #141416; }
.st-captcha-new { width: 46px; height: 46px; flex-shrink: 0; padding: 0; border-radius: 50%; font-size: 1.15rem; }
.st-captcha-input { max-width: 220px; text-transform: uppercase; letter-spacing: .25em; font-weight: 700; }
.st-support-legal { margin: .8rem 0 0; color: var(--st-muted); font-size: .78rem; text-align: center; }
.st-support-legal a { color: var(--st-muted); }

/* ---------- Email ---------- */
.st-support-mail { margin-top: 1.4rem; text-align: center; color: var(--st-muted); font-size: .88rem; }
.st-support-mail p { margin: 0 0 .4rem; }
.st-support-mail a { color: var(--st-text); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Le tue richieste ---------- */
.st-tickets { margin: 0; padding: 0; list-style: none; }
.st-tickets li + li { border-top: 1px solid var(--st-line); }
.st-ticket-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .2rem; color: var(--st-text); text-decoration: none; }
.st-ticket-row:hover { color: #fff; }
.st-ticket-row:hover strong { text-decoration: underline; text-underline-offset: .15em; }
.st-ticket-ico {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 12px; background: var(--st-raised); color: var(--st-accent-hi); font-size: 1.1rem;
}
.st-ticket-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.st-ticket-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-ticket-main small { color: var(--st-muted); font-size: .8rem; }
.st-ticket-row.is-unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .4rem; border-radius: 50%; background: var(--st-accent-hi); vertical-align: middle; }
.st-ticket-row.is-unread small b { color: var(--st-accent-hi); }

/* Stato */
.st-status { flex-shrink: 0; padding: .15rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.st-status.is-new      { background: rgba(108, 182, 255, .14); color: #8EC8FF; }
.st-status.is-progress { background: rgba(242, 181, 68, .14); color: #F2B544; }
.st-status.is-waiting  { background: rgba(255, 77, 87, .16); color: #FF7A82; }
.st-status.is-resolved { background: rgba(74, 222, 128, .14); color: #4ADE80; }
.st-status.is-closed   { background: var(--st-raised); color: var(--st-muted); }
@media (max-width: 575.98px) { .st-ticket-row .st-status { display: none; } .st-ticket-row.is-unread .st-status { display: inline; } }

/* ---------- Conversazione ---------- */
.st-support-back { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .8rem; color: var(--st-muted); text-decoration: none; font-size: .9rem; }
.st-support-back:hover { color: var(--st-text); }
.st-ticket-head { display: flex; align-items: flex-start; gap: .8rem; }
.st-ticket-title { flex: 1; min-width: 0; }
.st-ticket-title h1 { margin: 0 0 .2rem; font-size: 1.2rem; overflow-wrap: anywhere; }
.st-ticket-title p { margin: 0; color: var(--st-muted); font-size: .82rem; }
.st-support-note { display: flex; gap: .5rem; padding: .65rem .85rem; border-radius: var(--st-radius-sm); background: rgba(108, 182, 255, .08); color: var(--st-muted); font-size: .85rem; }
.st-support-note.is-warn { background: rgba(255, 77, 87, .1); color: #FFB3B8; }

.st-chat { display: flex; flex-direction: column; gap: .8rem; margin: 1rem 0; padding: 0; list-style: none; }
.st-msg { max-width: 88%; padding: .75rem .9rem; border-radius: 18px; scroll-margin-top: calc(var(--st-topbar-h) + 1rem); }
.st-msg.is-me { align-self: flex-end; background: #3a0a0e; border: 1px solid rgba(218, 9, 21, .35); border-bottom-right-radius: 6px; }
.st-msg.is-staff { align-self: flex-start; background: var(--st-surface); border: 1px solid var(--st-line); border-bottom-left-radius: 6px; }
.st-msg-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .5rem; margin-bottom: .3rem; font-size: .78rem; }
.st-msg-meta strong { font-weight: 700; }
.st-msg-meta time { color: var(--st-muted); }
.st-msg-avatar { border-radius: 6px; }
.st-msg-body { overflow-wrap: anywhere; font-size: .95rem; line-height: 1.5; }
.st-msg-images { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.st-msg-images a { display: block; width: 110px; height: 110px; border-radius: var(--st-radius-sm); overflow: hidden; background: var(--st-raised); cursor: zoom-in; }
.st-msg-images img { width: 100%; height: 100%; object-fit: cover; }

.st-reply .form-label { font-weight: 600; }
.st-reply-actions { display: flex; justify-content: flex-end; }
.st-ticket-close { text-align: center; }
.st-ticket-close .st-link-btn { color: var(--st-muted); }
.st-ticket-closed { text-align: center; }
.st-ticket-closed p { color: var(--st-muted); }
.st-link-btn { padding: .4rem 0; border: 0; background: none; color: var(--st-muted); font-size: .88rem; text-decoration: underline; text-underline-offset: .2em; }
