@import url("../../../stylesheets/application.css");

:root {
  --je-ink: #18221f;
  --je-muted: #5f6d68;
  --je-green: #17634f;
  --je-green-dark: #123f35;
  --je-blue: #304d77;
  --je-gold: #b7995d;
  --je-paper: #fffdf8;
  --je-line: #dbe2de;
}

/* Keep Redmine's native layout and only apply the Junqi palette. */
#top-menu {
  background: #173f35;
}

#header {
  background: #2d6b59;
}

#header h1,
#header a,
#main-menu li a {
  color: #fff;
}

a,
a:link,
a:visited {
  color: #17634f;
}

a:hover,
a:active {
  color: #0f4d3c;
}

#main-menu li a:hover {
  background: #245c4d;
}

#main-menu li a.selected,
#main-menu li a.selected:hover {
  color: #174c3e;
  background: #fff;
}

input[type="submit"],
button,
.button {
  border-color: #a9bbb4;
}

/* Public homepage only. */
body.jq-enterprise-home {
  background: #f1f5f2;
  color: var(--je-ink);
  overflow-y: auto;
}

body.jq-enterprise-home #header {
  min-height: 74px;
  background: #245c4d;
}

body.jq-enterprise-home #header h1 {
  font-size: 24px;
  letter-spacing: 0;
}

body.jq-enterprise-home #quick-search,
body.jq-enterprise-home #sidebar,
body.jq-enterprise-home #footer {
  display: none;
}

body.jq-enterprise-home #main,
body.jq-enterprise-home #content {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.jq-enterprise-home #main {
  display: block;
  padding: 18px 24px 28px;
}

body.jq-enterprise-home #content {
  padding: 0;
}

.je-home {
  width: min(1260px, calc(100vw - 48px));
  margin: 0 auto;
  overflow: hidden;
  background: rgba(255, 253, 248, .97);
  border: 1px solid var(--je-line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(24, 34, 31, .10);
}

.je-hero {
  display: grid;
  grid-template-columns: minmax(340px, .86fr) minmax(520px, 1.14fr);
  gap: 44px;
  align-items: center;
  padding: 34px 44px 24px;
}

.je-intro,
.je-capabilities {
  min-width: 0;
}

.je-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.je-logo-mark {
  flex: 0 0 116px;
  width: 116px;
  height: 78px;
  overflow: hidden;
  background: #fffaf0;
  border: 1px solid #d7dcd8;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(24, 34, 31, .08);
}

.je-logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.je-brand-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  color: #66736e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.je-brand-name strong {
  color: var(--je-ink);
  font-size: 20px;
}

.je-kicker {
  margin-bottom: 10px;
  color: var(--je-green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.je-title {
  margin: 0;
  color: var(--je-green-dark);
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.je-copy {
  max-width: 580px;
  margin: 16px 0 0;
  color: var(--je-muted);
  font-size: 16px;
  line-height: 1.75;
}

.je-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.je-button {
  display: inline-flex;
  min-height: 42px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--je-green-dark) !important;
  background: #fff;
  border: 1px solid #cbd5d0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.je-button.primary {
  color: #fff !important;
  background: var(--je-green-dark);
  border-color: var(--je-green-dark);
}

.je-panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.je-panel-heading span {
  color: var(--je-green);
  font-size: 10px;
  font-weight: 900;
}

.je-panel-heading h3 {
  margin: 2px 0 0;
  color: var(--je-ink);
  font-size: 20px;
}

.je-panel-heading small {
  color: var(--je-muted);
  font-size: 11px;
  text-align: right;
}

.je-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.je-service {
  display: grid;
  min-width: 0;
  min-height: 88px;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-content: center;
  padding: 12px 14px;
  color: var(--je-ink) !important;
  background: #fff;
  border: 1px solid var(--je-line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(24, 34, 31, .06);
  text-decoration: none;
}

.je-tag {
  grid-row: 1 / span 2;
  display: flex;
  width: 54px;
  height: 38px;
  align-items: center;
  justify-content: center;
  align-self: center;
  color: #fff;
  background: var(--je-blue);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
}

.je-service:nth-child(3n + 1) .je-tag {
  background: var(--je-green);
}

.je-service:nth-child(3n) .je-tag {
  color: #2c261d;
  background: #dbc48f;
}

.je-service strong {
  align-self: end;
  color: var(--je-green-dark);
  font-size: 15px;
}

.je-service small {
  align-self: start;
  margin-top: 2px;
  color: var(--je-muted);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.je-statement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 0 44px 24px;
  padding: 14px 18px;
  color: #fff;
  background: var(--je-green-dark);
  border-left: 5px solid var(--je-gold);
  border-radius: 8px;
}

.je-statement strong,
.je-statement span {
  flex: 1 1 50%;
}

.je-statement span {
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  line-height: 1.55;
}

/* Customer login branding without changing Redmine's form layout. */
body.controller-account.action-login #sidebar {
  display: none;
}

body.controller-account.action-login #login-form {
  width: min(440px, calc(100vw - 32px));
  padding: 20px;
  background: var(--je-paper);
  border: 1px solid var(--je-line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(24, 34, 31, .10);
}

body.theme-Junqi.community.controller-account.action-login #header {
  background: #2d6b59;
}

body.theme-Junqi.community.controller-account.action-login #login-form input[type="submit"] {
  color: #fff;
  background: var(--je-green);
  border-color: var(--je-green);
}

body.theme-Junqi.community.controller-account.action-login #login-form input[type="submit"]:hover {
  background: #0f4d3c;
  border-color: #0f4d3c;
}

.je-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.je-login-brand img {
  display: block;
  width: 92px;
  height: 62px;
  object-fit: contain;
  background: #fffaf0;
  border: 1px solid #d7dcd8;
  border-radius: 8px;
}

.je-login-brand div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.je-login-brand span {
  color: var(--je-muted);
  font-size: 12px;
  font-weight: 800;
}

.je-login-brand strong {
  color: var(--je-green-dark);
  font-size: 24px;
  line-height: 1.25;
}

@media (max-width: 980px) {
  .je-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body.jq-enterprise-home #header {
    display: none;
  }

  body.jq-enterprise-home #main {
    padding: 12px 10px 30px;
  }

  .je-home {
    width: calc(100vw - 20px);
  }

  .je-hero {
    gap: 28px;
    padding: 22px 16px 18px;
  }

  .je-logo-mark {
    flex-basis: 96px;
    width: 96px;
    height: 66px;
  }

  .je-title {
    font-size: 29px;
  }

  .je-copy {
    font-size: 14px;
  }

  .je-actions,
  .je-panel-heading,
  .je-statement {
    align-items: stretch;
    flex-direction: column;
  }

  .je-button {
    width: 100%;
  }

  .je-panel-heading small {
    text-align: left;
  }

  .je-services {
    grid-template-columns: 1fr;
  }

  .je-statement {
    margin: 0 16px 18px;
    gap: 8px;
  }
}
