/* Protein Calculator */

/* Container */
.container--narrow {
  max-width: 48rem;
  margin-inline: auto;
}

/* Back Link */
.back-link {
  margin: 0 0 1.25rem;
}

.back-link a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.back-link a:hover {
  color: var(--color-charcoal);
  text-decoration: underline;
}

/* Page Layout */
.protein-calc-page {
  padding: 0rem 1rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Card */
.protein-card {
  --bg: #FAF7F2;
  --card: #FFFFFF;
  --border: #E4DED4;
  --charcoal: #2E3A3D;
  --text-secondary: #6B6459;
  --eat-green: #4C6444;
  --eat-green-light: #E8EEE5;
  --eat-green-dark: #33452D;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  padding: 2.25rem 2rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--charcoal);
}

/* Field Container */
.protein-card .field {
  margin-bottom: 20px;
}

.protein-card .field:last-of-type {
  margin-bottom: 8px;
}

/* Header */
.protein-calc-header {
  text-align: center;
  margin-bottom: 2rem;
}

.protein-calc-header h1 {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.25;
  color: var(--charcoal);
}

.protein-calc-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 auto;
  max-width: 48ch;
}

/* Eyebrow */
.protein-eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--eat-green);
  font-weight: 700;
  margin: 0 0 8px;
}

/* Card Title */
.protein-card h1 {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.25;
}

.protein-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 28px;
  max-width: 48ch;
}

/* Labels */
.protein-card label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--eat-green-dark);
  margin-bottom: 8px;
  margin-top: 1.1rem;
}

.protein-card label:first-of-type {
  margin-top: 0;
}

/* Weight Row */
.protein-weight-row {
  display: flex;
  gap: 10px;
}

/* Inputs */
.protein-card input[type="number"],
.protein-card select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--charcoal);
  background: var(--bg);
}

.protein-card input[type="number"]:focus,
.protein-card select:focus {
  outline: none;
  border-color: var(--eat-green);
}

.protein-card select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1L6 6L11 1" stroke="%234C6444" stroke-width="1.6" fill="none" stroke-linecap="round"/></svg>');
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* Field Hint */
.protein-field-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 7px;
  line-height: 1.5;
}

/* Unit Toggle */
.protein-unit-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.protein-unit-toggle button {
  border: none;
  background: var(--bg);
  padding: 0 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.protein-unit-toggle button.active {
  background: var(--eat-green);
  color: #fff;
  font-weight: 700;
}

.protein-unit-toggle button:focus-visible {
  outline: 2px solid var(--eat-green);
  outline-offset: -2px;
}

/* Binary Toggle (for maintain yes/no) */
.protein-binary-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.protein-binary-toggle button {
  flex: 1;
  border: none;
  background: var(--bg);
  padding: 11px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.protein-binary-toggle button.active {
  background: var(--eat-green);
  color: #fff;
  font-weight: 700;
}

.protein-binary-toggle button:focus-visible {
  outline: 2px solid var(--eat-green);
  outline-offset: -2px;
}

/* Calculate Button */
.protein-calc-btn {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
  background: var(--eat-green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.protein-calc-btn:hover {
  background: var(--eat-green-dark);
}

.protein-calc-btn:focus-visible {
  outline: 2px solid var(--eat-green-dark);
  outline-offset: 2px;
}

/* Result */
.protein-result {
  display: none;
  margin-top: 24px;
  background: var(--eat-green-light);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}

.protein-result.visible {
  display: block;
}

.protein-result-label {
  font-size: 12px;
  color: var(--eat-green-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin: 0 0 4px;
}

.protein-result-number {
  font-family: 'Fraunces', serif;
  font-size: 42px;
  font-weight: 600;
  color: var(--eat-green-dark);
  margin: 0;
  line-height: 1;
}

.protein-result-unit {
  font-size: 14px;
  color: var(--eat-green-dark);
  margin: 4px 0 0;
}

.protein-result-range {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 12px 0 0;
  line-height: 1.5;
}

.protein-context-note {
  font-size: 12px;
  color: var(--eat-green-dark);
  line-height: 1.6;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(76, 100, 68, 0.2);
  text-align: left;
}

.protein-context-note strong {
  font-weight: 700;
}

/* Disclaimer */
.protein-disclaimer {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Error */
.protein-error {
  color: #A0442E;
  font-size: 12px;
  margin-top: 6px;
  display: none;
}

.protein-error.visible {
  display: block;
}
