/* Saltway Helpdesk — customer support page. Powered and designed by Saltway Digital. */
:root {
  --deep: #0e4d66; --mid: #156077; --teal: #2a889b; --light: #46aebb; --mist: #e6f3f5;
  --bg: #f4f7f8; --surface: #fff; --surface-2: #f8fbfb; --text: #13262e; --muted: #5b6f77; --line: #dfe7ea;
  --ok: #1d8a5a; --ok-bg: #e3f4ec; --warn: #9a6200; --warn-bg: #fdf1dc; --bad: #b43a3a; --bad-bg: #fbe6e6;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1a20; --surface: #11252d; --surface-2: #0f2129; --text: #e4eff2; --muted: #93aab2; --line: #21404b; --mist: #163640;
    --ok: #5ccf97; --ok-bg: #12352a; --warn: #e8b35a; --warn-bg: #3a2c12; --bad: #f08a8a; --bad-bg: #3d1a1d; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: var(--teal); }
h1, h2, h3 { line-height: 1.25; margin: 0; }

.hero {
  background:
    radial-gradient(900px 400px at 90% -40%, rgba(70,174,187,.55), transparent 60%),
    radial-gradient(700px 400px at -10% 140%, rgba(42,136,155,.5), transparent 60%),
    linear-gradient(160deg, #0e4d66 0%, #0b3d52 60%, #082f40 100%);
  color: #fff; padding: 34px 16px 84px;
}
.hero-inner { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 18px; }
body.branded .hero { background: radial-gradient(900px 400px at 90% -40%, rgba(255,255,255,.18), transparent 60%), linear-gradient(160deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 75%, black) 100%); }
body.branded button.primary, body.branded .primary-link { background: var(--brand); box-shadow: none; }
.hero-logo.custom { width: auto; max-width: 160px; height: 64px; object-fit: contain; background: #fff; border-radius: 12px; padding: 6px; }
.hero-logo { width: 72px; height: 72px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.25)); }
.hero h1 { font-size: 30px; letter-spacing: -.01em; }
.hero-sub { margin: 4px 0 0; color: #bfe3e9; font-size: 17px; }
.ghost { margin-left: auto; background: transparent; color: #d9eef1; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.ghost:hover { border-color: #fff; color: #fff; }

main { flex: 1; width: 100%; max-width: 1040px; margin: -56px auto 0; padding: 0 16px 32px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: 0 10px 30px rgba(14,77,102,.10); }
.card.soft { background: var(--surface-2); box-shadow: none; }
.card h2 { font-size: 20px; margin-bottom: 4px; color: var(--deep); }
@media (prefers-color-scheme: dark) { .card h2 { color: #e4eff2; } }
.card h3 { font-size: 16px; margin-bottom: 4px; }
.muted { color: var(--muted); margin: 0 0 16px; }
.center { text-align: center; }
.narrow { max-width: 560px; margin: 0 auto; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
input, textarea { font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--light); box-shadow: 0 0 0 3px rgba(70,174,187,.25); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

button.primary, button.secondary, .secondary-btn {
  font: inherit; font-weight: 700; font-size: 15px; border-radius: 10px; padding: 11px 20px; cursor: pointer; border: 0;
}
button.primary { background: linear-gradient(135deg, #2a889b, #156077); color: #fff; box-shadow: 0 8px 20px rgba(21,96,119,.28); }
button.primary:hover { filter: brightness(1.06); }
button.secondary, .secondary-btn { background: var(--mist); color: var(--deep); text-decoration: none; }
@media (prefers-color-scheme: dark) { button.secondary, .secondary-btn { color: #e4eff2; } }
button:disabled { opacity: .6; cursor: default; }
.primary-link { display: inline-block; background: linear-gradient(135deg, #2a889b, #156077); color: #fff; text-decoration: none; font-weight: 700; padding: 11px 20px; border-radius: 10px; }

.notice { background: var(--mist); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 0 0 14px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.tick { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 28px; font-weight: 700; display: grid; place-items: center; margin: 0 auto 12px; }

.list-head { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; box-shadow: 0 10px 30px rgba(14,77,102,.10); }
.list-head h2 { font-size: 20px; }
#list-email { margin: 12px 4px; }
.tickets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tickets a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; text-decoration: none; color: var(--text); }
.tickets a:hover { border-color: var(--light); }
.tickets .s { font-weight: 700; }
.tickets .w { color: var(--muted); font-size: 13px; }
.tickets .p { grid-column: 1 / -1; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tickets .m { grid-column: 1 / -1; display: flex; gap: 6px; }

.pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: capitalize; background: var(--mist); color: var(--muted); }
.pill.ref { background: var(--surface-2); border: 1px solid var(--line); text-transform: none; }
.pill.open { background: var(--ok-bg); color: var(--ok); }
.pill.pending { background: var(--warn-bg); color: var(--warn); }
.t-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.t-head h2 { margin-top: 8px; }
.thread { display: flex; flex-direction: column; gap: 12px; padding: 18px 0; }
.msg { max-width: 85%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.msg.agent { background: var(--mist); border-color: #cbe5ea; }
@media (prefers-color-scheme: dark) { .msg.agent { border-color: #21404b; } }
.msg.customer { align-self: flex-end; background: var(--surface-2); }
.msg .mh { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.msg .mh b { color: var(--text); }
.msg .mb { white-space: pre-wrap; word-wrap: break-word; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.atts a { font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; text-decoration: none; color: var(--text); }
.reply { border-top: 1px solid var(--line); padding-top: 16px; }

.credit { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 20px; }
.credit img { width: 22px; height: 22px; }
.credit strong { color: var(--mid); }
@media (prefers-color-scheme: dark) { .credit strong { color: var(--light); } }

@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .hero-logo { width: 56px; height: 56px; }
  .hero h1 { font-size: 24px; }
  .msg { max-width: 100%; }
}
