/*
 * CU brand overlay for the osTicket customer portal.
 * Source of truth: CU Design Kit v0.2 (tokens, visual system, typography). Loaded AFTER osTicket's own
 * theme.css, so it only overrides. Re-applied after osTicket upgrades by branding/Apply-CUBrand.ps1.
 *
 * Choices the kit does not cover (flagged for Comms in the hand-off notes):
 *   - secondary button style on white (outline), form-field radius, h3 size, nav pill radius.
 * Poppins weights used: 400, 500, 700 only (Light 300 is not installed; body uses Regular).
 */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/poppins-latin-700-normal.woff2") format("woff2"); }

:root {
  --cu-blue: #085eaa;
  --cu-navy: #092e6e;
  --cu-accent: #008fd2;
  --cu-gray: #888b8d;
  --cu-yellow: #ffcf41;
  --cu-tint: #ebf2f8;
  --cu-hairline: #cedfee;
  --cu-font: "Poppins", "Roboto", "Open Sans", sans-serif;
  --cu-max: 1040px;
  --cu-gutter: max(24px, calc((100% - var(--cu-max)) / 2));
}

/* ---- canvas and type ------------------------------------------------------------------------- */
html { font-size: 100%; }
body {
  background: #fff;
  color: #000;
  font-family: var(--cu-font);
  font-size: 16px;
  line-height: 1.5;
}
body, input, select, textarea, button { font-family: var(--cu-font); color: #000; }
#container { width: auto; max-width: none; margin: 0; background: #fff; box-shadow: none; }

h1, h2, h3, h4, h5, h6 { color: var(--cu-blue); font-weight: 700; font-family: var(--cu-font); }
h1 { font-size: 36px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; }
h2, .subject { font-size: 24px; line-height: 1.25; letter-spacing: -0.015em; color: var(--cu-blue); }
h3 { font-size: 18px; line-height: 1.3; }
strong, b, label.required, span.required { font-weight: 700; }

a, .link { color: var(--cu-blue); text-decoration: underline; text-underline-offset: 2px; border-bottom: 0; margin: 0; }
a:hover, .link:hover { color: var(--cu-navy); border-bottom: 0; margin: 0; }
a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 3px solid var(--cu-accent); outline-offset: 2px; }

/* ---- header band (flat #085EAA, white logo) -------------------------------------------------- */
#header {
  height: auto; min-height: 96px; padding: 20px var(--cu-gutter) 8px;
  background: var(--cu-blue); display: flex; flex-direction: row-reverse; align-items: center;
  justify-content: space-between; gap: 24px;
}
#header .pull-right, #header .flush-right { float: none; text-align: right; }
#header p { width: auto; margin: 0; padding: 0; font-size: 14px; color: #fff; }
#header p a, #header a { color: #fff; text-decoration: underline; }
#logo { height: auto; float: none; display: block; text-decoration: none; }
#header #logo img { max-height: 44px; max-width: min(440px, 70vw); width: auto; height: auto; vertical-align: middle; }
#header .valign-helper { display: none; }

#nav {
  margin: 0; padding: 0 var(--cu-gutter) 20px; height: auto; background: var(--cu-blue);
  border: 0; box-shadow: none; display: flex; flex-wrap: wrap; gap: 8px; white-space: normal;
}
#nav li { display: block; margin: 0; padding: 0; }
#nav li a, #nav li a.home, #nav li a.new, #nav li a.status, #nav li a.kb, #nav li a.tickets {
  background-image: none; background-color: transparent; display: inline-block; height: auto; width: auto;
  margin: 0; padding: 8px 16px; line-height: 1.4; border-radius: 12px; border: 0;
  color: #fff; font-weight: 500; font-size: 15px; text-decoration: none; text-align: center;
}
#nav li a:hover { background-color: rgba(255, 255, 255, 0.14); color: #fff; }
#nav li a.active, #nav li a.active:hover { background-color: #fff; color: var(--cu-blue); }

/* ---- content --------------------------------------------------------------------------------- */
#content { max-width: var(--cu-max); margin: 0 auto; padding: 48px 24px; height: auto !important; min-height: 320px; box-sizing: border-box; }
.main-content { width: auto; max-width: 640px; }
#landing_page .sidebar { margin-left: 32px; }
.thread-body, .thread-body p, .thread-body li, .thread-body td { font-family: var(--cu-font); font-size: 16px; line-height: 1.5; color: #000; }
.thread-body h1, .thread-body h2, .thread-body h3, .thread-body h4 { font-family: var(--cu-font); color: var(--cu-blue); font-weight: 700; }
.thread-body h1 { font-size: 36px; line-height: 1.15; letter-spacing: -0.02em; }
.thread-body h2 { font-size: 24px; line-height: 1.25; }
.thread-body h3 { font-size: 18px; }
#header + .clear, #header ~ .clear:first-of-type { display: none; }
#header { border: 0; }
#nav { border-top: 0; }

/* ---- buttons --------------------------------------------------------------------------------- */
.button, .button:visited, .blue.button, .blue.button:visited,
input[type="submit"], input[type="button"], input[type="reset"], button.button, button[type="submit"] {
  background: var(--cu-blue); color: #fff; border: 0; border-radius: 12px; padding: 12px 20px;
  font: 500 15px/1.5 var(--cu-font); text-shadow: none; box-shadow: none; max-width: none; text-decoration: none;
  border-bottom: 0; cursor: pointer;
}
.button:hover, .blue.button:hover, input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover,
button.button:hover, button[type="submit"]:hover { background: var(--cu-navy); color: #fff; border-bottom: 0; }
.button:active { top: 0; }
/* osTicket styles inputs inside #ticketForm/#clientLogin with higher specificity (white box); keep submit buttons blue */
#ticketForm div input[type="submit"], #clientLogin div input[type="submit"], #clientLogin input[type="submit"], form input[type="submit"] {
  background: var(--cu-blue) !important; color: #fff !important; border: 0 !important; border-radius: 12px; padding: 12px 20px;
  width: auto; display: inline-block; font: 500 15px/1.5 var(--cu-font);
}
#ticketForm div input[type="submit"]:hover, #clientLogin div input[type="submit"]:hover, form input[type="submit"]:hover {
  background: var(--cu-navy) !important; }
#ticketForm div input[type="reset"], #ticketForm div input[type="button"], #clientLogin div input[type="button"], #clientLogin div input[type="reset"] {
  background: #fff !important; color: var(--cu-blue) !important; border: 2px solid var(--cu-blue) !important; border-radius: 12px; padding: 10px 18px;
  display: inline-block; width: auto; font: 500 15px/1.5 var(--cu-font);
}
/* secondary (outline) on white: "Check Ticket Status", Reset, Cancel */
.green.button, .green.button:visited, input[type="reset"], input[type="button"], .button.cancel, button[name="cancel"] {
  background: #fff; color: var(--cu-blue); border: 2px solid var(--cu-blue); padding: 10px 18px;
}
.green.button:hover, input[type="reset"]:hover, input[type="button"]:hover, .button.cancel:hover, button[name="cancel"]:hover {
  background: var(--cu-tint); color: var(--cu-navy); border-color: var(--cu-navy);
}
.front-page-button .button { display: block; text-align: center; }

/* ---- forms: soft panel, visible field borders (3:1 or better against white) ----------------- */
#ticketForm, #clientLogin, #clientLogin + *, form#ticketForm {
  background: var(--cu-tint); border-radius: 32px; padding: 32px; box-sizing: border-box;
}
#ticketForm table, #clientLogin table { width: 100%; }
#ticketForm .form-header, #ticketForm h3 { color: var(--cu-blue); }
#ticketForm hr { border: 0; border-top: 1px solid var(--cu-hairline); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"],
input[type="date"], input[type="search"], textarea, select {
  border: 1px solid var(--cu-gray); border-radius: 12px; background: #fff; padding: 10px 12px;
  font-size: 16px; line-height: 1.4; box-sizing: border-box; color: #000;
}
#ticketForm div input, #clientLogin div input, #ticketForm div textarea, #clientLogin div textarea { border: 1px solid var(--cu-gray); }
select { padding-right: 28px; }
input, select, textarea { max-width: 100%; }
#ticketForm label, #clientLogin label { max-width: 100%; }
.redactor-box, .redactor-editor { border-radius: 12px; }
span.error, .error, label.required .error, .error-message { color: #a00; }
#msg_notice, .notice { background: var(--cu-tint); border: 1px solid var(--cu-hairline); border-radius: 12px; color: #000; }

/* ---- tables and hairline rows ---------------------------------------------------------------- */
table.list, table#ticketTable, .list { border: 0; border-collapse: collapse; width: 100%; }
table.list thead th, table#ticketTable thead th { background: var(--cu-tint); color: var(--cu-blue); font-weight: 700; border: 0; }
table.list td, table.list th, table#ticketTable td, table#ticketTable th { border-bottom: 1px solid var(--cu-hairline); padding: 12px 8px; }

/* ---- footer band ----------------------------------------------------------------------------- */
#footer {
  background: var(--cu-blue); color: #fff; margin-top: 48px; padding: 32px var(--cu-gutter);
  text-align: center; font-size: 14px; line-height: 1.5;
}
#footer p { margin: 0 0 8px; color: #fff; }
#footer a { color: #fff; }
#footer .cu-eoe { max-width: 760px; margin: 12px auto 16px; font-size: 13px; color: #fff; }
#footer #poweredBy {
  display: block; box-sizing: content-box; width: 126px; height: 23px; margin: 12px auto 0; padding: 6px 14px;
  background-color: #fff; background-position: center; background-repeat: no-repeat; background-size: auto 20px;
  border-radius: 12px; text-indent: -9999px; overflow: hidden;
}

/* ---- small screens --------------------------------------------------------------------------- */
@media (max-width: 720px) {
  #header { flex-direction: column; align-items: flex-start; gap: 12px; }
  #header .pull-right, #header .flush-right { text-align: left; }
  #landing_page .sidebar, .sidebar.pull-right { float: none; margin: 0 0 24px; width: auto; }
  #ticketForm, #clientLogin { padding: 20px; border-radius: 16px; }
  #ticketForm td, #ticketForm th, #clientLogin td, #clientLogin th { display: block; width: auto; }
  #clientLogin .instructions, #clientLogin > div { float: none; width: auto; border: 0; }
  h1 { font-size: 28px; }
}
