/* Public landing-page interactive demo styles.
 * Palette and typography mirror the existing inline styles in index.html.
 */

.ygt-demo {
  padding: 16px 28px 48px;
  background: #FAFAFA;
}

.ygt-demo-inner {
  max-width: 720px;
  margin: 0 auto;
}

.ygt-demo-heading {
  font-size: 2rem;
  font-weight: 800;
  color: #1A2B49;
  text-align: center;
  line-height: 1.18;
  margin-bottom: 12px;
}

.ygt-demo-lede {
  font-size: 1.05rem;
  color: #6B778C;
  text-align: center;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 36px;
}

/* ---------- Form ---------- */
.ygt-demo-form-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  padding: 32px 28px;
  transition: opacity 0.2s ease-out;
}

.ygt-demo-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f1f1f4;
}

.ygt-demo-section:last-of-type {
  border-bottom: none;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.ygt-demo-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4A90E2;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ygt-field {
  margin-bottom: 16px;
}

.ygt-field:last-child {
  margin-bottom: 0;
}

.ygt-field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1A2B49;
  margin-bottom: 6px;
}

.ygt-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #EBF2FB;
  color: #4A90E2;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  position: relative;
}

.ygt-tooltip-trigger:hover::after,
.ygt-tooltip-trigger:focus::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1A2B49;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 8px;
  width: 260px;
  text-align: left;
  z-index: 10;
  pointer-events: none;
}

.ygt-input,
.ygt-currency-input input,
.ygt-allocation-input {
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #1A2B49;
  padding: 12px 14px;
  border: 1px solid #e0e3e8;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease-out;
}

.ygt-input:focus,
.ygt-currency-input input:focus,
.ygt-allocation-input:focus {
  outline: none;
  border-color: #4A90E2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}

.ygt-input.has-error,
.ygt-currency-input.has-error input,
.ygt-allocation-input.has-error {
  border-color: #d64545;
}

/* Currency input — $ prefix */
.ygt-currency-input {
  position: relative;
}

.ygt-currency-input::before {
  content: '$';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: #6B778C;
  pointer-events: none;
}

.ygt-currency-input input {
  padding-left: 26px;
}

.ygt-field-help {
  font-size: 0.75rem;
  color: #8993a4;
  margin-top: 4px;
  line-height: 1.5;
}

.ygt-field-error {
  font-size: 0.75rem;
  color: #d64545;
  margin-top: 6px;
  min-height: 1em;
}

/* ---------- Allocation row ---------- */
.ygt-allocation-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ygt-allocation-cell label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6B778C;
  margin-bottom: 4px;
}

.ygt-allocation-input {
  text-align: right;
  padding-right: 28px;
}

.ygt-allocation-cell {
  position: relative;
}

.ygt-allocation-cell::after {
  content: '%';
  position: absolute;
  right: 12px;
  bottom: 13px;
  color: #8993a4;
  font-weight: 600;
  pointer-events: none;
}

.ygt-allocation-total {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #6B778C;
  text-align: right;
  font-weight: 500;
}

.ygt-allocation-total.is-invalid {
  color: #d64545;
  font-weight: 600;
}

.ygt-allocation-total span {
  font-weight: 700;
  color: inherit;
}

/* ---------- Privacy block ---------- */
.ygt-privacy-block {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #EBF2FB;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 22px 0 22px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #1A2B49;
}

.ygt-privacy-block .ygt-lock {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.ygt-privacy-block strong {
  font-weight: 700;
}

/* ---------- Submit ---------- */
.ygt-demo-submit-row {
  text-align: center;
  margin-top: 8px;
}

#ygt-demo-submit {
  width: 100%;
  max-width: 320px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: 10px;
  background: #00B894;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

#ygt-demo-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

#ygt-demo-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Results ---------- */
.ygt-demo-results {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  padding: 36px 28px;
}

.ygt-demo-results-header {
  font-size: 1.85rem;
  font-weight: 800;
  color: #1A2B49;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 28px;
}

.ygt-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.ygt-stat-card {
  background: #FAFAFA;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
}

.ygt-stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4A90E2;
  margin-bottom: 8px;
  line-height: 1.3;
}

.ygt-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1A2B49;
  line-height: 1.1;
}

/* ---------- Chart container ---------- */
.ygt-chart-container {
  position: relative;
  height: 360px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .ygt-chart-container {
    height: 300px;
  }
}

/* ---------- Tax cards ---------- */
.ygt-tax-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.ygt-tax-card {
  border-radius: 12px;
  padding: 18px 16px;
  border: 1px solid;
}

.ygt-tax-card-before {
  background: rgba(26, 43, 73, 0.06);
  border-color: rgba(26, 43, 73, 0.18);
}

.ygt-tax-card-after {
  background: rgba(74, 144, 226, 0.08);
  border-color: rgba(74, 144, 226, 0.22);
}

.ygt-tax-label {
  font-size: 0.78rem;
  color: #6B778C;
  margin-bottom: 6px;
  font-weight: 500;
}

.ygt-tax-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.15;
}

.ygt-tax-card-before .ygt-tax-value {
  color: #1A2B49;
}

.ygt-tax-card-after .ygt-tax-value {
  color: #4A90E2;
}

.ygt-tax-caption {
  font-size: 0.78rem;
  color: #8993a4;
  line-height: 1.55;
  margin-bottom: 28px;
  font-style: italic;
}

/* ---------- CTA in results ---------- */
.ygt-demo-cta-row {
  text-align: center;
  margin-top: 8px;
}

.ygt-demo-cta {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 18px 36px;
  border-radius: 10px;
  background: #00B894;
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.ygt-demo-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.ygt-cta-subtext {
  font-size: 0.78rem;
  color: #8993a4;
  margin-top: 10px;
  font-style: italic;
}

.ygt-disclaimer {
  font-size: 0.72rem;
  color: #8993a4;
  text-align: center;
  margin-top: 18px;
  font-style: italic;
  line-height: 1.5;
}

/* ---------- Animation utility classes ---------- */
.ygt-fade-out {
  opacity: 0;
  pointer-events: none;
}

.ygt-fade-in {
  animation: ygt-fade-in 200ms ease-out forwards;
}

@keyframes ygt-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* When reduced motion is preferred, kill all transitions/animations
 * inside the demo. The JS path also short-circuits the count-up. */
@media (prefers-reduced-motion: reduce) {
  .ygt-demo *,
  .ygt-demo *::before,
  .ygt-demo *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .ygt-demo {
    padding: 12px 18px 32px;
  }
  .ygt-demo-form-card,
  .ygt-demo-results {
    padding: 22px 18px;
  }
  .ygt-demo-heading {
    font-size: 1.6rem;
  }
  .ygt-demo-results-header {
    font-size: 1.45rem;
  }
  .ygt-stat-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ygt-stat-value {
    font-size: 1.5rem;
  }
  .ygt-tax-grid {
    grid-template-columns: 1fr;
  }
  .ygt-allocation-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ygt-tooltip-trigger:hover::after,
  .ygt-tooltip-trigger:focus::after {
    width: 220px;
    left: 0;
    transform: none;
  }
}
