/**
 * Field Cortex — Diagnostic Control Panel (hotfix: center alignment + laptop scale)
 * Global: appliance / HVAC / auto via views/partials/diagnostic_console.ejs
 */

/* ── Outer shell — locked to main content column ── */
.fc-diag-console {
  font-family: 'Inter', system-ui, sans-serif;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 1.75rem;
  padding: 0 20px;
  box-sizing: border-box;
  clear: both;
}

/* ── Zone 1 & 2: tech mesh + structure ── */
.fc-diag-zone1,
.fc-diag-zone2-inner {
  position: relative;
  overflow: hidden;
}

.fc-diag-zone1::before,
.fc-diag-zone2-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37, 99, 235, 0.12), transparent 70%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
  z-index: 0;
}

.fc-diag-zone1 > *,
.fc-diag-zone2-inner > * {
  position: relative;
  z-index: 1;
}

.fc-diag-zone1 {
  background: linear-gradient(165deg, #0b1220 0%, #0f172a 45%, #1e293b 100%);
  border: 2px solid #334155;
  border-radius: 14px;
  padding: clamp(1rem, 2.5vw, 1.45rem) clamp(1rem, 3vw, 1.6rem);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.fc-diag-zone1.fc-diag-tier-diy {
  border-color: rgba(34, 197, 94, 0.55);
}

.fc-diag-zone1.fc-diag-tier-critical {
  border-color: rgba(239, 68, 68, 0.65);
}

.fc-diag-zone1-kicker {
  margin: 0 0 0.85rem;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #94a3b8;
  text-align: center;
}

.fc-diag-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.fc-diag-telemetry-item {
  text-align: center;
  padding: 0.65rem 0.5rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(51, 65, 85, 0.65);
  border-radius: 8px;
}

.fc-diag-telemetry-item label {
  display: block;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.fc-diag-telemetry-item span {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.25;
  word-break: break-word;
}

.fc-diag-complexity {
  margin: 1.15rem 0 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
}

.fc-diag-complexity-bar {
  height: 5px;
  width: 100%;
  animation: fc-diag-bar-glow 2.4s ease-in-out infinite;
}

.fc-diag-complexity.fc-diag-tier-diy .fc-diag-complexity-bar {
  background: linear-gradient(90deg, transparent, #22c55e 20%, #22c55e 80%, transparent);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.85);
}

.fc-diag-complexity.fc-diag-tier-critical .fc-diag-complexity-bar {
  background: linear-gradient(90deg, transparent, #ef4444 20%, #ef4444 80%, transparent);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.9);
}

@keyframes fc-diag-bar-glow {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

.fc-diag-complexity-body {
  padding: 1rem 1.25rem;
}

.fc-diag-complexity-score,
.diagnostic-complexity-rating {
  margin: 0 0 0.55rem;
  font-family: 'Roboto Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.fc-diag-complexity.fc-diag-tier-diy .fc-diag-complexity-score { color: #4ade80; }
.fc-diag-complexity.fc-diag-tier-critical .fc-diag-complexity-score { color: #f87171; }

.fc-diag-complexity-msg {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.55;
  color: #cbd5e1;
  text-align: center;
}

.fc-diag-complexity-msg.is-critical {
  color: #fecaca;
  font-weight: 700;
}

.fc-diag-zone2 {
  position: relative;
  margin-top: 1.25rem;
  padding: 3px;
  border-radius: 14px;
  background: #450a0a;
  overflow: hidden;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.45), 0 0 10px rgba(220, 38, 38, 0.35);
}

.fc-diag-zone2::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg,
    #7f1d1d,
    #dc2626,
    #ef4444,
    #fca5a5,
    #fecaca,
    #ef4444,
    #dc2626,
    #7f1d1d
  );
  animation: fc-specs-chase-spin 3.5s linear infinite;
  z-index: 0;
}

@keyframes fc-specs-chase-spin {
  to { transform: rotate(360deg); }
}

.fc-diag-zone2-inner {
  position: relative;
  z-index: 1;
  border: 2px solid #1e293b;
  border-radius: 11px;
  overflow: hidden;
  background: #0b1220;
}

.fc-diag-specs-title {
  margin: 0;
  padding: 0.85rem 1.25rem;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e2e8f0;
  background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
  border-bottom: 1px solid #334155;
  text-align: center;
}

.fc-diag-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.fc-diag-specs-table th,
.fc-diag-specs-table td {
  padding: 0.75rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid #1e293b;
}

.fc-diag-specs-table th {
  width: 36%;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.9);
}

.fc-diag-specs-table tr:nth-child(even) td { background: rgba(17, 24, 39, 0.95); }
.fc-diag-specs-table tr:nth-child(odd) td { background: rgba(11, 18, 32, 0.95); }
.fc-diag-specs-table td { color: #e2e8f0; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   DROP-IN REFACTOR — Zone 3 monetization (center-aligned, equal cards)
   ═══════════════════════════════════════════════════════════════════════════ */

/* 1. Global Container Alignment Reset */
.diagnostic-resolution-console {
  display: flex !important;
  justify-content: center !important;
  align-items: stretch !important;
  gap: 28px !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 40px auto !important;
  padding: 0 20px !important;
  box-sizing: border-box !important;
  clear: both !important;
}

/* 2. Double-Card Flex Box Layout Balance */
.diagnostic-resolution-console > div,
.diagnostic-resolution-console > article,
.diagnostic-card-diy,
.diagnostic-card-pro {
  flex: 1 !important;
  min-width: 280px !important;
  max-width: 560px !important;
  margin: 0 !important;
}

/* Card surface styling */
.diagnostic-card-diy,
.diagnostic-card-pro,
.fc-diag-portal-card {
  background: linear-gradient(168deg, #ffffff 0%, #f8fafc 48%, #eef2ff 100%);
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: clamp(1.15rem, 2.5vw, 1.65rem);
  box-shadow: 0 4px 6px rgba(15, 23, 42, 0.04), 0 16px 40px rgba(15, 23, 42, 0.12);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.diagnostic-card-diy h3,
.diagnostic-card-pro h3,
.fc-diag-portal-card h3 {
  margin: 0.4rem 0 0.65rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.diagnostic-card-diy p,
.diagnostic-card-pro p,
.fc-diag-portal-card p {
  margin: 0 0 1.15rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
  color: #334155;
  flex: 1;
}

.fc-diag-portal-icon {
  font-size: 2rem;
  line-height: 1;
}

.fc-diag-unlock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 1rem 1.1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 45%, #1d4ed8 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

.fc-diag-unlock-label,
.checkout-button-text {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.fc-diag-stripe-badge {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.92);
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.fc-diag-dispatch-link,
.fc-diag-dispatch-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  padding: 1rem;
  border-radius: 12px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.fc-diag-dispatch-link {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

.fc-diag-dispatch-fallback {
  border: 2px solid #dc2626;
  background: #fff;
  color: #b91c1c;
}

/* 3. High-Resolution Laptop Viewport Dominance */
@media (min-width: 1024px) {
  .diagnostic-resolution-console p,
  .diagnostic-resolution-console span,
  .diagnostic-resolution-console div {
    font-size: 18px !important;
    line-height: 1.6 !important;
  }

  .telemetry-header-text,
  .fc-diag-telemetry-item label,
  .fc-diag-telemetry-item span,
  .specs-matrix-grid table,
  .specs-matrix-grid td,
  .specs-matrix-grid th,
  .fc-diag-specs-table,
  .fc-diag-specs-table td,
  .fc-diag-specs-table th {
    font-size: 17px !important;
  }

  .diagnostic-complexity-rating,
  .fc-diag-complexity-score {
    font-size: 24px !important;
    font-weight: 800 !important;
  }

  .checkout-button-text,
  .fc-diag-unlock-label {
    font-size: 20px !important;
  }

  .diagnostic-card-diy h3,
  .diagnostic-card-pro h3 {
    font-size: 1.45rem !important;
  }
}

/* 4. Mobile & Tablet Defensive Wrap Stack */
@media (max-width: 900px) {
  .fc-diag-telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .diagnostic-resolution-console {
    flex-direction: column !important;
    align-items: center !important;
    padding: 0 12px !important;
  }

  .diagnostic-resolution-console > div,
  .diagnostic-resolution-console > article,
  .diagnostic-card-diy,
  .diagnostic-card-pro {
    width: 100% !important;
    max-width: 100% !important;
  }

  .fc-diag-telemetry-grid {
    grid-template-columns: 1fr;
  }

  .fc-diag-specs-table th,
  .fc-diag-specs-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .fc-diag-specs-table th {
    border-bottom: none;
    padding-bottom: 0.25rem;
  }
}
