/* Mortality Curve Forecaster (UK Specific) - Styled to Calculator Standards */

.mcf-root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #03212e;
  max-width: 1100px;
  margin: 0 auto;
}

.mcf-loading {
  padding: 2rem;
  border-radius: 20px;
  border: 2px solid #083141;
  background: #fbfeff;
  font-size: 0.95rem;
  color: #083141;
}

.mcf-app {
  border-radius: 20px;
  border: 2px solid #083141;
  background: #ffffff;
  padding: 2rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.mcf-header {
  margin-bottom: 1.75rem;
}

.mcf-title {
  margin: 0 0 0.5rem;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #03212e;
}

.mcf-intro {
  margin: 0;
  font-size: 0.95rem;
  color: #5b6a72;
  line-height: 1.6;
}

/* Steps */
.mcf-step {
  margin-top: 1.75rem;
  padding: 1.25rem;
  border-radius: 14px;
  border: 2px solid #dde7ea;
  background: #fbfeff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mcf-step-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #083141;
}

.mcf-step-help {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #5b6a72;
  line-height: 1.5;
}

/* Grid */
.mcf-grid {
  display: grid;
  gap: 1rem;
}

.mcf-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 640px) {
  .mcf-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Fields */
.mcf-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mcf-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #083141;
}

.mcf-field-help {
  margin: 0;
  font-size: 0.8rem;
  color: #59747c;
  font-style: italic;
}

.mcf-input {
  border-radius: 8px;
  border: 2px solid #dde7ea;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  color: #03212e;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mcf-input:focus {
  outline: none;
  border-color: #083141;
  box-shadow: 0 0 0 3px rgba(8, 49, 65, 0.1);
}

.mcf-input:hover {
  border-color: #59747c;
}

.mcf-input.mcf-input-warning {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.mcf-field-warning-container {
  margin-top: 0.5rem;
  display: block;
  min-height: 0;
}

.mcf-field-warning {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  background-color: #fee2e2;
  border: 2px solid #ef4444;
  color: #991b1b;
  animation: warningFadeIn 0.3s ease-out;
}

.mcf-field-warning.mcf-warning-high {
  background-color: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.mcf-field-warning.mcf-warning-danger {
  background-color: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

@keyframes warningFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Highlights */
.mcf-highlights {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.75rem;
}

.mcf-highlights-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mcf-highlights-section-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #03212e;
  letter-spacing: -0.01em;
}

.mcf-highlights-section-description {
  margin: 0;
  font-size: 0.9rem;
  color: #5b6a72;
  line-height: 1.5;
  font-style: italic;
}

.mcf-highlights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 640px) {
  .mcf-highlights-grid {
    grid-template-columns: 1fr;
  }
}

.mcf-highlight-reference {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #f0f7fa;
  border-radius: 8px;
  border-left: 3px solid #4a90e2;
}

.mcf-highlight-reference p {
  margin: 0;
  font-size: 0.85rem;
  color: #5b6a72;
  font-style: italic;
}

.mcf-highlight-card {
  border-radius: 14px;
  border: 2px solid #dde7ea;
  background: #f0f7fa;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mcf-highlight-card.mcf-highlight-adjusted {
  background: #e6f5ea;
  border-color: #166534;
}

.mcf-highlight-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #59747c;
  margin-bottom: 0.5rem;
}

.mcf-highlight-value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #083141;
  margin-bottom: 0.3rem;
}

.mcf-highlight-note {
  font-size: 0.85rem;
  color: #5b6a72;
  line-height: 1.4;
}

/* Chart */
.mcf-chart-wrapper {
  margin-top: 1rem;
}

.mcf-chart-error {
  padding: 2rem;
  text-align: center;
  color: #5b6a72;
  font-size: 0.9rem;
  border: 2px dashed #dde7ea;
  border-radius: 14px;
  background: #f9fcfd;
}

.mcf-chart-header {
  margin-bottom: 1rem;
}

.mcf-chart-title {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #083141;
}

.mcf-chart-caption {
  margin: 0;
  font-size: 0.88rem;
  color: #5b6a72;
}

.mcf-chart-container {
  position: relative;
  width: 100%;
  margin: 0.5rem 0;
}

.mcf-chart {
  width: 100%;
  height: 400px;
  border-radius: 14px;
  border: 2px solid #dde7ea;
  background: #fbfeff;
  display: block;
}

.mcf-grid-line {
  stroke: #e1eaed;
  stroke-width: 0.5;
}

.mcf-axis {
  stroke: #59747c;
  stroke-width: 1.5;
}

.mcf-baseline-curve {
  opacity: 0.7;
}

.mcf-adjusted-curve {
  opacity: 1;
}

.mcf-chart-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.mcf-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #5b6a72;
}

.mcf-legend-line {
  display: inline-block;
  width: 24px;
  height: 2px;
  border-radius: 1px;
}

.mcf-legend-baseline {
  background: #4a90e2;
  border-top: 2px dashed #4a90e2;
  height: 3px;
}

.mcf-legend-adjusted {
  background: #10b981;
  height: 3px;
}

.mcf-chart-axes-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #59747c;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Timeline Visualization */
.mcf-visualization-wrapper {
  margin: 1.5rem 0;
}

.mcf-visualization-header {
  margin-bottom: 1.25rem;
}

.mcf-visualization-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #03212e;
}

.mcf-visualization-caption {
  margin: 0;
  font-size: 0.9rem;
  color: #5b6a72;
  line-height: 1.5;
}

.mcf-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mcf-timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: #fbfeff;
  border: 2px solid #dde7ea;
  border-radius: 14px;
}

.mcf-timeline-age {
  font-weight: 700;
  font-size: 1.1rem;
  color: #03212e;
  text-align: center;
}

.mcf-timeline-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mcf-timeline-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mcf-timeline-label {
  min-width: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #59747c;
}

.mcf-timeline-bar-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mcf-timeline-bar {
  flex: 1;
  height: 32px;
  background: #e5e7eb;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid #d1d5db;
}

.mcf-timeline-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.3s ease;
  position: relative;
}

.mcf-timeline-percent-always {
  min-width: 55px;
  text-align: right;
  font-weight: 700;
  font-size: 0.9rem;
  color: #03212e;
  white-space: nowrap;
}

.mcf-timeline-diff {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.5rem;
  border-radius: 8px;
}

.mcf-timeline-diff.mcf-diff-positive {
  color: #10b981;
  background: #d1fae5;
}

.mcf-timeline-diff.mcf-diff-negative {
  color: #ef4444;
  background: #fee2e2;
}

.mcf-chart-tooltip {
  display: none;
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mcf-milestone-marker {
  cursor: pointer;
}

.mcf-milestone-label {
  pointer-events: none;
  user-select: none;
}

.mcf-hover-point {
  cursor: crosshair;
  transition: r 0.2s;
}

.mcf-hover-point:hover {
  r: 4;
  fill: rgba(0, 0, 0, 0.1);
}

.mcf-axis-label {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  user-select: none;
}

/* Table */
.mcf-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #dde7ea;
}

.mcf-table th,
.mcf-table td {
  border: 1px solid #dde7ea;
  padding: 0.75rem;
  text-align: left;
}

.mcf-table th {
  background: #f0f7fa;
  font-weight: 700;
  color: #083141;
  font-size: 0.88rem;
}

.mcf-table td {
  background: #ffffff;
  color: #03212e;
}

.mcf-table tbody tr:hover {
  background: #f9fcfd;
}

.mcf-diff-positive {
  color: #166534;
  background: #d1fae5 !important;
  font-weight: 700;
  text-align: center;
  padding: 0.5rem !important;
}

.mcf-diff-negative {
  color: #b91c1c;
  background: #fee2e2 !important;
  font-weight: 700;
  text-align: center;
  padding: 0.5rem !important;
}

/* Explainer Section */
.mcf-explainer {
  background: #f0f7fa;
  border-color: #59747c;
}

.mcf-explainer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .mcf-explainer-grid {
    grid-template-columns: 1fr;
  }
}

.mcf-explainer-item {
  background: #ffffff;
  border: 2px solid #dde7ea;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mcf-explainer-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #083141;
}

.mcf-explainer-content {
  font-size: 0.9rem;
  color: #03212e;
  line-height: 1.6;
}

.mcf-explainer-content p {
  margin: 0 0 0.75rem;
  color: #083141;
  font-weight: 500;
}

.mcf-explainer-list {
  margin: 0 0 0.75rem;
  padding-left: 1.5rem;
  list-style-type: disc;
}

.mcf-explainer-list li {
  margin-bottom: 0.4rem;
  color: #5b6a72;
}

.mcf-explainer-note {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  background: #f9fcfd;
  border-left: 3px solid #59747c;
  border-radius: 4px;
  font-size: 0.85rem;
  font-style: italic;
  color: #59747c;
}

.mcf-explainer-summary {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #ffffff;
  border: 2px solid #083141;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mcf-explainer-summary-text {
  margin: 0;
  font-size: 0.9rem;
  color: #03212e;
  line-height: 1.7;
  font-weight: 500;
}

/* Disclaimer */
.mcf-disclaimer {
  margin-top: 1.75rem;
  font-size: 0.85rem;
  color: #5b6a72;
  border-top: 2px dashed #dde7ea;
  padding-top: 1rem;
  line-height: 1.6;
}

.mcf-disclaimer p {
  margin: 0;
}

/* Print */
@media print {
  .mcf-app {
    box-shadow: none;
    border: 2px solid #083141;
  }

  .mcf-root {
    color: #000000;
  }

  .mcf-chart {
    border: 1px solid #000000;
  }
}

/* Legacy support for old shortcode */
.omc-root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #03212e;
}

.omc-loading {
  padding: 2rem;
  border-radius: 20px;
  border: 2px solid #083141;
  background: #fbfeff;
  font-size: 0.95rem;
  color: #083141;
}
