/* ============================================
   EVOYKO — Fitness Calculator Component
   Dark mode consulting premium style
   ============================================ */

/* ─── Container ──────────────────────────────── */
.fc-container {
  max-width: var(--max-width);
  margin-inline: auto;
}

/* ─── Form Layout (step 1) ───────────────────── */
.fc-form-layout {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.fc-layout--home .fc-form-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
  max-width: none;
}

.fc-form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 40px;
}

.fc-form-header {
  margin-bottom: 32px;
}

.fc-form-title {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 8px;
  margin-top: 16px;
}

.fc-form-subtitle {
  font-size: var(--text-small);
  color: var(--text-secondary);
  line-height: var(--lh-body);
}

/* ─── Step Indicator ─────────────────────────── */
.fc-step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
}

.fc-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-default);
}

.fc-step--active {
  background: var(--accent-primary);
  color: var(--text-on-gradient);
  border-color: var(--accent-primary);
}

.fc-step--done {
  background: rgba(83, 190, 144, 0.15);
  color: #53BE90;
  border-color: rgba(83, 190, 144, 0.3);
  font-size: 14px;
}

.fc-step-line {
  width: 40px;
  height: 2px;
  background: var(--border-default);
}

.fc-step-line--done {
  background: linear-gradient(90deg, rgba(83, 190, 144, 0.4), var(--accent-primary));
}

/* ─── Form Fields ────────────────────────────── */
.fc-field-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.fc-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.fc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fc-label {
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}

.fc-input,
.fc-select {
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text-primary);
  transition: border-color var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.fc-input::placeholder {
  color: var(--text-muted);
}

.fc-input:focus,
.fc-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(68, 184, 172, 0.1);
}

.fc-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239B97B0' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.fc-input--sm {
  padding: 7px 10px;
  font-size: var(--text-small);
}

/* ─── Data Table ─────────────────────────────── */
.fc-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.fc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-small);
}

.fc-table th {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 10px;
  text-align: left;
  background: var(--bg-elevated);
  white-space: nowrap;
}

.fc-table th:first-child {
  border-radius: var(--radius-lg) 0 0 0;
}

.fc-table th:last-child {
  border-radius: 0 var(--radius-lg) 0 0;
}

.fc-table td {
  padding: 8px 6px;
  border-top: 1px solid var(--border-subtle);
}

.fc-table td:first-child {
  padding-left: 10px;
}

.fc-table input {
  width: 100%;
  min-width: 70px;
}

/* ─── Buttons ────────────────────────────────── */
.fc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.fc-btn--primary {
  background: var(--cta-gradient);
  color: var(--text-on-gradient);
}

.fc-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(68, 184, 172, 0.3);
}

.fc-btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.fc-btn--ghost:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.fc-btn-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.fc-btn-icon:hover {
  border-color: #E66B36;
  color: #E66B36;
  background: rgba(230, 107, 54, 0.08);
}

.fc-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* ─── Info Panel (bottom) ────────────────── */
.fc-info-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 20px;
  width: 100%;
}

.fc-layout--home .fc-info-panel {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  width: auto;
}

.fc-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.fc-info-card--va {
  background: rgba(68, 184, 172, 0.04);
  border-color: rgba(68, 184, 172, 0.12);
}

.fc-info-icon {
  margin-bottom: 12px;
}

.fc-info-title {
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 8px;
}

.fc-info-text {
  font-size: var(--text-small);
  color: var(--text-secondary);
  line-height: 1.6;
}

.fc-info-text strong {
  color: var(--text-primary);
}

/* ─── Zone Legend ─────────────────────────────── */
.fc-zone-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fc-zone-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--text-small);
  color: var(--text-secondary);
  line-height: 1.5;
}

.fc-zone-item strong {
  color: var(--text-primary);
}

.fc-zone-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  margin-top: 4px;
}

.fc-zone-dot--outline {
  background: transparent !important;
  border: 2px solid;
}

/* ─── Results Layout (step 2) ────────────────── */
.fc-results-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}

.fc-chart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 32px;
}

.fc-chart-header {
  margin-bottom: 24px;
}

.fc-chart-container {
  width: 100%;
  min-height: 300px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.fc-chart-container canvas {
  display: block;
}

.fc-chart-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.fc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ─── Result Panel ───────────────────────────── */
.fc-result-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fc-result-card {
  padding: 32px;
  border-radius: var(--radius-xl);
  text-align: center;
  border: 1px solid;
}

.fc-result-card--fit {
  background: rgba(83, 190, 144, 0.06);
  border-color: rgba(83, 190, 144, 0.2);
}

.fc-result-card--unfit {
  background: rgba(230, 193, 54, 0.06);
  border-color: rgba(230, 193, 54, 0.2);
}

.fc-result-card--faible {
  background: rgba(230, 107, 54, 0.06);
  border-color: rgba(230, 107, 54, 0.2);
}

.fc-result-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 100px;
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.fc-result-badge--fit {
  background: rgba(83, 190, 144, 0.15);
  color: #53BE90;
}

.fc-result-badge--unfit {
  background: rgba(230, 193, 54, 0.15);
  color: #E6C136;
}

.fc-result-badge--faible {
  background: rgba(230, 107, 54, 0.15);
  color: #E66B36;
}

.fc-result-company {
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  color: var(--text-primary);
  margin-top: 12px;
}

.fc-result-year {
  font-size: var(--text-small);
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Metrics Bars ───────────────────────────── */
.fc-metrics {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fc-metric-label {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.fc-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.fc-metric-value {
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.fc-metric-bench {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.fc-metric-bar {
  position: relative;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: visible;
}

.fc-metric-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fc-metric-bar-mark {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: rgba(77, 200, 218, 0.6);
  border-radius: 1px;
}

/* ─── Evolution ──────────────────────────────── */
.fc-evolution {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.fc-evo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-small);
}

.fc-evo-row:last-child {
  border-bottom: none;
}

.fc-evo-year {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  min-width: 40px;
}

.fc-evo-label {
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  min-width: 50px;
}

.fc-evo-detail {
  color: var(--text-muted);
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* ─── Result Actions ─────────────────────────── */
.fc-result-actions {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.fc-result-actions .fc-btn {
  justify-content: center;
  width: 100%;
}

/* ─── Error ──────────────────────────────────── */
.fc-error {
  background: rgba(230, 107, 54, 0.1);
  border: 1px solid rgba(230, 107, 54, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: var(--text-small);
  color: #E66B36;
  width: 100%;
  animation: fc-shake 0.4s ease;
}

@keyframes fc-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 1024px) {
  .fc-layout--home .fc-form-layout,
  .fc-results-layout {
    grid-template-columns: 1fr;
  }

  .fc-layout--home .fc-info-panel {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .fc-form-panel {
    padding: 28px;
  }
}

@media (max-width: 768px) {
  .fc-layout--home .fc-form-layout,
  .fc-results-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .fc-info-panel,
  .fc-layout--home .fc-info-panel {
    grid-template-columns: 1fr;
  }

  .fc-field-row {
    grid-template-columns: 1fr;
  }

  .fc-form-panel {
    padding: 20px;
  }

  .fc-chart-panel {
    padding: 20px;
  }

  .fc-table {
    font-size: var(--text-xs);
  }

  .fc-table th {
    font-size: 9px;
    padding: 8px 4px;
  }

  .fc-table td {
    padding: 6px 3px;
  }

  .fc-table input {
    min-width: 55px;
    padding: 6px 6px;
    font-size: var(--text-xs);
  }

  .fc-form-actions {
    flex-direction: column;
  }

  .fc-form-actions .fc-btn {
    width: 100%;
    justify-content: center;
  }

  .fc-chart-legend {
    gap: 12px;
  }
}