:root {
  color-scheme: light;
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --ink: #1c2d35;
  --muted: #60717a;
  --line: #dce5e9;
  --brand: #0b6fb8;
  --brand-dark: #07568f;
  --brand-soft: #e8f3fb;
  --focus: #0b6fb8;
  --shadow: 0 16px 42px rgba(29, 55, 63, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(11, 111, 184, 0.08), transparent 28rem),
    var(--bg);
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1.65;
}

button,
select {
  font: inherit;
}

button,
a,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand-dark);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(100% - 28px, 920px);
  margin-inline: auto;
}

.site-header {
  padding: 28px 0 46px;
}

.hero {
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-block-end: 30px;
  background: transparent;
  text-decoration: none;
}

.brand__logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 180px;
  object-fit: contain;
  object-position: center;
  background: transparent;
  filter: none;
  opacity: 1;
}

h1,
h2,
h3,
h4,
p {
  margin-block-start: 0;
}

h1 {
  max-width: 680px;
  margin: 0 auto 14px;
  font-size: clamp(2rem, 7vw, 3.55rem);
  line-height: 1.22;
  letter-spacing: -0.035em;
}

.hero__description {
  max-width: 650px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
}

.main-content {
  margin-block-end: 38px;
}

.calculator-card,
.join-card {
  border: 1px solid rgba(210, 222, 227, 0.84);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.calculator-card {
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin: 12px 12px 0;
  padding: 4px;
  border: 1px solid #d9e1e6;
  border-radius: 14px;
  background: #eef1f4;
}

.tab {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.tab:hover {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.tab.is-active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 3px 10px rgba(11, 111, 184, 0.2);
}

.tab-panel {
  padding: 22px 18px 26px;
}

.tab-panel[hidden],
[hidden] {
  display: none !important;
}

.panel-heading {
  display: flex;
  align-items: center;
  margin-block-end: 28px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.45rem;
}

.form-grid {
  display: grid;
  gap: 20px;
}

.field,
.field-group {
  min-width: 0;
}

.field-group {
  margin: 0;
  padding: 0;
  border: 0;
}

label,
legend {
  display: block;
  margin-block-end: 8px;
  color: #263b43;
  font-size: 0.9rem;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 50px;
  padding: 0 13px;
  border: 1px solid #cbd8dd;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  outline: 0;
}

select:hover:not(:disabled) {
  border-color: #98afaf;
}

select:disabled {
  color: #89979c;
  background: #f1f4f5;
  cursor: not-allowed;
}

.field-hint {
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.date-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented-control label {
  display: grid;
  place-items: center;
  min-height: 48px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #cbd8dd;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  text-align: center;
}

.segmented-control input:checked + label {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.employment-status-control label {
  border-color: var(--brand);
  color: var(--ink);
  background: #fff;
}

.employment-status-control input:checked + label {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
  box-shadow: none;
}

.form-actions,
.result-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-block-start: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.form-actions .button {
  width: 100%;
}

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

.button--primary {
  color: #fff;
  background: var(--brand);
}

.button--primary:hover {
  background: var(--brand-dark);
}

.button--secondary {
  border-color: #cbd8dd;
  color: #42575f;
  background: #fff;
}

.button--secondary:hover {
  border-color: #99acad;
  background: #f6f9f9;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
summary:focus-visible,
.segmented-control input:focus-visible + label {
  outline: 3px solid rgba(11, 111, 184, 0.32);
  outline-offset: 3px;
}

.results {
  margin-block-start: 30px;
  padding-block-start: 26px;
  scroll-margin-block-start: 20px;
  border-block-start: 1px solid var(--line);
}

.results h3 {
  font-size: 1.15rem;
}

.results-grid {
  display: grid;
  gap: 12px;
}

#grade-results .results-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

#title-results .results-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.result-card {
  min-height: 90px;
  padding: 18px;
  border: 1px solid;
  border-radius: var(--radius-md);
}

#grade-results .result-card {
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  padding: 20px;
  box-sizing: border-box;
}

#title-results .result-card {
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  padding: 20px;
  box-sizing: border-box;
}

#grade-results .result-card > h4 {
  margin-block-end: 12px;
  line-height: 1.35;
}

.result-card > h4 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1rem;
}

.result-list,
.grade-result,
.timeline-event__details {
  display: grid;
  gap: 10px;
}

#grade-results .result-card__content,
#grade-results .result-list,
#grade-results .grade-result,
#grade-results .result-timeline,
#grade-results .timeline-event,
#grade-results .timeline-event__details,
#grade-results .details-content {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  min-height: 0;
  box-sizing: border-box;
}

#title-results .result-card__content,
#title-results .result-list,
#title-results .title-result,
#title-results .result-timeline,
#title-results .timeline-event,
#title-results .timeline-event__details,
#title-results .details-content {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  min-height: 0;
  box-sizing: border-box;
}

#grade-results .result-list,
#grade-results .grade-result,
#grade-results .result-timeline,
#grade-results .timeline-event,
#grade-results .timeline-event__details {
  display: block;
}

#title-results .result-list,
#title-results .title-result,
#title-results .result-timeline,
#title-results .timeline-event,
#title-results .timeline-event__details {
  display: block;
}

.result-row {
  display: grid;
  gap: 3px;
  padding-block: 2px;
}

#grade-results .result-row {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding-block: 10px;
  border-block-end: 1px solid rgba(35, 96, 128, 0.16);
  box-sizing: border-box;
  line-height: 1.35;
}

#title-results .result-row {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding-block: 10px;
  border-block-end: 1px solid rgba(35, 96, 128, 0.16);
  box-sizing: border-box;
  line-height: 1.35;
}

#title-results .result-row:first-child {
  padding-block-start: 0;
}

#title-results .result-row:last-child {
  padding-block-end: 0;
  border-block-end: 0;
}

#title-results .result-row__label,
#title-results .result-row__value {
  display: block;
}

#title-results .result-row__value {
  margin-block-start: 3px;
}

#grade-results .result-row:first-child {
  padding-block-start: 0;
}

#grade-results .result-row:last-child {
  padding-block-end: 0;
  border-block-end: 0;
}

#grade-results .result-row__label,
#grade-results .result-row__value {
  display: block;
}

#grade-results .result-row__value {
  margin-block-start: 3px;
}

.result-row__label {
  color: var(--muted);
  font-size: 0.8rem;
}

.result-row__value {
  color: var(--ink);
  font-size: 1rem;
}

.grade-result__separator {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin-block: 12px;
  padding-block: 4px;
  border-block: 1px solid rgba(35, 96, 128, 0.16);
  color: var(--brand);
  font-size: 1rem;
  line-height: 1;
  text-align: center;
}

.financial-increase,
.financial-increase__section {
  width: 100%;
  height: auto;
}

.financial-increase__section + .financial-increase__section {
  margin-block-start: 18px;
  padding-block-start: 16px;
  border-block-start: 1px solid rgba(71, 86, 94, 0.14);
}

.financial-increase__section h5 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 0.95rem;
}

.financial-increase__note {
  margin: 18px 0 0;
  padding-block-start: 14px;
  border-block-start: 1px solid rgba(71, 86, 94, 0.14);
  color: var(--muted);
  font-size: 0.84rem;
}

#title-results .title-result .result-row {
  padding-block: 7px;
}

#title-results .title-result .result-row:first-child {
  padding-block-start: 0;
}

#title-results .title-result .result-row:last-child {
  padding-block-end: 0;
}

#title-results .title-result .grade-result__separator {
  margin-block: 7px;
  padding-block: 3px;
  font-size: 1.2rem;
  font-weight: 700;
}

#title-results .financial-increase__section + .financial-increase__section {
  margin-block-start: 20px;
  padding-block-start: 18px;
  border-block-start-color: rgba(11, 111, 184, 0.28);
}

.result-timeline {
  display: grid;
  gap: 0;
  padding-inline-start: 16px;
  border-inline-start: 2px solid rgba(11, 111, 184, 0.24);
}

.timeline-event {
  display: grid;
  height: auto;
  min-height: 0;
  padding: 0;
}

.timeline-event + .timeline-event {
  margin-block-start: 18px;
  padding-block-start: 16px;
  border-block-start: 1px solid rgba(71, 86, 94, 0.14);
}

.timeline-event__details {
  margin-block-start: 8px;
}

.timeline-event__details .result-row {
  padding-block: 3px;
  border-block-end: 0;
}

#grade-results .timeline-event__details .result-row__label,
#grade-results .timeline-event__details .result-row__value {
  display: inline;
  margin: 0;
}

.timeline-event__details .result-row__label::after {
  content: ":";
}

.timeline-event__date {
  color: var(--brand-dark);
  font-size: 1rem;
  font-weight: 800;
}

.result-card--blue {
  border-color: #c8dff1;
  background: #eef7fc;
}

.result-card--green {
  border-color: #c7e5d6;
  background: #eef9f3;
}

.result-card--orange {
  border-color: #edd8be;
  background: #fff7ed;
}

.result-card--purple {
  border-color: #dacfeb;
  background: #f7f2fc;
}

.result-card--gray {
  min-height: auto;
  border-color: #d9e0e3;
  background: #f5f7f8;
}

.result-card summary {
  cursor: pointer;
  font-weight: 700;
}

.result-card ul {
  margin-block-end: 0;
  padding-inline-start: 22px;
}

.details-content {
  padding-block-start: 12px;
  color: #455b64;
}

.details-content h4 {
  margin-block: 17px 5px;
  color: var(--ink);
}

#grade-results .details-content {
  padding-block-start: 14px;
  color: #324b55;
}

#grade-results .details-content > ul {
  margin: 0;
  padding-inline-start: 22px;
}

#grade-results .details-content li + li {
  margin-block-start: 7px;
}

#grade-results .details-content h4 {
  margin: 20px 0 8px;
  color: var(--ink);
  font-size: 0.95rem;
}

.dynamic-notes {
  width: 100%;
  height: auto;
  padding: 13px 14px;
  border: 1px solid rgba(11, 111, 184, 0.2);
  border-radius: 10px;
  box-sizing: border-box;
  color: #324b55;
  background: rgba(238, 247, 252, 0.84);
  text-align: start;
}

.dynamic-notes:not([hidden]) + ul {
  margin-block-start: 16px;
}

.dynamic-note {
  margin: 0;
}

.dynamic-note + .dynamic-note:not([hidden]) {
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px solid rgba(11, 111, 184, 0.16);
}

.results-disclaimer {
  margin: 18px 0 0;
  padding-block-start: 14px;
  border-block-start: 1px solid #d9e0e3;
}

.join-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-block-start: 20px;
  padding: 24px 20px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(232, 243, 251, 0.92), rgba(255, 255, 255, 0.97) 62%);
  text-align: center;
}

.join-card h2 {
  margin-block-end: 8px;
  font-size: 1.45rem;
}

.join-card p {
  margin: 0;
  color: var(--muted);
}

.button--telegram {
  width: min(100%, 360px);
  color: #fff;
  background: var(--brand);
}

.button--telegram:hover {
  background: var(--brand-dark);
}

.site-footer {
  padding: 26px 0 34px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.site-footer p {
  margin-block-end: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (min-width: 480px) {
  .date-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .result-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 680px) {
  .brand__logo {
    max-width: 220px;
  }

  .site-header {
    padding-block-start: 40px;
  }

  .hero__description {
    font-size: 1.06rem;
  }

  .tab-panel {
    padding: 34px 38px 40px;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }

  .field-group--full {
    grid-column: 1 / -1;
  }

  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #title-results .result-card--gray {
    grid-column: 1 / -1;
  }

  .join-card {
    padding: 28px 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
