/* Regla Salary Calculator — regla-calculator.css */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ── Reset / Scope ─────────────────────────────────────────────────────────── */
.regla-calculator *,
.regla-calculator *::before,
.regla-calculator *::after {
  box-sizing: border-box;
}

.regla-calculator {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #212121;
  line-height: 1.5;
}

/* ── Wrapper ───────────────────────────────────────────────────────────────── */
.rc-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fff;
  padding: 1.5rem;
  border-radius: 16px;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.rc-title {
  font-size: 32px;
  font-weight: 700;
  color: #04564c;
  margin: 0 0 2px;
}
.rc-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

/* ── Top row (3-col grid) ──────────────────────────────────────────────────── */
.rc-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

/* ── Salary card ───────────────────────────────────────────────────────────── */
.rc-salary-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.rc-salary-labels {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
}

.rc-field-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rc-salary-inputs {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.rc-salary-input {
  background: #f5f5f5;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 24px;
  font-weight: 700;
  color: #212121;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s;
}
.rc-salary-input:focus {
  outline: none;
  border-color: #04564c;
  background: #fff;
}

.rc-pct-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rc-starfshlutfall {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  width: 64px;
  color: #212121;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  background: #f5f5f5;
  transition: border-color 0.15s;
}
.rc-starfshlutfall:focus {
  outline: none;
  border-color: #04564c;
  background: #fff;
}

.rc-pct-symbol {
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
}

.rc-slider {
  width: 100%;
  accent-color: #04564c;
  cursor: pointer;
}

.rc-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
}

.rc-hlunnindi-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
}

.rc-hlunnindi-hint {
  font-size: 10px;
  color: #94a3b8;
}

.rc-hlunnindi-input {
  background: #f5f5f5;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 18px;
  font-weight: 700;
  color: #212121;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s;
}
.rc-hlunnindi-input:focus {
  outline: none;
  border-color: #04564c;
  background: #fff;
}

/* ── Hero cards (shared base) ──────────────────────────────────────────────── */
.rc-ee-hero,
.rc-er-hero {
  border-radius: 12px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
}

/* ── EE hero ───────────────────────────────────────────────────────────────── */
.rc-ee-hero {
  background: #EFF9E4;
  border: 2px solid #88C93C;
}

.rc-hero-label {
  font-size: 10px;
  font-weight: 700;
  color: #04564c;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 6px;
}

.rc-hero-amount {
  display: block;
  font-size: 36px;
  font-weight: 700;
  color: #04564c;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rc-hero-sub {
  display: block;
  font-size: 12px;
  color: #04564c;
  opacity: 0.65;
  margin-top: 4px;
}

/* ── ER hero ───────────────────────────────────────────────────────────────── */
.rc-er-hero {
  background: #04564c;
}

.rc-hero-label-er {
  color: #fff;
}

.rc-hero-amount-er {
  color: #fff;
}

.rc-hero-sub-er {
  color: rgba(255,255,255,0.55);
  opacity: 1;
}

/* ── Hero breakdown ─────────────────────────────────────────────────────────── */
.rc-hero-breakdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(4,86,76,0.15);
}

.rc-hero-breakdown-er {
  border-top-color: rgba(255,255,255,0.18);
}

.rc-hbd-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.rc-hbd-label {
  font-size: 12px;
  color: rgba(4,86,76,0.7);
}

.rc-hbd-label-er {
  color: rgba(255,255,255,0.55);
}

.rc-hbd-amount {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #04564c;
  white-space: nowrap;
}

.rc-hbd-amount-er {
  color: rgba(255,255,255,0.85);
}

.rc-hbd-neg {
  color: #6b7280;
}

/* ── Bar ───────────────────────────────────────────────────────────────────── */
.rc-hero-bar-wrap {
  margin-top: 14px;
}

.rc-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  gap: 2px;
}

/* EE bar segment colors */
.rc-bar-ee-net { background: #04564c; cursor: pointer; }
.rc-bar-ee-tax { background: #94a3b8; cursor: pointer; }
.rc-bar-ee-pen { background: #88C93C; cursor: pointer; }
.rc-bar-ee-uni { background: #94a3b8; cursor: pointer; }

.rc-bar-ee-net:hover,
.rc-bar-ee-tax:hover,
.rc-bar-ee-pen:hover,
.rc-bar-ee-uni:hover {
  filter: brightness(1.15);
}

/* ER bar segment colors */
.rc-er-bar-net { background: #cfef50; cursor: pointer; }
.rc-er-bar-rik { background: rgba(255,255,255,0.72); cursor: pointer; }
.rc-er-bar-sve { background: rgba(255,255,255,0.42); cursor: pointer; }
.rc-er-bar-lif { background: #88C93C; cursor: pointer; }
.rc-er-bar-ste { background: rgba(255,255,255,0.22); cursor: pointer; }

.rc-er-bar-net:hover,
.rc-er-bar-rik:hover,
.rc-er-bar-sve:hover,
.rc-er-bar-lif:hover,
.rc-er-bar-ste:hover {
  filter: brightness(1.15);
}

/* ── Legend ────────────────────────────────────────────────────────────────── */
.rc-legend {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  row-gap: 4px;
}

.rc-leg-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #04564c;
}

.rc-er-hero .rc-leg-item {
  color: rgba(255,255,255,0.85);
}

.rc-leg-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
  display: inline-block;
}

/* EE legend dots */
.rc-dot-ee-net { background: #04564c; }
.rc-dot-ee-tax { background: #94a3b8; }
.rc-dot-ee-pen { background: #88C93C; }
.rc-dot-ee-uni { background: #94a3b8; }

/* ER legend dots */
.rc-er-dot-net { background: #cfef50; }
.rc-er-dot-rik { background: rgba(255,255,255,0.72); }
.rc-er-dot-sve { background: rgba(255,255,255,0.42); }
.rc-er-dot-lif { background: #88C93C; }
.rc-er-dot-ste { background: rgba(255,255,255,0.22); }

.rc-leg-pct { font-weight: 700; }


/* ── Cards row (3-col grid) ────────────────────────────────────────────────── */
.rc-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

/* ── Category card ─────────────────────────────────────────────────────────── */
.rc-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
}

.rc-card-header {
  background: #04564c;
  border-radius: 12px 12px 0 0;
  padding: 10px 16px;
}

.rc-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #cfef50;
}

.rc-card-body {
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
}

/* ── Column headers ────────────────────────────────────────────────────────── */
.rc-col-headers {
  display: grid;
  grid-template-columns: 1fr 52px 80px;
  gap: 4px;
  margin-bottom: 2px;
}

.rc-col-head {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  text-align: right;
}
.rc-col-headers span:nth-child(2) { text-align: center; }

/* ── Section label ─────────────────────────────────────────────────────────── */
.rc-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #04564c;
  letter-spacing: 0.05em;
  margin-top: 6px;
  margin-bottom: 2px;
  display: block;
}

/* ── Card row (label | input | amount) ─────────────────────────────────────── */
.rc-card-row {
  display: grid;
  grid-template-columns: 1fr 52px 80px;
  gap: 4px;
  align-items: center;
}

.rc-row-label {
  font-size: 13px;
  color: #374151;
}

.rc-rate-input {
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  width: 100%;
  color: #212121;
  background: #f5f5f5;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rc-rate-input:hover {
  border-color: #94a3b8;
}
.rc-rate-input:focus {
  outline: none;
  border-color: #04564c;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(4,86,76,0.12);
}


/* Auto-populated inputs (from union selection) */
.rc-auto-input-active {
  border-color: #88C93C !important;
  background: #EFF9E4 !important;
  color: #04564c !important;
  font-weight: 700 !important;
}

/* ── Amount display ─────────────────────────────────────────────────────────── */
.rc-amount {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rc-deduct { color: #6b7280; }
.rc-credit  { color: #04564c; }
.rc-add     { color: #04564c; }
.rc-dim     { color: #94a3b8 !important; font-weight: 400 !important; }

/* Hint below personal credit */
.rc-hint-row {
  display: grid;
  grid-template-columns: 1fr 52px 80px;
  gap: 4px;
  margin-top: -3px;
  margin-bottom: 2px;
}
.rc-hint {
  text-align: right;
  font-size: 10px;
  color: #94a3b8;
  grid-column: 3;
}

/* ── Spacer (pushes chips to bottom) ────────────────────────────────────────── */
.rc-spacer { flex: 1; min-height: 8px; }

/* ── Chips ──────────────────────────────────────────────────────────────────── */
.rc-chips {
  display: flex;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.rc-chip {
  flex: 1;
  border-radius: 7px;
  padding: 7px 10px;
  text-align: center;
}

.rc-chip-ee {
  background: #EFF9E4;
  border: 1px solid #88C93C;
}

.rc-chip-er {
  background: #04564c;
  border: 1px solid #04564c;
}

.rc-chip-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 2px;
}

.rc-chip-ee .rc-chip-label { color: #04564c; }
.rc-chip-er .rc-chip-label { color: rgba(255,255,255,0.7); }

.rc-chip-amount {
  display: block;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rc-chip-ee .rc-chip-amount { color: #94a3b8; }
.rc-chip-er .rc-chip-amount { color: #fff; }

/* ── Union picker ───────────────────────────────────────────────────────────── */
.rc-union-picker {
  margin-bottom: 6px;
}

.rc-union-combo {
  position: relative;
  margin-top: 4px;
}

.rc-union-input {
  display: block;
  width: 100%;
  background: #EFF9E4;
  border: 1px solid #88C93C;
  border-radius: 7px;
  padding: 8px 30px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #04564c;
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2388C93C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.rc-union-input:focus {
  outline: none;
  border-color: #04564c;
  cursor: text;
}
.rc-union-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.rc-union-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 200;
}

.rc-union-option {
  padding: 8px 12px;
  font-size: 13px;
  color: #212121;
  cursor: pointer;
  line-height: 1.4;
}
.rc-union-option:hover,
.rc-union-option-active {
  background: #EFF9E4;
  color: #04564c;
}
.rc-union-option-selected {
  font-weight: 600;
  color: #04564c;
}

.rc-union-group-header {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid #f1f5f9;
}

.rc-union-no-results {
  padding: 12px;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
}

.rc-union-auto {
  font-size: 11px;
  color: #88C93C;
  font-weight: 500;
  display: block;
  margin-top: 3px;
}

.rc-hidden { display: none !important; }

/* ── Holiday toggle ─────────────────────────────────────────────────────────── */
.rc-holiday-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
}

.rc-toggle-label {
  font-size: 12px;
  color: #374151;
  font-weight: 600;
  cursor: pointer;
}

.rc-holiday-toggle {
  width: 32px;
  height: 18px;
  cursor: pointer;
  accent-color: #04564c;
  flex-shrink: 0;
}

/* ── Disclaimer ─────────────────────────────────────────────────────────────── */
.rc-disclaimer {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  margin: 0;
}

/* ── CTA block ──────────────────────────────────────────────────────────────── */
.rc-cta {
  background: #04564c;
  border-radius: 12px;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rc-cta-sub {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}

.rc-cta-btn {
  background: #cfef50;
  color: #04564c;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
  transition: opacity 0.15s;
}
.rc-cta-btn:hover { opacity: 0.9; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .rc-top-row,
  .rc-cards-row {
    grid-template-columns: 1fr 1fr;
  }
  .rc-salary-card { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .rc-wrapper { padding: 1rem; }
  .rc-top-row,
  .rc-cards-row {
    grid-template-columns: 1fr;
  }
  .rc-hero-amount,
  .rc-hero-amount-er {
    font-size: 28px;
  }
  .rc-cta {
    flex-direction: column;
    text-align: center;
    padding: 1.2rem;
  }
}
