/* Public login */
body.support-login-body,
body.support-public-body {
    margin: 0;
    background: #f3f7fb;
    color: #1f2d3d;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.support-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 15% 20%, rgba(26, 115, 232, .14), transparent 32%), #f4f8fc;
    box-sizing: border-box;
}
.support-login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(26, 48, 84, .14);
    padding: 32px;
    box-sizing: border-box;
}
.support-login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.support-login-logo img { height: 42px; max-width: 190px; }
.support-login-card h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.18; }
.support-login-card p { margin: 0 0 24px; color: #66758a; line-height: 1.5; }
.support-login-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.support-login-field label { font-weight: 700; font-size: 13px; }
.support-login-field input {
    height: 46px; border: 1px solid #d9e3ef; border-radius: 14px; padding: 0 14px; font-size: 15px; outline: none;
}
.support-login-field input:focus { border-color: #2f80ed; box-shadow: 0 0 0 4px rgba(47, 128, 237, .12); }
.support-login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 20px; font-size: 13px; color: #66758a; }
.support-login-row label { display: inline-flex; align-items: center; gap: 8px; }
.support-login-btn,
.support-login-link-btn,
.support-chat-send,
.support-chat-open {
    border: 0; border-radius: 14px; background: #1f6feb; color: #fff; font-weight: 800; cursor: pointer; text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.support-login-btn:hover,
.support-login-link-btn:hover,
.support-chat-send:hover,
.support-chat-open:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(31, 111, 235, .18); }
.support-login-btn { width: 100%; height: 48px; font-size: 15px; }
.support-login-link-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; }
.support-login-error,
.support-login-notice { border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; line-height: 1.45; }
.support-login-error { background: #fff1f0; color: #b42318; border: 1px solid #ffd1cc; }
.support-login-notice { background: #f0f7ff; color: #1f5b99; border: 1px solid #cfe4ff; }

/* Public shell adjustments over original service-desk styles */
.support-public-body .sd-page { min-height: 100vh; }
.support-topbar { align-items: center; }
.support-nav { gap: 18px; }
.support-logout {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 12px;
    background: #eef4fb;
    color: #27364a !important;
    text-decoration: none;
    font-weight: 800;
}
.support-hero .sd-subtitle { max-width: 760px; }
.support-request-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.support-chat-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}
.sd-request-review-btn + .support-chat-open { background: #27364a; }

/* Chat modal */
.support-chat-modal[hidden] { display: none !important; }
.support-chat-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
}
.support-chat-backdrop { position: absolute; inset: 0; background: rgba(14, 24, 39, .48); }
.support-chat-dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: min(780px, calc(100vh - 36px));
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0,0,0,.24);
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}
.support-chat-dialog-head {
    padding: 18px 20px;
    border-bottom: 1px solid #e6eef7;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.support-chat-dialog-head h3 { margin: 0 0 4px; font-size: 20px; }
.support-chat-dialog-head span { color: #66758a; font-size: 13px; }
.support-chat-close {
    border: 0;
    background: #f2f6fb;
    border-radius: 12px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 20px;
}
.support-chat-messages {
    padding: 18px 20px;
    overflow: auto;
    min-height: 280px;
    background: linear-gradient(180deg, #fbfdff, #f6faff);
}
.support-chat-message { max-width: 78%; margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px solid #e6eef7; box-shadow: 0 4px 16px rgba(33, 53, 85, .06); }
.support-chat-message.client { margin-left: auto; background: #edf6ff; border-color: #cfe4ff; }
.support-chat-message.staff { margin-right: auto; }
.support-chat-message .meta { font-size: 12px; color: #6d7c91; margin-bottom: 6px; }
.support-chat-message .text { white-space: pre-wrap; line-height: 1.45; }
.support-chat-empty { padding: 18px; border-radius: 16px; background: #f7fbff; color: #66758a; }
.support-chat-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px; border-top: 1px solid #e6eef7; background: #fff; }
.support-chat-form textarea { resize: vertical; min-height: 48px; max-height: 160px; border: 1px solid #d9e3ef; border-radius: 14px; padding: 12px 14px; font: inherit; outline: none; }
.support-chat-form textarea:focus { border-color: #2f80ed; box-shadow: 0 0 0 4px rgba(47, 128, 237, .10); }
.support-chat-send { min-width: 122px; padding: 0 16px; }
.support-chat-send:disabled { opacity: .65; cursor: default; transform: none; box-shadow: none; }

@media (max-width: 760px) {
    .support-nav { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
    .support-nav a:not(.support-logout) { display: none; }
    .support-chat-form { grid-template-columns: 1fr; }
    .support-chat-send { height: 44px; }
    .support-chat-message { max-width: 92%; }
    .support-login-card { padding: 24px; }
}

.support-chat-compose { display: grid; gap: 8px; }
.support-chat-file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.support-chat-file-pick { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px dashed #b8c7db; border-radius: 12px; color: #2c5f9e; cursor: pointer; background: #f8fbff; font-size: 13px; }
.support-chat-file-pick input { display: none; }
.support-chat-file-list { color: #66758a; font-size: 12px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-chat-files-view { display: grid; gap: 8px; margin-top: 8px; }
.support-chat-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.75); border: 1px solid #d9e6f6; color: #255a96; text-decoration: none; }
.support-chat-file:hover { text-decoration: underline; }
.support-chat-file.image { display: grid; align-items: start; }
.support-chat-file.image img { max-width: 220px; max-height: 160px; border-radius: 10px; border: 1px solid #d9e6f6; object-fit: contain; background: #fff; }
.support-chat-file-icon { font-size: 18px; }
@media (max-width: 720px) {
    .support-chat-file-list { max-width: 100%; white-space: normal; }
    .support-chat-file.image img { max-width: 100%; }
}
