/*
 * UsenetNow Customer Support / osTicket client theme
 * v1.0.0 | Customer-facing pages only
 * Designed against osTicket 1.17/1.18 client markup. No JS, no functional changes.
 * Does not apply to the /scp agent or administrator pages.
 * Install: load this stylesheet AFTER osTicket's own client styles.
 */

:root {
  --un-ink: #1b2148;
  --un-muted: #6b7390;
  --un-indigo: #262062;
  --un-violet: #8f32d4;
  --un-pink: #c827dc;
  --un-cyan: #42dbe8;
  --un-outline: #e4e7f1;
  --un-surface: #fff;
  --un-mist: #f6f7fc;
  --un-shadow: 0 18px 54px rgba(35, 28, 103, 0.09);
}

/* Foundation. Narrowly target the public help desk, not osTicket's staff UI. */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--un-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background:
    radial-gradient(ellipse 720px 420px at 96% 1%, rgba(167, 88, 235, .12), transparent 70%),
    radial-gradient(ellipse 640px 350px at 2% 60%, rgba(77, 213, 229, .09), transparent 70%),
    #f5f6fb;
}
body input, body select, body textarea, body button { font-family: inherit; }
body, #container, #content, #header, #footer { box-sizing: border-box; }
#container {
  width: min(1140px, calc(100% - 48px));
  max-width: 1140px;
  margin: 44px auto 0;
  overflow: visible;
  background: var(--un-surface);
  border: 1px solid rgba(216, 218, 239, .8);
  border-radius: 22px;
  box-shadow: var(--un-shadow);
}
#container a, #footer a { color: #653ac3; text-decoration: none; }
#content a:hover, #footer a:hover { color: #ad2cca; border-bottom-color: currentColor; }
#content p { line-height: 1.75; }
#content h1, #content h2, #content h3, #content h4 {
  color: var(--un-ink);
  letter-spacing: -.025em;
  line-height: 1.35;
}
#content h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 750; margin: 0 0 13px; }
#content h2 { font-size: 22px; font-weight: 720; }
#content h3 { font-size: 18px; font-weight: 700; }
#content > h1 + p { color: var(--un-muted); max-width: 720px; margin: 0 0 26px; }
#content hr { border: 0; border-top: 1px solid var(--un-outline); margin: 20px 0; }

/* Top logo and account bar: keep the current logo.php image intact. */
#header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 112px;
  height: auto;
  padding: 23px 38px;
  background: #fff;
  border-radius: 22px 22px 0 0;
}
#header::after {
  content: "";
  position: absolute;
  left: 38px;
  right: 38px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--un-pink), rgba(83, 214, 242, .25) 42%, transparent);
  opacity: .5;
}
#header #logo {
  flex: 0 1 auto;
  float: none;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: auto;
  max-width: min(440px, 65%);
  border: none;
}
#header #logo img {
  display: block;
  max-width: 100%;
  max-height: 64px;
  height: auto;
  width: auto;
  object-fit: contain;
}
#header .valign-helper { display: none; }
#header > .pull-right {
  float: none;
  flex: 0 0 auto;
  max-width: 46%;
  text-align: right;
  color: var(--un-muted);
  order: 2;
}
#header .pull-right p {
  width: auto;
  padding: 0;
  margin: 0;
  line-height: 1.75;
  font-size: 13px;
  overflow-wrap: anywhere;
}
#header .pull-right p:empty { display: none; }
#header .pull-right a {
  color: #5545ad;
  font-weight: 700;
  border: 0;
}
#header .pull-right a:hover { color: #a429c8; }
#header + .clear { height: 0; }

/* Public navigation: remove the 2010-era bitmap icons and fixed heights. */
#nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  height: auto;
  min-height: 65px;
  margin: 0;
  padding: 12px 36px;
  border: none;
  box-shadow: none;
  white-space: normal;
  background: linear-gradient(113deg, #211849 0%, #312578 58%, #282c85 100%);
}
#nav li { display: block; margin: 0; padding: 0; list-style: none; }
#nav li a,
#nav li a.home, #nav li a.kb, #nav li a.new,
#nav li a.status, #nav li a.tickets {
  display: block;
  width: auto;
  height: auto;
  line-height: 1.3;
  margin: 0;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #f7f7ff;
  font-size: 14px;
  font-weight: 650;
  text-align: center;
  background-image: none !important;
  background-color: transparent;
  box-sizing: border-box;
}
#nav li a.active, #nav li a:hover,
#nav li a.home.active, #nav li a.new.active, #nav li a.status.active {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.25);
  color: #fff;
  box-shadow: none;
}
#nav li a:focus-visible { outline: 2px solid var(--un-cyan); outline-offset: 3px; }
#content {
  margin: 0;
  padding: 42px 48px 56px;
  min-height: 410px;
  height: auto;
  color: var(--un-ink);
}

/* Homepage: keep the native knowledge base, welcome text and action URLs. */
#landing_page {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(255px, .85fr);
  gap: 22px 26px;
  align-items: stretch;
}
#landing_page > .main-content {
  grid-column: 1;
  grid-row: 1;
  float: none;
  width: auto;
  min-width: 0;
  min-height: 310px;
  padding: 36px 36px 42px;
  box-sizing: border-box;
  border-radius: 18px;
  background:
    url("support-art.svg") right -45px bottom -25px / 265px auto no-repeat,
    radial-gradient(circle at 92% 3%, rgba(187, 52, 216, .58), transparent 48%),
    linear-gradient(133deg, #1e1a55 2%, #302177 61%, #4b288e 100%);
  color: #fff;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
#landing_page > .main-content::before {
  content: "USENETNOW  /  CUSTOMER SUPPORT";
  display: block;
  margin: 0 0 26px;
  color: #8cf1f4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .17em;
}
#landing_page > .main-content .thread-body,
#landing_page > .main-content .thread-body p,
#landing_page > .main-content .thread-body h1,
#landing_page > .main-content .thread-body h2,
#landing_page > .main-content .thread-body h3 { color: #fff; }
#landing_page > .main-content h1 { font-size: clamp(28px,3.5vw,40px); letter-spacing: -.04em; }
#landing_page > .main-content .thread-body {
  position: relative;
  max-width: 75%;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  line-height: 1.76;
  font-size: 15px;
}
#landing_page > .main-content p { color: rgba(255,255,255,.86) !important; }
#landing_page > .main-content a { color: #96f7fa; }
#landing_page > .sidebar {
  grid-column: 2;
  grid-row: 1;
  float: none;
  width: auto;
  min-width: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
#landing_page .front-page-button {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  min-height: 280px;
  padding: 24px;
  box-sizing: border-box;
  border: 1px solid #e4e7f2;
  border-radius: 18px;
  background: linear-gradient(158deg,#fff 20%, #fbf8ff 100%);
  box-shadow: 0 8px 30px rgba(52,41,115,.055);
}
#landing_page .front-page-button::before {
  content: "HOW CAN WE HELP?";
  display: block;
  color: #716d96;
  margin-bottom: 9px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .15em;
  text-align: left;
}
#landing_page .front-page-button p { margin: 0; }
#landing_page .front-page-button .button {
  width: 100%;
  max-width: none;
  min-height: 58px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 14px 19px;
  margin: 0;
  text-align: left;
  line-height: 1.35;
  white-space: normal;
  font-size: 15px;
  font-weight: 750;
  box-sizing: border-box;
}
#landing_page .front-page-button .button::after {
  content: "↗";
  margin-left: 10px;
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
}
#landing_page .front-page-button .blue.button { color: #fff; }
#landing_page .front-page-button .green.button {
  color: #33236f;
  background: #fff;
  border: 1px solid #d8d5ed;
  box-shadow: none;
}
#landing_page .front-page-button .green.button:hover { border-color: #8a66c7; background: #f8f3ff; }
#landing_page .sidebar .content:empty { display: none; }
#landing_page .sidebar .content:not(:empty) {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--un-outline);
  background: #fbfbff;
  line-height: 1.65;
}
#landing_page .sidebar .content .header { color: var(--un-ink); font-weight: 800; }
#landing_page > .clear { display: none; }
#landing_page > div:not(.sidebar):not(.main-content):not(.clear) { grid-column: 1 / -1; }
#landing_page .search-form { padding-top: 0; margin-bottom: 18px; }
#landing_page .search-form form { display: flex; flex-wrap: wrap; gap: 9px; }
#landing_page .search-form .search { float: none; flex: 1 1 170px; width: auto; }

/* Consistent buttons, with a restrained version of the homepage gradient. */
#content .button, #content a.button,
#content input[type="submit"], #content button[type="submit"],
#content input[type="button"] {
  font: inherit;
  font-weight: 750;
  font-size: 14px;
  line-height: 1.35;
  padding: 12px 21px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #fff;
  text-shadow: none;
  background: linear-gradient(115deg, #9b35d8 0%, #7253e0 56%, #5364db 100%);
  box-shadow: 0 6px 14px rgba(111,71,211,.17);
  cursor: pointer;
  max-width: none;
  vertical-align: middle;
  height: auto;
}
#content .button:hover, #content a.button:hover,
#content input[type="submit"]:hover, #content button[type="submit"]:hover,
#content input[type="button"]:hover {
  border: 1px solid rgba(81,32,169,.13);
  color: #fff;
  background: linear-gradient(115deg, #852dce, #5648cc);
  box-shadow: 0 7px 17px rgba(89,61,168,.23);
}
#content input[type="reset"], #content button[type="reset"] {
  color: #51577b;
  background: #f1f2f9;
  border: 1px solid #dfe2ec;
  box-shadow: none;
  border-radius: 10px;
  padding: 12px 17px;
  font-weight: 650;
  cursor: pointer;
}
#content input[type="reset"]:hover, #content button[type="reset"]:hover { background: #e9eaf4; }
#content :is(a,button,input,select,textarea):focus-visible {
  outline: 2px solid #8056d7;
  outline-offset: 3px;
}

/* Input styling. Exclude hidden, radio, checkbox, file and osTicket rich-text controls. */
#content input[type="text"], #content input[type="password"],
#content input[type="email"], #content input[type="tel"],
#content input[type="number"], #content input[type="search"],
#content select, #content textarea {
  color: var(--un-ink);
  background: #fff;
  border: 1px solid #ccd2e4;
  border-radius: 10px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 13px;
  box-shadow: none;
  font-size: 15px;
  line-height: 1.4;
  max-width: 100%;
}
#content textarea { min-height: 114px; resize: vertical; }
#content input::placeholder, #content textarea::placeholder { color: #999fb5; opacity: 1; }
#content input:not([type="hidden"]):focus,
#content textarea:focus, #content select:focus {
  border-color: #8567d7;
  box-shadow: 0 0 0 3px rgba(136,99,221,.11);
}
#content input[type="checkbox"], #content input[type="radio"] { accent-color: #8f32d4; }
#content label { color: var(--un-ink); font-weight: 600; }
#content .error { color: #ad224f; }
#content .error input, #content .error select, #content .error textarea { border-color: #d75a81; }
#content select { padding-right: 28px; }
#content .form-header { color: var(--un-ink); }
#content .form-header h3, #content .form-header b { font-size: 18px; color: var(--un-ink); }
#content .form-header div { font-size: 14px; color: var(--un-muted); }

/* Opening a ticket. Preserve all osTicket-generated hidden fields and actions. */
#ticketForm {
  max-width: 100%;
  margin-top: 28px;
  padding: 24px 28px 28px;
  background: #fff;
  border: 1px solid var(--un-outline);
  border-radius: 18px;
  box-shadow: 0 9px 30px rgba(44,34,107,.045);
  box-sizing: border-box;
}
#ticketForm > table {
  width: 100% !important;
  max-width: 100%;
  table-layout: auto;
  border: 0;
  border-collapse: separate;
  border-spacing: 0 1px;
}
#ticketForm > table > tbody > tr > td { box-sizing: border-box; padding: 8px 10px; }
#ticketForm > table > tbody > tr > td:first-child:not([colspan]) { width: 205px; }
#ticketForm > table > tbody > tr > td + td { width: auto; }
#ticketForm > table td.required { color: var(--un-ink); font-weight: 700; }
#ticketForm td textarea, #ticketForm div textarea {
  width: 100% !important;
  max-width: 100%;
}
#ticketForm input[type="text"], #ticketForm input[type="email"],
#ticketForm input[type="tel"], #ticketForm input[type="password"] {
  width: min(100%, 450px);
}
#ticketForm select { width: min(100%, 580px); float: none; }
#ticketForm .form-header { margin-top: 7px; }
#ticketForm .buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 0;
}
#ticketForm .buttons input { width: auto !important; margin: 0; }
#ticketForm .captchaRow td { vertical-align: middle; }
#ticketForm .captcha {
  width: auto;
  height: auto;
  display: inline-flex;
  vertical-align: middle;
  align-items: center;
  margin: 0 12px 8px 0;
  float: none;
  padding: 5px;
  border: 1px solid var(--un-outline);
  border-radius: 8px;
  background: #f7f8fc;
}
#ticketForm .captcha img { float: none !important; display: block; max-width: 150px; }
#ticketForm #captcha { display: inline-block; width: 110px; vertical-align: middle; }
#ticketForm .captchaRow em { display: block; margin-top: 5px; font-size: 12px; }
#ticketForm .error { color: #bd315b; }
#ticketForm .filedrop { max-width: 100%; }
#ticketForm .redactor_box, #ticketForm .redactor-editor,
#ticketForm .redactor-styles { max-width: 100%; box-sizing: border-box; }

/* Client sign in and ticket status, including osTicket's inline table-style wrappers. */
#clientLogin {
  display: block;
  max-width: 900px;
  padding: 0;
  margin: 27px 0 18px;
  border: 1px solid var(--un-outline);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(44,34,107,.05);
  overflow: hidden;
}
#clientLogin > div[style*="table-row"] {
  display: flex !important;
  align-items: stretch;
  gap: 0;
}
#clientLogin .login-box {
  display: block;
  float: none;
  flex: 1.15 1 0;
  width: auto;
  min-width: 0;
  padding: 27px 30px;
  background: #fff;
  box-shadow: none;
  box-sizing: border-box;
}
#clientLogin > div[style*="table-row"] > div:not(.login-box) {
  display: block !important;
  flex: .85 1 0;
  width: auto;
  min-width: 0;
  padding: 30px 25px !important;
  background: #f7f6fd;
  border-left: 1px solid var(--un-outline);
  box-sizing: border-box;
  color: #5d6283;
  font-size: 14px;
}
#clientLogin .login-box > div { margin-bottom: 12px; }
#clientLogin .login-box > p { margin: 16px 0 0; }
#clientLogin .login-box input[type="text"],
#clientLogin .login-box input[type="password"] {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 7px 0 13px;
  padding: 11px 13px;
  box-sizing: border-box;
}
#clientLogin .login-box input[type="submit"] { width: auto; padding: 12px 24px; }
#clientLogin .instructions { line-height: 1.8; }
#clientLogin a { color: #673bc0; font-weight: 650; }
#clientLogin strong:empty { display: none; }

/* Account pages, knowledgebase, ticket list and replies. */
#content .sidebar .content { border-radius: 11px; }
#kb, #faq { max-width: 100%; }
#kb > li { border-bottom: 1px solid var(--un-outline); background: #fff; }
#faq ol li a:hover { background-color: #f8f3fd; }
.featured-category { max-width: 100%; }
#ticketTable {
  width: 100%;
  border: 1px solid var(--un-outline);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
#ticketTable th {
  border-color: var(--un-outline);
  height: auto;
  padding: 12px;
  background: #f0effc;
  color: #302765;
  font-weight: 750;
  white-space: nowrap;
}
#ticketTable td { border-color: var(--un-outline); padding: 12px; }
#ticketTable tr.alt td { background: #fafaff; }
#ticketInfo, #reply {
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--un-outline);
  border-radius: 14px;
  padding: 19px;
  box-sizing: border-box;
}
#reply { margin-top: 15px; }
#reply textarea { width: 100% !important; max-width: 100%; }
.thread-entry .header { border-color: #dedff0; border-radius: 10px 10px 0 0; }
.thread-entry.response .header { background: #efeff9; }
.thread-entry.message .header { background: #ecfaff; }
.thread-entry .thread-body { border-color: #dedff0; border-radius: 0 0 10px 10px; }
.thread-body .attachments { background: #f6f5fd; }
.infoTable { background: #f7f8fd; }
.infoTable th { padding: 8px 10px; }
#msg_error, #msg_warning, #msg_notice,
.error_bar, .warning_bar, .notice_bar {
  box-sizing: border-box;
  min-height: 36px;
  height: auto;
  line-height: 1.5;
  border-radius: 9px;
  margin-bottom: 16px;
  padding: 10px 13px 10px 38px;
}

/* Credit is kept intact. No change to osTicket licensing notice. */
#footer {
  width: min(1140px, calc(100% - 48px));
  max-width: 1140px;
  margin: 0 auto 34px;
  padding: 26px 20px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #71758f;
  text-align: center;
}
#footer p { margin: 0 0 9px; }
#footer #poweredBy { margin: 10px auto 0; opacity: .68; }
#footer a { color: #575d84; }

/* Mid-width and mobile fixes. Keep CAPTCHA, form actions, links and errors visible. */
@media (max-width: 900px) {
  #content { padding: 32px 28px 44px; }
  #header { padding: 18px 27px; min-height: 88px; }
  #header::after { left: 27px; right: 27px; }
  #nav { padding: 12px 26px; }
  #landing_page { grid-template-columns: minmax(0, 1fr); }
  #landing_page > .main-content,
  #landing_page > .sidebar { grid-column: 1; }
  #landing_page > .main-content { grid-row: 1; min-height: 260px; }
  #landing_page > .sidebar { grid-row: 2; }
  #landing_page .front-page-button { min-height: 0; }
  #ticketForm { padding: 18px; }
  #ticketForm > table > tbody > tr > td:first-child:not([colspan]) { width: 175px; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  #container {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  #header {
    border-radius: 0;
    min-height: 75px;
    padding: 18px 18px 14px;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }
  #header #logo { max-width: 100%; height: auto; }
  #header #logo img { max-height: 56px; max-width: min(100%,290px); }
  #header > .pull-right { max-width: 100%; width: 100%; text-align: left; }
  #header .pull-right p { font-size: 12px; }
  #header::after { left: 18px; right: 18px; }
  #nav { justify-content: flex-start; padding: 11px 11px; gap: 5px; min-height: 0; }
  #nav li { flex: 0 1 auto; }
  #nav li a, #nav li a.home, #nav li a.new, #nav li a.status {
    font-size: 12px;
    padding: 9px 10px;
    border-radius: 8px;
    white-space: normal;
  }
  #content { padding: 25px 18px 36px; min-height: 0; }
  #content h1 { font-size: 26px; }
  #content > h1 + p { font-size: 14px; }
  #landing_page { gap: 16px; }
  #landing_page > .main-content {
    padding: 30px 23px 38px;
    min-height: 285px;
    border-radius: 15px;
    background-size: 185px auto, cover, cover;
    background-position: right -55px bottom -23px, center, center;
  }
  #landing_page > .main-content::before { font-size: 10px; margin-bottom: 20px; letter-spacing: .12em; }
  #landing_page > .main-content .thread-body { max-width: 100%; }
  #landing_page > .main-content h1 { font-size: 29px; }
  #landing_page > .main-content p { max-width: 95%; }
  #landing_page .front-page-button { padding: 17px; border-radius: 15px; }
  #landing_page .front-page-button .button { min-height: 55px; }
  #ticketForm { padding: 16px 14px 22px; border-radius: 14px; }
  #ticketForm > table,
  #ticketForm > table > tbody,
  #ticketForm > table > tbody > tr,
  #ticketForm > table > tbody > tr > td {
    display: block;
    width: 100% !important;
    max-width: 100%;
  }
  #ticketForm > table > tbody > tr > td { padding: 5px 2px; }
  #ticketForm > table > tbody > tr > td:first-child:not([colspan]) { padding-bottom: 0; }
  #ticketForm input[type="text"], #ticketForm input[type="email"],
  #ticketForm input[type="tel"], #ticketForm input[type="password"],
  #ticketForm select { width: 100%; max-width: 100%; }
  #ticketForm #captcha { width: 110px; }
  #ticketForm .buttons input { min-width: 0; flex: 1 1 auto; }
  #clientLogin { border-radius: 14px; }
  #clientLogin > div[style*="table-row"] { display: block !important; }
  #clientLogin .login-box,
  #clientLogin > div[style*="table-row"] > div:not(.login-box) {
    width: 100%;
    padding: 23px 19px !important;
    display: block !important;
  }
  #clientLogin > div[style*="table-row"] > div:not(.login-box) {
    border-left: none;
    border-top: 1px solid var(--un-outline);
  }
  #clientLogin .login-box input[type="text"],
  #clientLogin .login-box input[type="password"] { width: 100%; }
  #ticketTable { display: block; overflow-x: auto; max-width: 100%; }
  #ticketInfo, #reply { padding: 14px; }
  .thread-entry.avatar { margin-left: 0; margin-right: 0; }
  .thread-entry > .avatar { display: none; }
  .thread-entry .header .title { max-width: 100%; }
  .thread-entry .thread-body { overflow-wrap: anywhere; }
  #footer { width: 100%; padding: 25px 16px; margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #content .button, #content a.button { transition: none; }
}
