/* ─────────────────────────────────────────────────────────────
   Ring Final Circuit Calculator — Electricians Hub
   Charcoal & Yellow theme, aligned to sitewide brand tokens
   (--color-primary: #FDC700 / dark charcoal per hub hero pattern)
───────────────────────────────────────────────────────────── */

.rfc-page {
  background: #f4f4f0;
}
.rfc-hero {
  background: linear-gradient(135deg, #0d0d0f 0%, #1a1a1a 100%);
  padding: 4.5rem 1rem 3rem;
  text-align: center;
  border-bottom: 3px solid rgba(253, 199, 0, 0.3);
}
.rfc-hero__eye {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(253, 199, 0, 0.65);
  margin-bottom: 1rem;
}
.rfc-hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.rfc-hero__title span { color: #FDC700; }
.rfc-hero__sub {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 40rem;
  margin: 0 auto;
  line-height: 1.6;
}

.rfc-body {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 5rem;
}

.rfc-intro {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.7;
  background: #f3f4f6;
  border-left: 4px solid #FDC700;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

/* ── Cards ── */
.rfc-card {
  background: #1a1a1a;
  border: 1px solid rgba(253, 199, 0, 0.18);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.rfc-card__hd {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.1rem;
}
.rfc-subhd {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #FDC700;
  margin: 1.5rem 0 0.85rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.rfc-card > .rfc-subhd:first-of-type {
  margin-top: 0.25rem;
  padding-top: 0;
  border-top: none;
}

/* ── Grids & fields ── */
.rfc-grid { display: grid; gap: 1rem; }
.rfc-grid-2 { grid-template-columns: 1fr 1fr; }
.rfc-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.rfc-field { display: flex; flex-direction: column; gap: 0.4rem; }
.rfc-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.rfc-field input[type="number"],
.rfc-field select {
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1rem;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) inset;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.rfc-field input[type="number"]:focus,
.rfc-field select:focus {
  border-color: #FDC700;
  background: rgba(255, 255, 255, 0.09);
}
.rfc-field select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
/* Windows paints the open list on a white popup. The closed control stays
   light-on-dark; the options themselves need dark text or they vanish. */
.rfc-field select option {
  background-color: #ffffff;
  color: #141418;
}
.rfc-field input::placeholder { color: rgba(255, 255, 255, 0.32); }

.rfc-hint {
  font-size: 0.72rem;
  color: rgba(253, 199, 0, 0.75);
  margin: 0;
}

.rfc-radio-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.2rem;
}
.rfc-radio {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  min-height: 44px;
}
.rfc-radio input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #FDC700;
  cursor: pointer;
  flex-shrink: 0;
}

.rfc-field .rfc-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  min-height: 44px;
}
.rfc-check[hidden] { display: none !important; }
.rfc-check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #FDC700;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Calculate button ── */
.rfc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 50px;
  margin-top: 1.25rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  background: #FDC700;
  color: #1a1a1a;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, transform 0.1s;
}
.rfc-btn:hover { background: #ffe14d; }
.rfc-btn:active { transform: scale(0.98); }

.rfc-btn-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.rfc-btn-row .rfc-btn { flex: 1 1 12rem; margin-top: 1.25rem; }

.rfc-btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.18);
}
.rfc-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ── Error state ── */
.rfc-error {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 600;
}
.rfc-error[hidden] { display: none; }

/* ── Warning / inconsistency banner ── */
.rfc-warning {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  background: rgba(253, 199, 0, 0.14);
  border: 1px solid rgba(253, 199, 0, 0.45);
  color: #7a5b00;
  font-size: 0.85rem;
  line-height: 1.6;
}
.rfc-warning strong { color: #1a1a1a; }
.rfc-warning ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  list-style: disc;
}
.rfc-warning[hidden] { display: none; }

/* ── Results ── */
.rfc-results {
  border-color: rgba(253, 199, 0, 0.35);
}
.rfc-results[hidden] { display: none; }
.rfc-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.rfc-result {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}
.rfc-result__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rfc-result__value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  font-family: "Courier New", monospace;
}
.rfc-result--highlight {
  grid-column: 1 / -1;
  background: rgba(253, 199, 0, 0.14);
  border: 1px solid rgba(253, 199, 0, 0.35);
}
.rfc-result--highlight .rfc-result__value { color: #FDC700; }

/* Measured / expected / empty result states */
.rfc-result--measured { border: 1px solid rgba(74, 222, 128, 0.4); }
.rfc-result--measured .rfc-result__value { color: #4ade80; }
.rfc-result--expected .rfc-result__value { color: #FDC700; }
.rfc-result--empty { opacity: 0.45; }
.rfc-result--empty .rfc-result__value { color: rgba(255, 255, 255, 0.4); }

.rfc-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}
.rfc-tag--measured { background: rgba(74, 222, 128, 0.18); color: #4ade80; }
.rfc-tag--expected { background: rgba(253, 199, 0, 0.18); color: #FDC700; }

/* ── Disclaimer ── */
.rfc-disclaimer {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.6;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  margin: 1.5rem 0;
}
.rfc-legal {
  font-size: 0.72rem;
  line-height: 1.55;
  color: #52525b;
  margin: -0.5rem 0 1.5rem;
  max-width: 46rem;
}

/* ── Related guides ── */
.rfc-related { margin-top: 2.5rem; }
.rfc-related h2,
.rfc-faq h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 1rem;
  border-bottom: 3px solid #FDC700;
  display: inline-block;
  padding-bottom: 0.15rem;
}
.rfc-related-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.rfc-related-grid a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rfc-related-grid a:hover {
  border-color: #FDC700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.rfc-related-grid a i { color: #FDC700; }

/* ── FAQ ── */
.rfc-faq { margin-top: 2.5rem; }
.rfc-faq__item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.65rem;
}
.rfc-faq__item summary {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a1a1a;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.rfc-faq__item p {
  font-size: 0.88rem;
  color: #4b5563;
  line-height: 1.65;
  margin-top: 0.65rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .rfc-hero { padding: 3.5rem 1rem 2.5rem; }
  .rfc-body { padding: 2rem 0.85rem 4rem; }
  .rfc-grid-2,
  .rfc-grid-3 { grid-template-columns: 1fr; }
  .rfc-results-grid { grid-template-columns: 1fr; }
  .rfc-result--highlight { grid-column: 1; }
  .rfc-card { padding: 1.15rem; }
}
