/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --cms-blue: #104a8b;
  --cms-blue-dark: #133956;
  --cms-ink: #2f3640;
  --cms-gray: #e3e3e3;
  --cms-green: #00c3a0;
  --cms-yellow: #f9f871;
  --cms-paper: #edf2f5;
  --cms-surface: #f8fafc;
  --cms-muted: #69717d;
  --cms-line: #dce3ea;
  --cms-gradient: linear-gradient(120deg, #123752 0%, #1b5e9f 48%, #009b91 100%);
  --cms-shadow: 0 22px 58px rgba(20, 46, 72, 0.16);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

.temperament-body {
  min-height: 100vh;
  background: var(--cms-paper);
  color: var(--cms-ink);
  font-family: "Plus Jakarta Sans", var(--bs-font-sans-serif);
}

.flash-region {
  position: fixed;
  z-index: 30;
  top: 1rem;
  right: 1rem;
  width: min(26rem, calc(100vw - 2rem));
}

.btn {
  --bs-btn-border-radius: 0.5rem;
  --bs-btn-font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.75rem;
}

.btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
}

.btn-primary {
  --bs-btn-bg: #1763a1;
  --bs-btn-border-color: #1763a1;
  --bs-btn-hover-bg: #124f86;
  --bs-btn-hover-border-color: #124f86;
  --bs-btn-active-bg: #104472;
  --bs-btn-active-border-color: #104472;
}

.btn-outline-primary {
  --bs-btn-color: var(--cms-blue);
  --bs-btn-border-color: rgba(16, 74, 139, 0.32);
  --bs-btn-hover-bg: var(--cms-blue);
  --bs-btn-hover-border-color: var(--cms-blue);
}

.btn-accent {
  --bs-btn-bg: var(--cms-yellow);
  --bs-btn-border-color: var(--cms-yellow);
  --bs-btn-color: var(--cms-ink);
  --bs-btn-hover-bg: #eceb5e;
  --bs-btn-hover-border-color: #eceb5e;
  --bs-btn-hover-color: var(--cms-ink);
  --bs-btn-active-bg: #dfdd52;
  --bs-btn-active-border-color: #dfdd52;
  --bs-btn-active-color: var(--cms-ink);
}

.temperament-page {
  min-height: 100vh;
}

.app-shell {
  display: flex;
  min-height: 100dvh;
  padding: 1rem 0;
  background: var(--cms-paper);
}

.app-shell > .container-xxl {
  display: flex;
  width: 100%;
  max-width: min(1760px, calc(100vw - 2rem));
}

.app-canvas {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(17.5rem, 22vw) minmax(0, 1fr);
  min-height: calc(100vh - 2rem);
  min-height: calc(100dvh - 2rem);
  border: 1px solid rgba(47, 54, 64, 0.12);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: var(--cms-shadow);
  overflow: hidden;
}

.brand-sidebar {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  gap: 1.6rem;
  padding: 1.65rem;
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--cms-gradient);
  color: #fff;
}

.brand-sidebar::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  background: var(--cms-gradient);
}

.brand-sidebar::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background-image: var(--brand-background);
  background-position: right bottom;
  background-size: auto 100%;
  opacity: 0.2;
}

.sidebar-copy {
  margin-top: clamp(1.5rem, 6vh, 4rem);
}

.sidebar-kicker,
.toolbar-kicker {
  margin: 0 0 0.75rem;
  color: var(--cms-green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-copy h1 {
  max-width: 16rem;
  margin: 0 0 1rem;
  color: #fff;
  font-size: 2.16rem;
  font-weight: 800;
  line-height: 1.06;
}

.sidebar-copy p {
  max-width: 16.5rem;
  margin: 0 0 1.45rem;
  color: rgba(255, 255, 255, 0.77);
  font-size: 0.95rem;
  line-height: 1.6;
}

.sidebar-metrics {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
}

.sidebar-metrics div,
.sidebar-metrics a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.6rem;
  padding: 0.82rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(8px);
}

.sidebar-metrics a {
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.sidebar-metrics a:hover,
.sidebar-metrics a:focus,
.sidebar-metrics a.is-active {
  border-color: rgba(249, 248, 113, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-metrics a:focus-visible {
  outline: 2px solid rgba(249, 248, 113, 0.65);
  outline-offset: 0.18rem;
}

.sidebar-metrics span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.8rem;
  font-weight: 800;
}

.sidebar-metrics strong {
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.product-footer {
  display: grid;
  gap: 0.12rem;
  margin: 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.45;
}

.product-footer span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.68rem;
}

.product-footer a {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: max-content;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.product-footer a::after {
  position: absolute;
  right: 0;
  bottom: -0.12rem;
  left: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--cms-yellow), var(--cms-green));
  opacity: 0;
  transform: scaleX(1);
  transform-origin: right;
  transition: opacity 160ms ease;
}

.product-footer a:hover,
.product-footer a:focus {
  color: var(--cms-yellow);
}

.product-footer a:hover::after,
.product-footer a:focus::after {
  opacity: 1;
}

.product-footer a:focus-visible {
  outline: 2px solid rgba(0, 195, 160, 0.55);
  outline-offset: 0.22rem;
}

.app-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--cms-surface);
}

.content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5.4rem;
  padding: 1.15rem 1.45rem;
  border-bottom: 1px solid rgba(47, 54, 64, 0.09);
  background: #fff;
}

.content-toolbar h2 {
  margin: 0 0 0.25rem;
  color: var(--cms-ink);
  font-size: 1.18rem;
  font-weight: 800;
}

.content-toolbar p:not(.toolbar-kicker) {
  margin: 0;
  color: var(--cms-muted);
  font-size: 0.88rem;
}

.content-body {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 19.5rem);
  gap: 1rem;
  min-height: 0;
  padding: 1.2rem;
}

.test-panel,
.result-panel,
.support-panel,
.contact-panel,
.temperaments-panel {
  border: 1px solid rgba(47, 54, 64, 0.09);
  border-radius: 0.5rem;
  background: #fff;
}

.test-panel,
.result-panel,
.temperaments-panel {
  min-width: 0;
  overflow: hidden;
}

.progress-badge,
.point-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: rgba(0, 195, 160, 0.12);
  color: #087e6d;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.question-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.question-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  margin: 0;
}

.question-list {
  display: grid;
  gap: 0.75rem;
  min-height: 0;
  padding: 0.95rem;
}

.question-row,
.result-rank {
  border: 1px solid rgba(47, 54, 64, 0.08);
  border-radius: 0.5rem;
  background: #fff;
}

.question-row {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  min-height: 5.35rem;
  padding: 0.95rem;
}

.question-number,
.rank-position {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border-radius: 0.5rem;
  font-weight: 800;
}

.question-number {
  background: rgba(16, 74, 139, 0.08);
  color: var(--cms-blue);
  font-size: 0.88rem;
}

.question-text label {
  margin: 0;
  color: var(--cms-ink);
  font-size: 0.95rem;
  line-height: 1.45;
  cursor: pointer;
}

.question-switch {
  display: flex;
  justify-content: flex-end;
  min-height: 2.25rem;
  padding-left: 0;
}

.question-switch .form-check-input {
  width: 3.35rem;
  height: 1.85rem;
  margin: 0;
  border-color: rgba(47, 54, 64, 0.22);
  cursor: pointer;
}

.question-switch .form-check-input:checked {
  border-color: var(--cms-green);
  background-color: var(--cms-green);
}

.question-switch .form-check-input:focus {
  border-color: var(--cms-green);
  box-shadow: 0 0 0 0.2rem rgba(0, 195, 160, 0.18);
}

.submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-top: 1px solid rgba(47, 54, 64, 0.08);
  background: #fff;
}

.submit-bar strong {
  display: block;
  color: var(--cms-ink);
  font-size: 0.92rem;
}

.submit-bar p {
  margin: 0.1rem 0 0;
  color: var(--cms-muted);
  font-size: 0.82rem;
}

.support-stack {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.support-panel,
.contact-panel {
  --panel-accent: var(--cms-green);
  --panel-accent-secondary: var(--cms-blue);
  --panel-kicker: #087e6d;
  position: relative;
  padding: 1.15rem 1.1rem 1.18rem;
  border-color: rgba(47, 54, 64, 0.07);
  border-top: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94)),
    linear-gradient(135deg, rgba(0, 195, 160, 0.11), rgba(16, 74, 139, 0.08));
  box-shadow: 0 14px 32px rgba(19, 57, 86, 0.08);
  overflow: hidden;
}

.support-panel::before,
.contact-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 0.28rem;
  content: "";
  background: linear-gradient(90deg, var(--panel-accent), var(--panel-accent-secondary));
}

.support-panel::after,
.contact-panel::after {
  position: absolute;
  top: 0.28rem;
  right: 0;
  width: 4.9rem;
  height: 4.9rem;
  content: "";
  background: var(--panel-accent);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  opacity: 0.07;
  pointer-events: none;
}

.guidance-panel {
  --panel-accent: var(--cms-green);
  --panel-accent-secondary: #79dfd1;
}

.result-note-panel {
  --panel-accent: var(--cms-yellow);
  --panel-accent-secondary: var(--cms-green);
  --panel-kicker: #8b7d00;
}

.author-panel {
  --panel-accent: #1763a1;
  --panel-accent-secondary: var(--cms-green);
  --panel-kicker: #1763a1;
}

.professional-panel {
  --panel-accent: var(--cms-green);
  --panel-accent-secondary: var(--cms-yellow);
}

.support-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  margin-bottom: 0.42rem;
  color: var(--panel-kicker);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.support-eyebrow::before {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  content: "";
  background: var(--panel-accent);
  box-shadow: 0 0 0 0.22rem rgba(0, 195, 160, 0.11);
}

.support-panel h3,
.contact-panel h2 {
  margin: 0 0 0.58rem;
  color: var(--cms-ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.18;
}

.support-panel p,
.contact-panel p {
  margin: 0;
  color: var(--cms-muted);
  font-size: 0.86rem;
  line-height: 1.58;
}

.author-panel strong {
  color: #1763a1;
  font-weight: 800;
}

.reference-sources {
  margin-top: 0.22rem;
  padding-top: 0.82rem;
  border-top: 1px solid rgba(47, 54, 64, 0.08);
}

.reference-sources span {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--cms-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reference-sources ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reference-sources a {
  display: inline-flex;
  color: var(--cms-blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.reference-sources a:hover,
.reference-sources a:focus {
  color: #124f86;
  text-decoration: none;
}

.temperament-content-body {
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 19.5rem);
}

.temperaments-panel {
  padding: 1rem;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.97)),
    linear-gradient(135deg, rgba(0, 195, 160, 0.09), rgba(249, 248, 113, 0.1));
}

.temperaments-intro {
  display: grid;
  gap: 0.75rem;
  padding: 1.2rem;
  border-left: 4px solid var(--cms-green);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 12px 30px rgba(19, 57, 86, 0.07);
}

.temperaments-intro p {
  margin: 0;
  color: var(--cms-muted);
  font-size: 0.94rem;
  line-height: 1.62;
}

.temperament-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.95rem;
}

.temperament-detail-card {
  display: grid;
  grid-template-columns: 2.65rem minmax(0, 1fr);
  gap: 0.82rem;
  min-height: 10rem;
  padding: 1rem;
  border: 1px solid rgba(47, 54, 64, 0.08);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 10px 26px rgba(19, 57, 86, 0.06);
}

.temperament-detail-number {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 0.5rem;
  background: var(--cms-blue);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 900;
}

.temperament-detail-card:nth-child(2) .temperament-detail-number {
  background: var(--cms-green);
}

.temperament-detail-card:nth-child(3) .temperament-detail-number {
  background: var(--cms-yellow);
  color: var(--cms-ink);
}

.temperament-detail-card:nth-child(4) .temperament-detail-number {
  background: var(--cms-ink);
}

.temperament-detail-card h3 {
  margin: 0 0 0.42rem;
  color: var(--cms-ink);
  font-size: 1.08rem;
  font-weight: 900;
}

.temperament-detail-card p {
  margin: 0;
  color: var(--cms-muted);
  font-size: 0.9rem;
  line-height: 1.58;
}

.page-reference-sources {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(47, 54, 64, 0.08);
  border-radius: 0.5rem;
  background: #fff;
}

.result-ranking {
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem;
}

.result-rank {
  display: grid;
  grid-template-columns: 2.45rem minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: start;
  padding: 1rem;
}

.rank-position {
  background: var(--cms-yellow);
  color: var(--cms-ink);
}

.result-rank:nth-child(2) .rank-position {
  background: var(--cms-green);
  color: #fff;
}

.result-rank:nth-child(3) .rank-position {
  background: var(--cms-gray);
}

.result-rank:nth-child(4) .rank-position {
  background: var(--cms-ink);
  color: #fff;
}

.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
  font-weight: 800;
}

.result-heading span {
  color: var(--cms-blue);
  font-size: 1.12rem;
}

.result-track {
  height: 0.55rem;
  margin-bottom: 0.7rem;
  border-radius: 999px;
  background: rgba(47, 54, 64, 0.12);
  overflow: hidden;
}

.result-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cms-blue);
}

.result-rank:nth-child(2) .result-track span {
  background: var(--cms-green);
}

.result-rank:nth-child(3) .result-track span {
  background: var(--cms-yellow);
}

.result-rank:nth-child(4) .result-track span {
  background: var(--cms-ink);
}

.result-main p {
  margin: 0;
  color: var(--cms-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.point-badge {
  background: rgba(16, 74, 139, 0.08);
  color: var(--cms-blue);
}

.mixed-alert {
  padding: 0.9rem;
  border: 1px solid rgba(249, 248, 113, 0.42);
  border-radius: 0.5rem;
  background: rgba(249, 248, 113, 0.2);
  color: #fff8b8;
  font-size: 0.88rem;
  line-height: 1.5;
}

.contact-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

.contact-list div {
  padding: 0.74rem 0 0.74rem 0.82rem;
  border-left: 3px solid rgba(0, 195, 160, 0.72);
  background: rgba(16, 74, 139, 0.045);
}

.contact-list span,
.contact-list strong {
  display: block;
}

.contact-list span {
  color: var(--cms-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-list strong {
  color: var(--cms-ink);
  font-size: 0.92rem;
}

@media (min-width: 992px) {
  html,
  body.temperament-body {
    height: 100%;
    overflow: hidden;
  }

  .temperament-page {
    position: fixed;
    inset: 0;
    width: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell {
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .app-shell > .container-xxl {
    height: 100%;
    min-height: 0;
    max-width: 100%;
    padding-right: 0;
    padding-left: 0;
  }

  .app-canvas {
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-content,
  .question-panel,
  .result-panel {
    min-height: 0;
  }

  .content-body {
    overflow: hidden;
  }

  .test-panel,
  .result-panel {
    height: 100%;
  }

  .result-panel {
    overflow: auto;
  }

  .support-stack {
    overflow: auto;
  }

  .question-list {
    flex: 1;
    max-height: none;
    overflow: auto;
  }

}

@media (min-width: 992px) and (max-height: 820px) {
  .brand-sidebar {
    gap: 1rem;
    padding: 1.25rem;
  }

  .sidebar-copy {
    margin-top: clamp(0.75rem, 4vh, 2rem);
  }

  .sidebar-copy h1 {
    font-size: 1.85rem;
  }

  .sidebar-copy p {
    margin-bottom: 1rem;
    font-size: 0.86rem;
    line-height: 1.52;
  }

  .sidebar-metrics {
    gap: 0.55rem;
  }

  .sidebar-metrics div {
    min-height: 3.1rem;
    padding: 0.62rem 0.75rem;
  }
}

@media (min-width: 1400px) {
  .content-body {
    grid-template-columns: minmax(0, 1fr) minmax(19rem, 22rem);
  }
}

@media (max-width: 1199.98px) {
  .content-body {
    grid-template-columns: 1fr;
  }

  .support-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .app-canvas {
    grid-template-columns: 1fr;
  }

  .brand-sidebar {
    min-height: auto;
  }

  .sidebar-copy h1,
  .sidebar-copy p {
    max-width: 34rem;
  }

  .sidebar-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0.5rem;
  }
}

@media (max-width: 767.98px) {
  .app-shell {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
  }

  .app-shell > .container-xxl {
    display: block;
    max-width: 100%;
    padding-right: 0;
    padding-left: 0;
  }

  .app-canvas {
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .brand-sidebar {
    padding: 1.25rem;
  }

  .sidebar-copy h1 {
    font-size: 2rem;
  }

  .sidebar-metrics,
  .support-stack {
    grid-template-columns: 1fr;
  }

  .temperament-detail-grid {
    grid-template-columns: 1fr;
  }

  .content-toolbar,
  .submit-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .content-toolbar {
    padding: 1rem;
  }

  .content-body {
    padding: 0.9rem;
  }

  .product-footer {
    text-align: center;
  }

  .product-footer a {
    justify-self: center;
  }

  .question-row {
    grid-template-columns: 2.75rem minmax(0, 1fr);
  }

  .question-switch {
    grid-column: 2;
    justify-content: flex-start;
  }

  .submit-bar .btn {
    width: 100%;
  }

  .result-rank {
    grid-template-columns: 2.45rem minmax(0, 1fr);
  }

  .point-badge {
    grid-column: 2;
    justify-self: start;
  }

}
