/* feedback: the tickets of the user, one ticket as a conversation, the form of a guest; the same messages in the administration */
body {
    background-color: var(--page);
    color: var(--text);
}

main.support-page {
    width: 100%;
    max-width: 760px;
    margin: 0 auto auto auto;
    padding: 20px 16px;
    box-sizing: border-box;
}

.support-title {
    margin: 0 0 8px 0;
    font-size: 24px;
}

.support-note {
    margin: 0 0 12px 0;
    color: var(--text-muted);
    font-size: 15px;
}

.support-note a, .support-back {
    color: var(--brand);
}

.support-back {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
}

.support-card {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
}

.support-card h2 {
    margin: 0 0 12px 0;
    font-size: 18px;
}

.support-flash {
    margin: 0 0 12px 0;
    padding: 10px 14px;
    border-left: 4px solid var(--status-ok);
    border-radius: var(--radius);
    background-color: var(--surface);
}

.support-flash.danger {
    border-left-color: var(--status-error);
    color: var(--status-error);
}

.support-guest-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 0 16px;
    background-color: var(--brand);
}

.support-guest-bar a {
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
}

.support-guest-bar .support-guest-login {
    font-weight: 400;
    font-size: 16px;
}

/* the form of a new ticket and of an answer */
.ticket-new, .ticket-reply {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-new label, .ticket-reply > label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
    font-size: 15px;
}

.ticket-new input[type=text], .ticket-new input[type=email], .ticket-new select, .ticket-new textarea, .ticket-reply textarea {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-sizing: border-box;
    font: inherit;
    font-size: 16px;
    font-weight: 400;
    background-color: var(--surface);
}

.ticket-new textarea, .ticket-reply textarea {
    resize: vertical;
}

.ticket-attach input[type=file] {
    min-height: 44px;
    font-weight: 400;
}

.ticket-attach-note {
    margin: -6px 0 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.ticket-attach-note.error {
    color: var(--status-error);
}

.optional {
    font-weight: 400;
    color: var(--text-muted);
}

.support-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.ticket-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ticket-send, .ticket-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: var(--radius);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.ticket-send {
    border: none;
    color: #ffffff;
    background-color: var(--action);
}

.ticket-send:hover {
    background-color: var(--action-hover);
}

.ticket-close {
    border: 1px solid var(--border);
    color: var(--text);
    background-color: var(--surface);
}

.ticket-send:disabled, .ticket-close:disabled {
    opacity: .6;
    cursor: wait;
}

/* the list of tickets of the user */
.ticket-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ticket-list li + li {
    border-top: 1px solid var(--border);
}

.ticket-list a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 4px;
    color: var(--text);
    text-decoration: none;
}

.ticket-list a:hover .ticket-line b {
    text-decoration: underline;
}

.ticket-list li.unread .ticket-line b {
    color: var(--brand);
}

.ticket-first {
    color: var(--text);
    font-size: 15px;
    overflow-wrap: anywhere;
}

.ticket-meta {
    color: var(--text-muted);
    font-size: 14px;
}

.ticket-state {
    display: inline-block;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    background-color: #fff4e5;
    color: #9a5b00;
}

.ticket-state.state-answered {
    background-color: #e8f5e9;
    color: var(--status-ok);
}

.ticket-state.state-closed {
    background-color: #eceff1;
    color: var(--text-muted);
}

/* one ticket as a conversation: messages of support on the left in their colour, of the user on the right */
.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ticket-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 12px;
    background-color: #eef3f9;
    overflow-wrap: anywhere;
}

.ticket-msg.from-user {
    align-self: flex-end;
    background-color: #e8f5e9;
}

.ticket-msg.from-support {
    align-self: flex-start;
}

.ticket-msg-head {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-bottom: 4px;
    font-size: 14px;
}

.ticket-msg-head span {
    color: var(--text-muted);
}

.ticket-msg p {
    margin: 0 0 6px 0;
    white-space: pre-line;
}

.ticket-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.ticket-files img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: #ffffff;
}

.support-sent .ticket-send {
    margin-top: 8px;
}

/* the same parts inside the administration */
.admin-page .support-card {
    margin-top: 12px;
}
