/* =========================================================
   Brighterly Celsius ↔ Fahrenheit Converter
   Shares the visual system of the Fraction Calculator.
   ========================================================= */

:root {
  /* ── Brighterly Brand Purple ── */
  --color-purple-50:  #F3F1FF;
  --color-purple-100: #E9E6FF;
  --color-purple-200: #D4CFFF;
  --color-purple-300: #B8B0FF;
  --color-purple-400: #9B91FF;
  --color-purple-500: #7B69FF;
  --color-purple-600: #6655E8;
  --color-purple-700: #5042C7;
  --color-purple-800: #3A2FA0;
  --color-purple-900: #211C6B;

  /* ── Accents ── */
  --color-emerald-500: #00BC7D;
  --color-amber-400:   #FBBF24;
  --color-slate-400:   #90A1B9;
  --color-blue-500:    #3B82F6;

  /* ── Neutrals ── */
  --color-white:      #FFFFFF;
  --color-gray-text:  #1E1B4B;
  --color-gray-muted: #6B7280;

  --focus-ring: 0 0 0 3px rgba(123, 105, 255, 0.18);
}

/* =========================================================
   Base
   ========================================================= */

.brighterly-tc-root *,
.brighterly-tc-root *::before,
.brighterly-tc-root *::after { box-sizing: border-box; }

.brighterly-tc-root {
  font-family: 'Rubik', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 24px;
  color: var(--color-gray-text);
  background: var(--color-purple-50);
  border-radius: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.brighterly-tc-root h1,
.brighterly-tc-root h2,
.brighterly-tc-root h3,
.brighterly-tc-root h4,
.brighterly-tc-root h5,
.brighterly-tc-root h6,
.brighterly-tc-root p { margin: 0; }

.brighterly-tc-root button { font-family: inherit; }

.brighterly-tc-root input[type="number"]::-webkit-outer-spin-button,
.brighterly-tc-root input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.brighterly-tc-root input[type="number"] { -moz-appearance: textfield; }

/* =========================================================
   Page layout
   ========================================================= */

.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* =========================================================
   Calculator card
   ========================================================= */

.calculator-card {
  background: var(--color-white);
  border: 1px solid var(--color-purple-200);
  border-radius: 24px;
  padding: 40px;
}

/* =========================================================
   Operation tabs
   ========================================================= */

.operation-tabs {
  display: flex;
  gap: 4px;
  background: var(--color-purple-50);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
}

.brighterly-tc-root .operation-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  font-family: 'Rubik', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  background: transparent;
  color: var(--color-gray-muted);
  white-space: nowrap;
  text-shadow: none;
}

.brighterly-tc-root .operation-tab span { color: inherit; }

.brighterly-tc-root .operation-tab:hover {
  color: var(--color-purple-600);
  background: transparent;
}

.brighterly-tc-root .operation-tab.active,
.brighterly-tc-root .operation-tab.active:hover,
.brighterly-tc-root .operation-tab.active:focus {
  background: var(--color-purple-500) !important;
  color: var(--color-white) !important;
}

.brighterly-tc-root .operation-tab.active span,
.brighterly-tc-root .operation-tab.active svg {
  color: var(--color-white) !important;
}

.operation-tab:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.tab-icon { flex-shrink: 0; }

/* =========================================================
   Prompt sentence
   ========================================================= */

.prompt-text {
  text-align: center;
  font-size: 18px;
  line-height: 26px;
  color: var(--color-gray-text);
  margin-bottom: 20px;
}

.prompt-text strong {
  color: var(--color-purple-600);
  font-weight: 600;
}

/* =========================================================
   Inputs row
   ========================================================= */

.inputs-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}

.value-input-group {
  flex: 0 1 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-white);
  border: 1.5px solid var(--color-purple-200);
  border-radius: 12px;
  padding: 20px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.value-input-group:focus-within {
  border-color: var(--color-purple-500);
  box-shadow: 0 0 0 3px rgba(123, 105, 255, 0.12);
}

.value-input-group.has-error {
  border-color: #DC2626;
}

.value-group-title {
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-gray-muted);
  margin-bottom: 16px;
  text-align: center;
  width: 100%;
}

.value-field-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

input.value-field {
  border: 1.5px solid var(--color-purple-200);
  border-radius: 8px;
  padding: 10px 8px;
  font-family: 'Rubik', sans-serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--color-gray-text);
  width: 140px;
  min-height: 52px;
  text-align: center;
  background: var(--color-white);
  transition: border-color 0.2s, background 0.2s;
}

input.value-field::placeholder {
  color: var(--color-purple-300);
  opacity: 1;
}

input.value-field:focus {
  outline: none;
  border-color: var(--color-purple-500);
  background: var(--color-purple-50);
}

.value-suffix {
  font-family: 'Rubik', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--color-purple-500);
}
.value-suffix:empty { display: none; }

.input-error {
  min-height: 16px;
  margin-top: 8px;
  color: #DC2626;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

/* =========================================================
   Calculate button
   ========================================================= */

.calculate-btn {
  background: var(--color-purple-500);
  color: var(--color-white);
  border: none;
  border-radius: 12px;
  padding: 16px 40px;
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  width: 100%;
  margin-top: 24px;
  min-height: 56px;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.calculate-btn:hover {
  background: var(--color-purple-600);
  transform: scale(1.02);
}

.calculate-btn:active { transform: scale(0.98); }

.calculate-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* =========================================================
   Result card
   ========================================================= */

.result-card {
  background: var(--color-white);
  border-radius: 20px;
  border: 1px solid var(--color-purple-200);
  border-left: 5px solid var(--color-emerald-500);
  padding: 24px 28px;
  margin-top: 24px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  display: none;
}

.result-card.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.result-label {
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-emerald-500);
  margin-bottom: 12px;
  text-align: left;
}

.result-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.result-equals {
  font-family: 'Rubik', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--color-purple-500);
  line-height: 1;
}

.result-value {
  font-family: 'Rubik', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-gray-text);
  line-height: 1.2;
}

.result-note {
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--color-gray-muted);
}

/* =========================================================
   Step-by-step
   ========================================================= */

.steps-container { margin-top: 32px; }

.steps-heading {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--color-gray-text);
  margin-bottom: 20px;
}

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.step-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.step-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-purple-500);
  color: var(--color-white);
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-body { flex: 1; min-width: 0; }

.step-title {
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--color-blue-500);
  margin-bottom: 8px;
}

.step-content {
  font-size: 16px;
  line-height: 24px;
  color: var(--color-gray-text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.step-content strong { color: var(--color-gray-text); font-weight: 700; }

/* =========================================================
   Reference table (common temperatures)
   ========================================================= */

.reference-container { margin-top: 32px; }

.reference-heading {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--color-gray-text);
  margin-bottom: 16px;
}

.reference-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
  border: 1px solid var(--color-purple-200);
  border-radius: 12px;
  overflow: hidden;
  font-size: 16px;
}

.reference-table th,
.reference-table td {
  padding: 12px 16px;
  text-align: left;
}

.reference-table thead th {
  background: var(--color-purple-50);
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-gray-muted);
}

.reference-table tbody tr + tr td {
  border-top: 1px solid var(--color-purple-100);
}

.reference-table tbody td:first-child {
  font-weight: 500;
  color: var(--color-gray-text);
}

.reference-table tbody td:nth-child(2),
.reference-table tbody td:nth-child(3) {
  font-weight: 600;
  color: var(--color-purple-600);
}

/* =========================================================
   Responsive — mobile ≤ 768px
   ========================================================= */

@media (max-width: 768px) {
  .page-container { padding: 24px 16px 48px; }

  .calculator-card { padding: 24px; border-radius: 20px; }

  .operation-tab {
    font-size: 12px;
    padding: 10px 6px;
    gap: 4px;
  }
  .operation-tab span { font-size: 12px; }

  .prompt-text { font-size: 16px; line-height: 24px; }

  .value-input-group { flex: 1 1 auto; width: 100%; }

  input.value-field { width: 120px; font-size: 24px; }

  .result-card { padding: 20px; }
  .result-equals { font-size: 22px; }
  .result-value { font-size: 24px; }

  .steps-heading, .reference-heading { font-size: 18px; }
  .step-title { font-size: 15px; }
  .step-content { font-size: 15px; line-height: 22px; }

  .reference-table { font-size: 14px; }
  .reference-table th, .reference-table td { padding: 10px 12px; }
}
