﻿:root {
  --ct-primary: #4bab4a;
  --ct-primary-strong: #2d8a34;
  --ct-accent: #82cf6a;
}

body.client-theme {
  background:
    radial-gradient(circle at top left, rgba(75, 171, 74, 0.14), transparent 26%),
    linear-gradient(180deg, var(--ct-bg-top) 0%, var(--ct-bg-bottom) 100%);
}

body.client-theme input[type="text"]:focus,
body.client-theme input[type="password"]:focus,
body.client-theme input[type="email"]:focus,
body.client-theme input[type="number"]:focus,
body.client-theme select:focus,
body.client-theme textarea:focus {
  box-shadow: 0 0 0 4px rgba(75, 171, 74, 0.14);
}

body.client-theme .button,
body.client-theme .blue.button,
body.client-theme .green.button,
body.client-theme .client-cta {
  background: var(--ct-primary);
  border: 0;
  border-radius: 12px;
  box-shadow: none;
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  max-width: none;
  padding: 10px 16px;
  text-shadow: none;
}

body.client-theme .client-cta--secondary {
  background: #8fbd16;
}

body.client-theme .button:hover,
body.client-theme .blue.button:hover,
body.client-theme .green.button:hover,
body.client-theme .client-cta:hover {
  background: var(--ct-primary-strong);
}

body.client-theme .client-page-title {
  font-size: 2rem;
  line-height: 1.12;
  margin-bottom: 8px;
}

body.client-theme .client-page-lead {
  color: var(--ct-text-soft);
  margin-bottom: 20px;
}

body.client-theme .form-header {
  color: var(--ct-primary-strong);
  margin-bottom: 10px;
}

body.client-theme .form-header h3 {
  margin-bottom: 6px;
}

body.client-theme .ticket-field-label {
  color: var(--ct-text);
  display: block;
  font-weight: 700;
}

body.client-theme .ticket-field em,
body.client-theme .ticket-form-section em {
  color: var(--ct-text-soft) !important;
  line-height: 1.45;
}

body.client-theme .client-open-ticket {
  margin-top: 20px;
}

body.client-theme .client-open-form {
  border-collapse: separate;
  border-spacing: 0;
}

body.client-theme .client-open-form > tbody {
  background: linear-gradient(180deg, #ffffff 0%, #f9fcfb 100%);
}

body.client-theme .ticket-form-section td {
  padding-top: 10px;
}

body.client-theme .ticket-field td {
  padding-bottom: 12px;
}

body.client-theme #ticketForm input[type="text"],
body.client-theme #ticketForm input[type="email"],
body.client-theme #ticketForm input[type="tel"],
body.client-theme #ticketForm input[type="password"],
body.client-theme #ticketForm select {
  min-height: 44px;
  width: min(100%, 560px);
}

body.client-theme #ticketForm .ticket-field--subject input[type="text"],
body.client-theme #ticketForm input[name="subject"] {
  font-size: 1rem;
  font-weight: 600;
  width: min(100%, 760px);
}

body.client-theme #ticketForm textarea,
body.client-theme #ticketForm .redactor-box,
body.client-theme #ticketForm .redactor-layer,
body.client-theme #ticketForm .redactor-styles,
body.client-theme #ticketForm .redactor-toolbar {
  max-width: none !important;
  width: 100% !important;
}

body.client-theme #ticketForm textarea {
  min-height: 260px;
}

body.client-theme #ticketForm .redactor-box {
  border: 1px solid var(--ct-border-strong);
  border-radius: var(--ct-radius-md);
  overflow: hidden;
}

body.client-theme #ticketForm .redactor-toolbar {
  background: #f4fbf2;
  border-bottom: 1px solid var(--ct-border);
}

body.client-theme #ticketForm .redactor-layer {
  min-height: 240px !important;
}

body.client-theme #ticketForm .attachments,
body.client-theme #reply .attachments {
  background: var(--ct-surface-soft);
  border: 1px dashed var(--ct-border-strong);
  border-radius: var(--ct-radius-md);
  margin-top: 12px;
  padding: 12px;
}

body.client-theme .ticket-form-actions {
  margin-top: 22px;
}

body.client-theme #landing_page {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 280px;
  gap: 26px;
}

body.client-theme #landing_page .main-content {
  min-width: 0;
}

body.client-theme #landing_page .search-form {
  margin-bottom: 20px;
}

body.client-theme #landing_page .search-form form {
  align-items: center;
  display: flex;
  gap: 12px;
}

body.client-theme #landing_page .search-form .search {
  flex: 1 1 auto;
  min-width: 0;
}

body.client-theme #landing_page .thread-body {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius-lg);
  box-shadow: var(--ct-shadow-md);
  padding: 22px 24px;
}

body.client-theme .sidebar {
  padding: 18px;
}

body.client-theme #landing_page .sidebar {
  position: sticky;
  top: 18px;
}

body.client-theme .sidebar .front-page-button p {
  margin: 0 0 10px;
}

body.client-theme #nav {
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
}

body.client-theme #nav li {
  flex: 0 0 auto;
}

body.client-theme #nav li a {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 40px;
  padding: 10px 18px 10px 38px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  body.client-theme #landing_page {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  body.client-theme #landing_page .search-form form {
    display: block;
  }

  body.client-theme #landing_page .search-form .search,
  body.client-theme #landing_page .search-form .button {
    margin-bottom: 10px;
    width: 100%;
  }

  body.client-theme #landing_page .sidebar {
    position: static;
    width: 100%;
    max-width: none;
  }

  body.client-theme #landing_page > .main-content {
    order: 1;
    width: 100%;
  }

  body.client-theme #landing_page > .sidebar {
    order: 2;
    width: 100%;
  }

  body.client-theme #landing_page .thread-body {
    padding: 18px;
  }

  body.client-theme #landing_page .sidebar .content,
  body.client-theme #landing_page .sidebar .front-page-button {
    width: 100%;
  }

  body.client-theme #ticketForm input[type="text"],
  body.client-theme #ticketForm input[type="email"],
  body.client-theme #ticketForm input[type="tel"],
  body.client-theme #ticketForm input[type="password"],
  body.client-theme #ticketForm select,
  body.client-theme #ticketForm .ticket-field--subject input[type="text"],
  body.client-theme #ticketForm input[name="subject"] {
    width: 100%;
  }
}

/* Layout fix for legacy landing/sidebar markup */
body.client-theme #landing_page {
  align-items: start;
}

body.client-theme #landing_page > .sidebar {
  float: none !important;
  grid-column: 2;
  margin: 0;
  width: auto;
}

body.client-theme #landing_page > .main-content {
  grid-column: 1;
  width: auto;
}

body.client-theme #landing_page .sidebar .content,
body.client-theme #landing_page .sidebar .front-page-button {
  margin: 0;
}

body.client-theme #landing_page .search-form .search {
  width: 100%;
}

body.client-theme .row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

body.client-theme .row > .span8 {
  flex: 1 1 620px;
  margin: 0;
  min-width: 0;
  width: auto;
}

body.client-theme .row > .span4 {
  flex: 0 0 280px;
  margin: 0;
  width: auto;
}

body.client-theme .row > .span4 .sidebar {
  margin: 0;
  width: auto;
}

@media (max-width: 760px) {
  body.client-theme #landing_page > .sidebar,
  body.client-theme #landing_page > .main-content {
    grid-column: auto;
  }

  body.client-theme .row {
    display: block;
  }

  body.client-theme .row > .span8,
  body.client-theme .row > .span4 {
    width: 100%;
  }
}


@media (max-width: 760px) {
  body.client-theme .sidebar.pull-right,
  body.client-theme .span4.pull-right,
  body.client-theme .pull-right {
    float: none !important;
  }

  body.client-theme .row {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  body.client-theme .row > .span8,
  body.client-theme .row > .span4,
  body.client-theme .row > .span4.pull-right {
    flex: 1 1 100%;
    order: initial;
    width: 100% !important;
    max-width: none;
  }

  body.client-theme .row > .span8 {
    order: 1;
  }

  body.client-theme .row > .span4,
  body.client-theme .row > .span4.pull-right {
    order: 2;
  }

  body.client-theme .row > .span4 .sidebar,
  body.client-theme .row > .span4.pull-right .sidebar,
  body.client-theme .row > .span8 .sidebar {
    margin: 0;
    width: 100%;
    max-width: none;
  }
}

/* Home aligned to the same two-column pattern used by KB pages */
body.client-theme #landing_page.row {
  align-items: flex-start;
  margin-bottom: 24px;
}

body.client-theme #landing_page.row > .span8 {
  flex: 1 1 620px;
  min-width: 0;
}

body.client-theme #landing_page.row > .span4 {
  flex: 0 0 280px;
}

body.client-theme #landing_page .sidebar.pull-right {
  float: none !important;
  position: sticky;
  top: 18px;
}

@media (max-width: 980px) {
  body.client-theme #landing_page.row {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  body.client-theme #landing_page.row > .span8,
  body.client-theme #landing_page.row > .span4,
  body.client-theme #landing_page.row > .span4.pull-right {
    flex: 1 1 100%;
    width: 100% !important;
  }

  body.client-theme #landing_page.row > .span8 {
    order: 1;
  }

  body.client-theme #landing_page.row > .span4,
  body.client-theme #landing_page.row > .span4.pull-right {
    order: 2;
  }

  body.client-theme #landing_page.row > .span4 .sidebar {
    max-width: none;
    position: static;
    width: 100%;
  }
}


/* Phone field normalization and Sark footer */
body.client-theme input[type="tel"]:focus {
  box-shadow: 0 0 0 4px rgba(75, 171, 74, 0.14);
}

body.client-theme #ticketForm input[type="tel"],
body.client-theme #ticketForm input[name$="-ext"] {
  appearance: none;
  background: #fff;
  border: 1px solid var(--ct-border-strong) !important;
  border-radius: var(--ct-radius-md);
  box-sizing: border-box;
  color: var(--ct-text);
  min-height: 44px;
  padding: 10px 12px;
}

body.client-theme #ticketForm input[type="tel"] {
  width: min(100%, 340px);
}

body.client-theme #ticketForm input[name$="-ext"] {
  margin-left: 8px;
  width: 96px;
}

body.client-theme #footer {
  background: linear-gradient(180deg, #214625 0%, #18361e 100%);
  border-top: 4px solid var(--ct-primary);
  color: #edf7ea;
}

body.client-theme #footer a {
  color: #9fe29d;
}

body.client-theme #footer a:hover {
  color: #ffffff;
}

@media (max-width: 760px) {
  body.client-theme #ticketForm input[type="tel"],
  body.client-theme #ticketForm input[name$="-ext"] {
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
  }
}

/* Final polish for phone/extension field */
body.client-theme #ticketForm input[type="tel"]:focus,
body.client-theme #ticketForm input[name$="-ext"]:focus {
  border-color: var(--ct-primary) !important;
  box-shadow: 0 0 0 4px rgba(75, 171, 74, 0.14);
  outline: 0;
}

body.client-theme #ticketForm input[type="tel"] {
  width: min(100%, 420px);
}

body.client-theme #ticketForm input[name$="-ext"] {
  width: 82px;
}

/* Ticket status lookup layout */
body.client-theme #clientLogin.client-ticket-lookup {
  max-width: 880px;
}

body.client-theme #clientLogin.client-ticket-lookup .client-ticket-lookup-grid {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
}

body.client-theme #clientLogin.client-ticket-lookup .login-box,
body.client-theme #clientLogin.client-ticket-lookup .client-ticket-lookup-help {
  min-width: 0;
}

body.client-theme #clientLogin.client-ticket-lookup label {
  color: var(--ct-text);
  display: block;
  font-weight: 700;
  margin-bottom: 14px;
}

body.client-theme #clientLogin.client-ticket-lookup label input {
  margin-top: 6px;
}

body.client-theme #clientLogin.client-ticket-lookup .client-ticket-lookup-help {
  color: var(--ct-text-soft);
  display: block;
  line-height: 1.55;
  padding: 8px 0 0;
}

body.client-theme #clientLogin.client-ticket-lookup .client-ticket-lookup-help a {
  font-weight: 700;
}

body.client-theme #clientLogin.client-ticket-lookup p {
  clear: none;
  margin: 16px 0 0;
}

body.client-theme #clientLogin.client-ticket-lookup .client-ticket-lookup-submit,
body.client-theme #clientLogin.client-ticket-lookup input.btn[type="submit"] {
  background: var(--ct-primary);
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  color: #fff !important;
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  min-width: 190px;
  padding: 10px 18px;
  text-align: center;
  text-indent: 0;
}

@media (max-width: 900px) {
  body.client-theme #clientLogin.client-ticket-lookup .client-ticket-lookup-grid {
    grid-template-columns: 1fr;
  }

  body.client-theme #clientLogin.client-ticket-lookup .client-ticket-lookup-help {
    padding-top: 0;
  }
}

/* Ticket view refinement */
body.client-theme #ticketInfo h1 {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  line-height: 1.25;
}

body.client-theme #ticketInfo h1 b {
  flex: 1 1 420px;
}

body.client-theme #ticketInfo h1 small {
  color: var(--ct-text-soft);
  font-size: 1rem;
  padding-top: 8px;
}

body.client-theme #ticketInfo h1 .pull-right {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  float: none !important;
  gap: 10px;
  margin-left: auto;
}

body.client-theme #ticketInfo h1 .action-button {
  margin: 0;
}

body.client-theme #ticketInfo > tbody > tr:nth-child(2) > td {
  padding-right: 16px;
  vertical-align: top;
}

body.client-theme #ticketInfo > tbody > tr:nth-child(2) > td:last-child {
  padding-right: 0;
}

body.client-theme .infoTable th,
body.client-theme .custom-data th {
  color: var(--ct-primary-strong);
  font-weight: 700;
  width: 150px;
}

body.client-theme #ticketThread {
  margin-top: 10px;
}

body.client-theme #ticketThread .thread-entry {
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius-lg);
  box-shadow: var(--ct-shadow-md);
  overflow: hidden;
}

body.client-theme #ticketThread .thread-entry .header {
  padding: 14px 16px;
}

body.client-theme #ticketThread .thread-entry .thread-body {
  padding: 18px 16px;
}

body.client-theme #ticketThread .thread-entry .attachments {
  margin-top: 14px;
}

body.client-theme #reply {
  margin-top: 24px;
  padding: 20px 18px;
}

body.client-theme #reply h2 {
  margin-bottom: 10px;
}

body.client-theme #reply > div > p {
  color: var(--ct-text-soft);
  line-height: 1.55;
  margin-bottom: 12px;
}

@media (max-width: 980px) {
  body.client-theme #ticketInfo h1 .pull-right {
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }

  body.client-theme #ticketInfo > tbody > tr:nth-child(2) > td {
    display: block;
    padding-right: 0;
    width: 100% !important;
  }
}

/* Portal login layout */
body.client-theme #clientLogin.client-portal-login {
  max-width: 880px;
}

body.client-theme #clientLogin.client-portal-login .client-portal-login-grid {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.9fr);
}

body.client-theme #clientLogin.client-portal-login .login-box,
body.client-theme #clientLogin.client-portal-login .client-portal-login-help {
  min-width: 0;
}

body.client-theme #clientLogin.client-portal-login .client-portal-login-help {
  color: var(--ct-text-soft);
  line-height: 1.6;
  padding-top: 8px;
}

body.client-theme #clientLogin.client-portal-login .client-portal-login-help a {
  font-weight: 700;
}

body.client-theme #clientLogin.client-portal-login p {
  clear: none;
  margin: 16px 0 0;
}

body.client-theme #clientLogin.client-portal-login .client-portal-login-submit,
body.client-theme #clientLogin.client-portal-login input.btn[type="submit"] {
  background: var(--ct-primary);
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  color: #fff !important;
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  min-width: 150px;
  padding: 10px 18px;
  text-align: center;
  text-indent: 0;
}

@media (max-width: 900px) {
  body.client-theme #clientLogin.client-portal-login .client-portal-login-grid {
    grid-template-columns: 1fr;
  }

  body.client-theme #clientLogin.client-portal-login .client-portal-login-help {
    padding-top: 0;
  }
}

/* Account registration / profile forms */
body.client-theme .client-account-form {
  margin-top: 18px;
}

body.client-theme .client-account-table {
  border-collapse: separate;
  border-spacing: 0;
}

body.client-theme .client-account-table > tbody {
  background: linear-gradient(180deg, #ffffff 0%, #f9fcfb 100%);
}

body.client-theme .client-account-table td {
  padding: 10px 0;
  vertical-align: top;
}

body.client-theme .client-account-table > tbody > tr > td:first-child {
  color: var(--ct-text);
  font-weight: 700;
  padding-right: 18px;
  width: 180px;
}

body.client-theme .client-account-table input[type="text"],
body.client-theme .client-account-table input[type="email"],
body.client-theme .client-account-table input[type="password"],
body.client-theme .client-account-table input[type="tel"],
body.client-theme .client-account-table select {
  min-height: 44px;
}

body.client-theme .client-account-table input[type="text"],
body.client-theme .client-account-table input[type="email"],
body.client-theme .client-account-table input[type="password"] {
  width: min(100%, 340px);
}

body.client-theme .client-account-table input[type="tel"] {
  width: min(100%, 220px);
}

body.client-theme .client-account-table input[name$="-ext"] {
  width: 92px;
}

body.client-theme .client-account-table .client-account-section h3 {
  color: var(--ct-primary-strong);
  margin: 0 0 8px;
}

body.client-theme .client-account-table .select2-container {
  max-width: 100%;
  min-width: 280px;
}

body.client-theme .client-account-table .action-button {
  margin-left: 12px;
}

body.client-theme .client-account-actions {
  margin-top: 22px;
}

@media (max-width: 900px) {
  body.client-theme .client-account-table > tbody > tr > td:first-child,
  body.client-theme .client-account-table > tbody > tr > td:last-child {
    display: block;
    padding-right: 0;
    width: 100% !important;
  }

  body.client-theme .client-account-table input[type="text"],
  body.client-theme .client-account-table input[type="email"],
  body.client-theme .client-account-table input[type="password"],
  body.client-theme .client-account-table input[type="tel"],
  body.client-theme .client-account-table input[name$="-ext"],
  body.client-theme .client-account-table .select2-container {
    min-width: 0;
    width: 100% !important;
  }

  body.client-theme .client-account-table .action-button {
    display: block;
    margin: 10px 0 0;
    width: 100%;
  }
}

/* Final polish for account forms */
body.client-theme .client-account-table input[type="tel"]:focus,
body.client-theme .client-account-table input[name$="-ext"]:focus,
body.client-theme .client-account-table input[type="password"]:focus,
body.client-theme .client-account-table input[type="text"]:focus,
body.client-theme .client-account-table input[type="email"]:focus,
body.client-theme .client-account-table select:focus {
  border-color: var(--ct-primary) !important;
  box-shadow: 0 0 0 4px rgba(75, 171, 74, 0.14);
  outline: 0;
}

body.client-theme .client-account-table input[type="text"],
body.client-theme .client-account-table input[type="email"],
body.client-theme .client-account-table input[type="password"] {
  width: min(100%, 420px);
}

body.client-theme .client-account-table input[type="tel"] {
  width: min(100%, 230px);
}

/* Normalize phone/ext pair inside account forms */
body.client-theme .client-account-table input[type="tel"],
body.client-theme .client-account-table input[name$="-ext"] {
  appearance: none;
  background: #fff;
  border: 1px solid var(--ct-border-strong) !important;
  border-radius: var(--ct-radius-md);
  box-sizing: border-box;
  color: var(--ct-text);
  min-height: 44px;
  padding: 10px 12px;
}

body.client-theme .client-account-table input[type="tel"] {
  width: min(100%, 260px);
}

body.client-theme .client-account-table input[name$="-ext"] {
  margin-left: 10px;
  width: 110px;
}

@media (max-width: 900px) {
  body.client-theme .client-account-table input[name$="-ext"] {
    margin-left: 0;
    margin-top: 8px;
  }
}

/* Fix stacked labels/rows in account forms */
body.client-theme .client-account-table tr > td,
body.client-theme .client-account-table tr > th {
  height: auto !important;
}

@media (max-width: 980px) {
  body.client-theme .client-account-table tr {
    display: block;
    margin-bottom: 14px;
  }

  body.client-theme .client-account-table tr > td,
  body.client-theme .client-account-table tr > th {
    display: block;
    height: auto !important;
    padding: 0 0 8px !important;
  }

  body.client-theme .client-account-table > tbody > tr > td:first-child {
    margin-bottom: 2px;
  }

  body.client-theme .client-account-table > tbody > tr > td[colspan="2"] {
    padding-bottom: 4px !important;
  }

  body.client-theme .client-account-table .client-account-section {
    margin-top: 8px;
  }
}
