/*
 * InThing brand theme for the osTicket customer portal.
 *
 * Loaded LAST in include/client/header.inc.php so it overrides both
 * css/osticket.css and assets/default/css/theme.css without editing them.
 * This file is intentionally self-contained to keep osTicket upgrades simple:
 * on upgrade, re-add the <link> in header.inc.php and keep this file.
 *
 * Branding: Montserrat / Metallic Orange #E26310 / Black #262626 /
 *           Dark Greyish Cyan #A4A6A6 / Light Grey #D9D9D9.
 */

:root {
  --it-orange: #e26310;
  --it-orange-dark: #c14f06;
  --it-black: #262626;
  --it-grey: #a4a6a6;
  --it-grey-light: #d9d9d9;
  --it-bg: #f4f5f5;
  --it-card: #ffffff;
  --it-border: #e4e6e6;
  --it-radius: 10px;
  --it-radius-sm: 8px;
  --it-shadow: 0 10px 30px rgba(38, 38, 38, 0.08);
  --it-font: 'Montserrat', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* ---------------------------------------------------------------------------
 * Typography
 * ------------------------------------------------------------------------- */
body,
input,
select,
textarea,
button,
.thread-body,
#content {
  font-family: var(--it-font);
  color: var(--it-black);
}

body {
  background: var(--it-bg) !important;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--it-font);
  color: var(--it-black);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

#content h1 {
  color: var(--it-black);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

#content h2 { font-size: 18px; color: #5a5c5c; font-weight: 600; }
#content h3 { font-size: 16px; }

a {
  color: var(--it-orange);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover { color: var(--it-orange-dark); }

hr { border-top: 1px solid var(--it-border); }

/* ---------------------------------------------------------------------------
 * Layout shell — modern centered card, fluid width (replaces fixed 840px)
 * ------------------------------------------------------------------------- */
#container {
  width: auto !important;
  max-width: 1040px;
  margin: 28px auto 40px;
  background: var(--it-card);
  border: 1px solid var(--it-border);
  border-radius: var(--it-radius);
  box-shadow: var(--it-shadow) !important;
  overflow: visible;
}

#content {
  padding: 28px 34px 36px;
  margin: 0;
  min-height: 320px;
}

.clear { height: 0; }

/* ---------------------------------------------------------------------------
 * Header + logo
 * ------------------------------------------------------------------------- */
#header {
  height: auto !important;
  min-height: 78px;
  padding: 16px 34px !important;
  background: var(--it-card);
  border-bottom: 1px solid var(--it-border);
  border-radius: var(--it-radius) var(--it-radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

#header #logo {
  width: auto !important;
  height: auto !important;
  float: none !important;
  display: inline-flex;
  align-items: center;
}

#header #logo img {
  height: 40px;
  width: auto;
  max-width: 260px;
  display: block;
}

#header .valign-helper { display: none; }

#header p {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: right;
  font-size: 13px;
  color: #6a6c6c;
}

#header p a {
  color: var(--it-black);
  font-weight: 600;
}

#header p a:hover { color: var(--it-orange); }

#header .flush-right { text-align: right; }

/* ---------------------------------------------------------------------------
 * Primary navigation — clean pill tabs, orange active state
 * ------------------------------------------------------------------------- */
#nav {
  margin: 0 !important;
  padding: 8px 34px !important;
  height: auto !important;
  background: #fafbfb !important;
  border-top: 0 !important;
  border-bottom: 1px solid var(--it-border);
  box-shadow: none !important;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#nav li a {
  float: none !important;
  height: auto !important;
  line-height: 1.2 !important;
  padding: 9px 16px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  background-image: none !important;
  background-color: transparent !important;
  color: #4a4c4c !important;
  font-weight: 600;
  font-size: 13px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

#nav li a:hover {
  background-color: rgba(226, 99, 16, 0.10) !important;
  color: var(--it-orange) !important;
}

#nav li a.active {
  background-color: var(--it-orange) !important;
  color: #fff !important;
}

/* ---------------------------------------------------------------------------
 * Buttons — orange primary, grey secondary
 * ------------------------------------------------------------------------- */
.button,
.button:visited,
input[type=submit],
input[type=button],
input[type=reset],
button.btn,
.btn.button,
a.btn {
  display: inline-block;
  background: var(--it-orange) !important;
  background-image: none !important;
  color: #fff !important;
  font-family: var(--it-font) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  text-align: center;
  text-shadow: none !important;
  text-decoration: none;
  padding: 11px 22px !important;
  width: auto;
  border: 0 !important;
  border-radius: var(--it-radius-sm) !important;
  box-shadow: 0 2px 6px rgba(226, 99, 16, 0.28) !important;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  -webkit-appearance: none;
  appearance: none;
}

.button:hover,
input[type=submit]:hover,
input[type=button]:hover,
button.btn:hover,
a.btn:hover {
  background: var(--it-orange-dark) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(226, 99, 16, 0.34) !important;
}

.button:active,
input[type=submit]:active,
input[type=button]:active {
  transform: translateY(1px);
  box-shadow: none !important;
}

/* Secondary / reset / cancel buttons — same box model & height as primary,
 * outline drawn with an inset shadow (not a real border) to avoid size drift. */
input[type=reset],
input[name=cancel],
.button.grey,
.button.gray {
  background: #eef0f0 !important;
  color: var(--it-black) !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px var(--it-border) !important;
}

input[type=reset]:hover,
input[name=cancel]:hover,
.button.grey:hover,
.button.gray:hover {
  background: #e2e5e5 !important;
  color: var(--it-black) !important;
  box-shadow: inset 0 0 0 1px var(--it-grey) !important;
}

input[type=reset]:active,
input[name=cancel]:active {
  transform: translateY(1px);
}

/* Legacy colour helpers remapped to brand */
.green.button, .green.button:visited,
.blue.button, .blue.button:visited { background-color: var(--it-orange) !important; }
.green.button:hover, .blue.button:hover { background-color: var(--it-orange-dark) !important; }

/* ---------------------------------------------------------------------------
 * Form controls
 * ------------------------------------------------------------------------- */
input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=search],
input[type=tel],
input[type=url],
textarea,
select {
  font-family: var(--it-font);
  font-size: 14px;
  color: var(--it-black);
  background: #fff;
  border: 1px solid var(--it-grey-light) !important;
  border-radius: var(--it-radius-sm) !important;
  padding: 9px 12px !important;
  box-sizing: border-box;
  max-width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea { line-height: 1.5; }

input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus,
input[type=number]:focus,
input[type=search]:focus,
input[type=tel]:focus,
input[type=url]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--it-orange) !important;
  box-shadow: 0 0 0 3px rgba(226, 99, 16, 0.15) !important;
}

/* Redactor rich-text editor frame */
.richtext .redactor-box,
.redactor-box {
  border-radius: var(--it-radius-sm);
  border-color: var(--it-grey-light) !important;
}

/* ---------------------------------------------------------------------------
 * Ticket / login / KB forms — relax the legacy fixed pixel widths so the
 * layout can breathe and go responsive.
 * ------------------------------------------------------------------------- */
#ticketForm table,
#reply table,
#ticketTable,
table[width="800"],
table[width="500"] {
  width: 100% !important;
  max-width: 100%;
}

#ticketForm td textarea,
#reply textarea,
#ticketForm div textarea {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}

#clientLogin {
  width: auto !important;
  max-width: 680px;
  margin: 22px 0;
  padding: 24px 28px !important;
  border: 1px solid var(--it-border) !important;
  border-radius: var(--it-radius) !important;
  background: #fafbfb !important;
}

/* Turn the legacy CSS-table layout (table-row / table-cell set via inline
 * styles) into a responsive two-column flex layout: form on the left,
 * sign-in / register instructions on the right. */
#clientLogin > div {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px 32px;
  align-items: flex-start;
}

#clientLogin .login-box {
  flex: 1 1 300px;
  width: auto !important;
  min-width: 0;
  padding: 0 !important;
  background: none !important;
}

/* Second cell: ".instructions" (check-status) or the inline table-cell (sign-in) */
#clientLogin .instructions,
#clientLogin > div > div:last-child {
  flex: 1 1 220px;
  width: auto !important;
  min-width: 0;
  display: block !important;
  padding: 0 !important;
  color: #5a5c5c;
  line-height: 1.65;
}

#clientLogin label {
  display: block;
  width: auto !important;
  float: none !important;
  font-weight: 600;
  margin: 12px 0 5px;
}

#clientLogin input[type=text],
#clientLogin input[type=password],
#clientLogin #email,
#clientLogin #ticketno,
#clientLogin #username,
#clientLogin #passwd {
  width: 100% !important;
  max-width: 100%;
  display: block;
  float: none !important;
  margin: 0 0 4px !important;
  box-sizing: border-box;
}

#clientLogin .btn { margin-top: 14px; width: 100%; }
#clientLogin p { clear: none; text-align: left; margin: 0; }
#clientLogin strong { padding-left: 0 !important; }

/* ---------------------------------------------------------------------------
 * CAPTCHA row — keep label, image, field and hint tight together on one line
 * ------------------------------------------------------------------------- */
.captchaRow td {
  line-height: normal !important;
  vertical-align: middle !important;
  padding-top: 8px;
}

.captchaRow .captcha {
  width: auto !important;
  height: auto !important;
  background: none !important;
  float: none !important;
  display: inline-block !important;
  vertical-align: middle;
  margin: 0 10px 0 0 !important;
}

.captchaRow .captcha img {
  display: block;
  border-radius: 6px;
  vertical-align: middle;
}

.captchaRow #captcha,
.captchaRow input[type=text] {
  display: inline-block !important;
  float: none !important;
  width: 96px !important;
  vertical-align: middle;
  margin: 0 10px 0 0 !important;
  position: static !important;
  top: auto !important;
}

.captchaRow em {
  display: inline-block;
  vertical-align: middle;
  color: #777;
  font-style: italic;
}

/* ---------------------------------------------------------------------------
 * Landing page (main content + right sidebar with the primary CTAs)
 * ------------------------------------------------------------------------- */
.main-content { width: auto !important; }

.search-form .search,
.searchbar .search {
  width: 100% !important;
  max-width: 440px;
  box-sizing: border-box;
  border: 1px solid var(--it-grey-light) !important;
  border-radius: var(--it-radius-sm) !important;
  box-shadow: none !important;
  padding: 10px 14px !important;
}

.sidebar { width: 240px !important; }

.sidebar .content {
  border: 1px solid var(--it-border) !important;
  background: #fafbfb !important;
  border-radius: var(--it-radius) !important;
  padding: 16px !important;
}

.front-page-button .button {
  width: 100% !important;
  box-sizing: border-box;
  margin-bottom: 10px !important;
}

/* Featured KB cards on the landing page */
.featured-category {
  padding: 16px;
  border: 1px solid var(--it-border);
  border-radius: var(--it-radius);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.featured-category:hover {
  border-color: var(--it-orange);
  box-shadow: var(--it-shadow);
}
.featured-category i { color: var(--it-orange) !important; text-shadow: none !important; }
.article-title a { color: var(--it-black); font-weight: 600; }
.article-title a:hover { color: var(--it-orange); }

/* ---------------------------------------------------------------------------
 * Tables — tickets list & thread
 * ------------------------------------------------------------------------- */
#ticketTable {
  border: 1px solid var(--it-border) !important;
  border-radius: var(--it-radius-sm);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

#ticketTable caption {
  background: var(--it-black) !important;
  color: #fff !important;
  border: 0 !important;
  padding: 12px 14px !important;
  font-weight: 600;
  border-radius: var(--it-radius-sm) var(--it-radius-sm) 0 0;
}

#ticketTable th {
  background: #f4f5f5 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--it-border) !important;
  height: auto !important;
  padding: 11px 12px !important;
  font-weight: 600;
  color: var(--it-black);
}

#ticketTable th a { color: var(--it-black) !important; }

#ticketTable td {
  border: 0 !important;
  border-bottom: 1px solid var(--it-border) !important;
  padding: 11px 12px !important;
}

#ticketTable tr.alt td { background: #fafbfb !important; }
#ticketTable tbody tr:hover td { background: rgba(226, 99, 16, 0.05) !important; }

.Icon { color: var(--it-orange); }

#ticketThread table {
  border: 1px solid var(--it-border) !important;
  border-radius: var(--it-radius-sm);
  overflow: hidden;
}

#ticketThread .message th { background: rgba(226, 99, 16, 0.10) !important; }
#ticketThread .response th { background: #f0f1f1 !important; }
#ticketThread th { border-bottom: 1px solid var(--it-border) !important; }

.infoTable { background: #fafbfb !important; border-radius: var(--it-radius-sm); }

#reply {
  background: #fafbfb !important;
  border: 1px solid var(--it-border) !important;
  border-radius: var(--it-radius) !important;
  padding: 20px !important;
}

/* ---------------------------------------------------------------------------
 * Knowledge base / FAQ
 * ------------------------------------------------------------------------- */
#kb > li {
  background: none !important;
  border-bottom: 1px solid var(--it-border) !important;
  border-radius: 0;
  padding: 16px 10px !important;
}
#kb > li:hover { background: #fafbfb !important; }
#kb h4 a { color: var(--it-black); font-weight: 600; }
#kb h4 a:hover { color: var(--it-orange); }

#faq ol { border-top: 1px solid var(--it-border); }
#faq ol li a { border-bottom: 1px solid var(--it-border); }
#faq ol li a:hover { background-color: rgba(226, 99, 16, 0.06); }

#breadcrumbs, #breadcrumbs a { color: var(--it-grey) !important; }

/* ---------------------------------------------------------------------------
 * Alerts / notices / message bars
 * ------------------------------------------------------------------------- */
#msg_notice,
#msg_warning,
#msg_error,
.notice_bar,
.warning_bar,
.error_bar {
  height: auto !important;
  line-height: 1.5 !important;
  padding: 12px 16px !important;
  margin-bottom: 16px;
  border: 1px solid transparent !important;
  border-left-width: 4px !important;
  border-radius: var(--it-radius-sm) !important;
  background-image: none !important;
  font-weight: 500;
}

#msg_notice, .notice_bar {
  background: #eafaf1 !important;
  border-color: #1e9e5a !important;
  color: #14663a !important;
}

#msg_warning, .warning_bar {
  background: #fff6ec !important;
  border-color: var(--it-orange) !important;
  color: #8a3d05 !important;
}

#msg_error, .error_bar {
  background: #fdecec !important;
  border-color: #d33 !important;
  color: #a11 !important;
}

/* ---------------------------------------------------------------------------
 * Footer — dark brand bar with white logo
 * ------------------------------------------------------------------------- */
#footer {
  max-width: 1040px;
  margin: 0 auto 40px;
  padding: 22px 34px;
  background: var(--it-black);
  border-radius: 0 0 var(--it-radius) var(--it-radius);
  color: #cfd1d1;
  text-align: center;
  font-size: 12px;
}

#footer a { color: #fff; }
#footer a:hover { color: var(--it-orange); }

#footer .footer-logo {
  height: 26px;
  width: auto;
  margin-bottom: 10px;
  opacity: 0.95;
}

#footer p { margin: 6px 0 0; }

/* Old "powered by osTicket" badge is removed in footer.inc.php, but hide any
 * lingering instance just in case. */
#poweredBy { display: none !important; }

/* Move the footer up to sit flush under the card */
#container + #footer { margin-top: -1px; }

/* ---------------------------------------------------------------------------
 * Pagination
 * ------------------------------------------------------------------------- */
#pagination a { border-radius: 6px; color: var(--it-orange); }
#pagination a:hover { color: var(--it-orange-dark); }
#pagination .active { color: #fff; background: var(--it-orange); border-radius: 6px; }

/* ---------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  #container, #footer { margin-left: 16px; margin-right: 16px; }
}

@media (max-width: 768px) {
  #container {
    margin: 12px;
    border-radius: var(--it-radius);
  }
  #header {
    padding: 14px 18px !important;
    flex-direction: column;
    align-items: flex-start;
  }
  #header p { text-align: left; width: 100% !important; }
  #header .flush-right { text-align: left; }
  #nav { padding: 8px 14px !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #content { padding: 20px 18px 26px; }
  #footer { margin: 12px; padding: 20px 18px; }

  /* Collapse the legacy 2-column table forms into a single column */
  #ticketForm td,
  #reply td { display: block; width: 100% !important; }

  #clientLogin { max-width: 100%; }

  /* Ticket list becomes horizontally scrollable rather than squished */
  #ticketTable { display: block; overflow-x: auto; white-space: nowrap; }

  /* Landing page: stack the sidebar under the main content */
  .sidebar {
    float: none !important;
    width: auto !important;
    margin: 20px 0 0 !important;
  }
  .main-content { width: auto !important; }
  .featured-category { width: 100% !important; margin-left: 0 !important; }
}

@media (max-width: 480px) {
  #content h1 { font-size: 22px; }
  #header #logo img { height: 34px; }
  .button,
  input[type=submit],
  input[type=button],
  input[type=reset] { width: 100% !important; margin: 4px 0 !important; }
}
