/* =========================================================
   MORTGAGE READINESS LAB
   ========================================================= */

/* ---------- Layout ---------- */

.grader-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

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

/* ---------- Hero ---------- */

.grader-hero .card {
  padding: 2.5rem;
}

.grader-title {
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
}

.grader-lead {
  font-size: 1.05rem;
  max-width: 720px;
}

.grader-disclaimer {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: #f6f9fb;
  padding: 0.8rem 1rem;
  border-radius: 10px;
}

/* ---------- Input Panel ---------- */

.grader-input {
  padding: 2rem;
}

.grader-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.2rem;
}

.grader-field label {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.grader-field input,
.grader-field select {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: white;
}

.grader-field input:focus,
.grader-field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(15, 110, 110, 0.15);
}

/* ---------- Buttons ---------- */

.grader-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

/* ---------- Score Panel ---------- */

.grader-score {
  padding: 2rem;
  position: sticky;
  top: 1.5rem;
}

.grader-score-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.grader-score-value {
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.grader-score-tier {
  font-size: 1rem;
  margin-top: 0.3rem;
  color: var(--text-muted);
}

/* ---------- Ratios ---------- */

.grader-ratios {
  display: flex;
  justify-content: space-between;
  margin-top: 1.2rem;
}

.ratio-item {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.ratio-item strong {
  font-size: 1.1rem;
}

/* ---------- Pillar Section ---------- */

.grader-pillars .card {
  padding: 2rem;
}

.grader-pillar {
  margin-bottom: 1.2rem;
}

.pillar-label {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}


/* ---------- Action Plan ---------- */

.grader-actions-section .card {
  padding: 2rem;
}

.grader-action-list {
  margin-top: 1rem;
  padding-left: 1rem;
}

.grader-action-list li {
  margin-bottom: 0.6rem;
  line-height: 1.5;
  animation: fadeInUp 0.4s ease both;
}

/* ---------- Methodology ---------- */

.grader-methodology {
  margin-top: 2rem;
  padding-bottom: 3rem;
}

.grader-methodology h3 {
  margin-bottom: 0.6rem;
}

/* ---------- Card Polish ---------- */

.card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.05);
}

/* ---------- Reveal Animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Fade In Utility ---------- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Collapsible Sections (Future Use) ---------- */

.grader-collapsible {
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.grader-collapsible.is-closed {
  max-height: 0;
  opacity: 0;
}

.grader-collapsible.is-open {
  max-height: 800px;
  opacity: 1;
}

/* ---------- Micro Interaction ---------- */

button.btn-primary {
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

button.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15,110,110,0.2);
}

/* =========================================
   PREMIUM SVG GAUGE
========================================= */

.grader-gauge-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 1.5rem;
}

.grader-gauge {
  width: 100%;
  height: 100%;
  display: block;
}

.grader-gauge-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.grader-gauge-wrap::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(0,0,0,0.02),
    transparent 70%
  );
  pointer-events: none;
}

.grader-gauge {
  width: 100%;
  height: 100%;
}

.gauge-bg {
  stroke: #e8eef2;
}

.gauge-progress {
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
    transition: stroke-dashoffset 0.8s cubic-bezier(.2,.8,.2,1),
              stroke 0.4s ease;
}

.grader-score-value {
  font-size: 3.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}

.grader-score-tier {
  font-size: 0.95rem;
  font-weight: 500;
  color: #1f3447;
  max-width: 140px;
  text-align: center;
  line-height: 1.2;
}
/* Ratio Strip */

.grader-ratio-strip {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: #f6f9fb;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.grader-ratio-strip strong {
  display: block;
  font-size: 1.1rem;
}

/* ===== AAA Compact Pillars ===== */

.pillar-mini-fill {
  height: 6px;
  width: 0%;
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(.4,0,.2,1),
              background 0.4s ease,
              box-shadow 0.4s ease;
}

.pillar-mini-fill {
  height: 100%;
  width: 0%;
  background: #cfd8dd; /* soft neutral */
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(.4,0,.2,1);
}

/* Strong */
.pillar-mini-fill.is-strong {
  background: linear-gradient(90deg, #0f6e6e, #18a999);
  box-shadow: 0 0 10px rgba(24,169,153,0.35);
}

/* Medium */
.pillar-mini-fill.is-medium {
  background: linear-gradient(90deg, #d6a73c, #f0c75e);
}

/* Weak */
.pillar-mini-fill.is-weak {
  background: linear-gradient(90deg, #a66363, #c27d7d);
}

.pillar-mini-bar {
  height: 6px;
  background: #e8eef2;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.pillar-mini-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to right,
    transparent,
    transparent 24%,
    rgba(255,255,255,0.25) 25%
  );
  opacity: 0.15;
  pointer-events: none;
}

.info-dot {
  display:inline-block;
  width:16px;
  height:16px;
  border-radius:50%;
  background:#e3eaec;
  color:#30495e;
  font-size:11px;
  text-align:center;
  line-height:16px;
  cursor:help;
  margin-left:4px;
  position:relative;
}

.info-dot:hover::after {
  content: attr(data-tip);
  position:absolute;
  bottom:125%;
  left:50%;
  transform:translateX(-50%);
  background:#1f3447;
  color:white;
  padding:8px 10px;
  border-radius:6px;
  font-size:12px;
  width:220px;
  white-space:normal;
}

.score-strong {
  color: #078a7e;
  text-shadow: 0 2px 8px rgba(7,138,126,0.15);
}
.score-medium { color: #d6a73c;
  text-shadow: 0 2px 8px rgba(7,138,126,0.15);
}
.score-low { color: #a66363;
  text-shadow: 0 2px 8px rgba(7,138,126,0.15);
}

.grader-score {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.8),
    rgba(255,255,255,0.6)
  );
  backdrop-filter: blur(6px);
}

.grader-constraint {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: #f6f9fb;
  border: 1px solid var(--border-soft);

  display: flex;
  flex-direction: column;   /* ← forces vertical stacking */
  align-items: flex-start;  /* ← left aligned */
  gap: 0.35rem;
  text-align: left;
}

.constraint-title {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}



.constraint-body {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1.4;
}
.constraint-label {
  color: var(--text-muted);
  font-weight: 500;
}

#constraintText {
  color: var(--navy);
}

.pillar-mini-fill.is-focus {
  box-shadow: 0 0 12px rgba(15,110,110,0.45);
}

.pillar-mini-fill.is-placeholder {
  background: linear-gradient(
    90deg,
    #e8eef2,
    #f6f9fb,
    #e8eef2
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.constraint-title {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.constraint-body {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1.4;
}

/* ===== Constraint Tone States ===== */

.constraint-strong {
  background: linear-gradient(
    180deg,
    rgba(15,110,110,0.08),
    rgba(15,110,110,0.03)
  );
  border-color: rgba(15,110,110,0.25);
}

.constraint-medium {
  background: linear-gradient(
    180deg,
    rgba(214,167,60,0.14),
    rgba(214,167,60,0.05)
  );
  border-color: rgba(214,167,60,0.35);
}

.constraint-weak {
  background: linear-gradient(
    180deg,
    rgba(180,60,60,0.15),
    rgba(180,60,60,0.06)
  );
  border-color: rgba(180,60,60,0.35);
}

/* Strong */
.pillar-mini-fill.is-strong {
  background: linear-gradient(90deg, #0f6e6e, #18a999);
  box-shadow: 0 0 10px rgba(24,169,153,0.35);
}

/* Medium */
.pillar-mini-fill.is-medium {
  background: linear-gradient(90deg, #d6a73c, #f0c75e);
}

/* Weak */
.pillar-mini-fill.is-weak {
  background: linear-gradient(90deg, #b43c3c, #d86b6b);
}

.grader-ratio-strip {
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}

.pillar-mini-fill.is-focus {
  box-shadow: 0 0 8px rgba(15,110,110,0.25);
}

.gauge-bg {
  stroke: #e8eef2;
  opacity: 0.9;
}

.grader-gauge {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.04));
}

.gauge-progress.is-strong {
  stroke: url(#strongGradient);
}

.grader-score-tier {
  font-size: 1rem;
  font-weight: 500;
  color: #1f3447;
  margin-top: 0.4rem;
}

button.is-disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Tooltip Base */
.tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted rgba(0,0,0,0.3);
}

/* Tooltip Box */
.tooltip-text {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;

  background: #1f2f3a;
  color: #ffffff;

  font-size: 0.8rem;
  line-height: 1.4;

  padding: 0.75rem 0.9rem;
  border-radius: 10px;

  box-shadow: 0 12px 30px rgba(0,0,0,0.25);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;

  z-index: 10;
}

/* Arrow */
.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #1f2f3a transparent transparent transparent;
}

/* Hover Activation */
.tooltip:hover .tooltip-text {
  opacity: 1;
}