:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --surface: #ffffff;
  --text: #17201c;
  --muted: #66736d;
  --line: #dbe2dd;
  --primary: #0c7a5a;
  --primary-dark: #075f46;
  --accent: #f2b84b;
  --danger: #b42318;
  --shadow: 0 18px 40px rgba(23, 32, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(12, 122, 90, 0.12), transparent 280px),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 28px 16px 36px;
}

.brand {
  padding: 12px 2px 22px;
  text-align: center;
}

.brand-label {
  margin: 0;
  font-size: clamp(2.3rem, 12vw, 4rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.calculator {
  padding: 22px;
  border: 1px solid rgba(219, 226, 221, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.back-link {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-weight: 900;
  text-decoration: none;
}

.back-link:focus-visible,
.portal-card:focus-visible,
select:focus {
  outline: 4px solid rgba(242, 184, 75, 0.55);
  outline-offset: 3px;
}

h1 {
  margin: 0 0 22px;
  font-size: clamp(1.55rem, 7vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.short-note {
  margin: -12px 0 20px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.portal-list {
  display: grid;
  gap: 12px;
}

.portal-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fbfcfa;
  text-decoration: none;
}

.portal-card strong {
  font-size: 1.08rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.portal-card span {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.portal-card:hover {
  border-color: var(--primary);
  background: #e9f6f1;
}

form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  min-height: 58px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 15px;
  color: var(--text);
  background: #fbfcfa;
  font-size: 1.2rem;
  font-weight: 800;
  outline: none;
}

input::placeholder {
  color: #9aa6a0;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(12, 122, 90, 0.13);
}

.input-with-suffix {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.input-with-suffix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(12, 122, 90, 0.13);
}

.input-with-suffix input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.input-with-suffix span {
  padding-right: 15px;
  color: var(--muted);
  font-weight: 800;
}

.period-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.choice-group {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-group legend {
  color: var(--text);
  font-weight: 800;
}

.choice-group label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.choice-group input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.help-text {
  min-height: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.adjust-box {
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.adjust-box summary {
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 900;
}

.adjust-box[open] {
  display: grid;
  gap: 14px;
}

.calculate-button {
  min-height: 62px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 12px 22px rgba(12, 122, 90, 0.24);
  cursor: pointer;
}

.calculate-button:active {
  transform: translateY(1px);
}

.calculate-button:focus-visible {
  outline: 4px solid rgba(242, 184, 75, 0.55);
  outline-offset: 3px;
}

.result {
  margin-top: 22px;
  padding: 20px;
  border-radius: 8px;
  background: #17201c;
  color: #ffffff;
}

.result-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 900;
}

.saved-summary {
  display: grid;
  gap: 4px;
  margin: 8px 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.saved-summary span {
  color: rgba(255, 255, 255, 0.76);
  font-weight: 700;
}

.saved-summary strong {
  font-size: clamp(2.05rem, 11vw, 3.05rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.comparison-list {
  display: grid;
  gap: 10px;
}

.comparison-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.comparison-item span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.comparison-item strong {
  font-size: clamp(1.55rem, 8vw, 2.25rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.comparison-item small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.3;
}

.comparison-item.unavailable strong {
  font-size: 1.1rem;
  line-height: 1.25;
}

.result-lines {
  display: grid;
  gap: 10px;
}

.result-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.result-lines span {
  color: rgba(255, 255, 255, 0.76);
  font-weight: 700;
  line-height: 1.3;
}

.result-lines strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.fgts-box {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.fgts-box span,
.fgts-box small {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  line-height: 1.3;
}

.fgts-box strong {
  font-size: 1.35rem;
}

.simulation-note {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  line-height: 1.35;
}

.simulation-note span {
  display: block;
  margin-top: 4px;
}

.rates-used {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  line-height: 1.35;
}

.rates-used p {
  margin: 0 0 2px;
  color: var(--accent);
  font-weight: 900;
}

.error {
  min-height: 18px;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 700;
}

.hidden {
  display: none;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.site-footer a,
.site-footer button {
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.cookie-consent {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 10;
  display: grid;
  gap: 12px;
  width: min(100% - 32px, 520px);
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cookie-consent.hidden {
  display: none;
}

.cookie-consent p {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

.cookie-consent div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cookie-consent button {
  min-height: 42px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--primary-dark);
  background: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.cookie-consent button:first-child {
  color: #ffffff;
  background: var(--primary);
}

.cookie-consent a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.privacy-page {
  display: grid;
  gap: 12px;
}

.privacy-page h2 {
  margin: 8px 0 0;
  font-size: 1.05rem;
}

.privacy-page p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.privacy-action {
  min-height: 48px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  color: var(--primary-dark);
  background: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

@media (min-width: 760px) {
  .app {
    padding-top: 48px;
  }

  .calculator {
    padding: 30px;
  }
}

@media (max-width: 360px) {
  .calculator {
    padding: 18px;
  }

  .period-grid {
    grid-template-columns: 1fr;
  }

  .result-lines div {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-lines strong {
    text-align: left;
  }
}
