:root {
  --navy-900: #0a1f44;
  --navy-800: #102a59;
  --navy-700: #15346b;
  --green-600: #1f9d6a;
  --green-700: #177a52;
  --green-100: #e7f7f0;
  --red-600: #b93838;
  --red-100: #fdeaea;
  --white: #ffffff;
  --gray-25: #fbfcfe;
  --gray-50: #f5f7fa;
  --gray-100: #e9eef5;
  --gray-200: #dbe5f1;
  --gray-500: #66738d;
  --gray-600: #4e5d78;
  --gray-800: #273246;
  --shadow-sm: 0 2px 10px rgba(10, 31, 68, 0.08);
  --shadow-md: 0 10px 30px rgba(10, 31, 68, 0.12);
  --radius-md: 12px;
  --radius-lg: 16px;
  --max-width: 1080px;
  --header-height: 72px;
  --focus-ring: 0 0 0 3px rgba(31, 157, 106, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background: linear-gradient(180deg, #f9fbfd 0%, var(--gray-50) 100%);
  min-height: 100vh;
}

a {
  color: var(--navy-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-height);
  background: rgba(10, 31, 68, 0.96);
  color: var(--white);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(140%) blur(6px);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.2px;
  color: var(--white);
  white-space: nowrap;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.site-nav a {
  color: var(--white);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  opacity: 0.95;
}

.site-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  opacity: 1;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
}

main {
  padding-top: calc(var(--header-height) + 1.25rem);
  padding-bottom: 7rem;
}

.panel {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.hero-intro {
  margin-bottom: 1rem;
}

.hero-intro h1 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  line-height: 1.25;
}

.hero-intro p {
  margin: 0.6rem 0 0;
  color: var(--gray-600);
}

.calculator-layout {
  display: grid;
  gap: 1rem;
}

.calculator-form {
  display: grid;
  gap: 0.9rem;
}

.input-grid {
  display: grid;
  gap: 0.85rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
  color: var(--navy-800);
  font-size: 0.95rem;
}

.field input,
.field textarea {
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.78rem;
  font-size: 0.96rem;
  color: var(--gray-800);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--gray-500);
}

.field input.input-invalid,
.field textarea.input-invalid {
  border-color: #d14646;
  background: #fff4f4;
}

.helper-text {
  font-size: 0.82rem;
  color: var(--gray-600);
}

.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

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

.btn-primary {
  background: var(--green-600);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--green-700);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-secondary:hover {
  background: #dce6f3;
}

.validation-box {
  display: none;
  border: 1px solid #f0b7b7;
  background: var(--red-100);
  color: #8c2b2b;
  border-left: 4px solid #c53a3a;
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 0.9rem;
}

.validation-box.is-visible {
  display: block;
}

.results-grid {
  display: grid;
  gap: 0.8rem;
}

.result-card {
  background: var(--gray-25);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
}

.report-card {
  overflow: hidden;
}

.report-output {
  margin-top: 0.5rem;
}

.report-placeholder {
  margin: 0;
  color: var(--gray-600);
  font-size: 0.92rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.9rem;
}

.report-table thead th {
  text-align: left;
  background: #f0f5fc;
  color: var(--navy-900);
  font-size: 0.86rem;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--gray-100);
  padding: 0.62rem 0.7rem;
  vertical-align: top;
}

.report-table tbody th {
  text-align: left;
  color: #31415d;
  width: 62%;
}

.report-table tbody td {
  color: var(--navy-900);
  font-weight: 600;
}

.report-table .group-row th {
  background: #f8fbff;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 0.78rem;
}

.report-table tbody tr:last-child th,
.report-table tbody tr:last-child td {
  border-bottom: 0;
}

.result-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--gray-600);
  text-transform: uppercase;
}

.result-value {
  margin: 0.2rem 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy-900);
}

.recommendation-card {
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--gray-100);
  background: var(--gray-25);
}

.recommendation-card p {
  margin: 0;
  font-size: 0.93rem;
}

.recommendation-card.good {
  background: var(--green-100);
  border-color: #b7e4d1;
}

.recommendation-card.caution {
  background: #fff8e6;
  border-color: #f0d58a;
}

.recommendation-card.risk {
  background: var(--red-100);
  border-color: #f1c2c2;
}

.recommendation-card.neutral {
  background: var(--gray-25);
  border-color: var(--gray-100);
}

.recommendation-card.success {
  background: var(--green-100);
  border-color: #b7e4d1;
}

.recommendation-card.warning {
  background: #fff8e6;
  border-color: #f0d58a;
}

.recommendation-card.danger {
  background: var(--red-100);
  border-color: #f1c2c2;
}

.tool-disclaimer {
  margin: 0.7rem 0 0;
  color: var(--gray-600);
  font-size: 0.85rem;
}

#seo-content-area {
  margin-top: 1rem;
}

#seo-content-area h2 {
  margin: 0 0 0.55rem;
  color: var(--navy-900);
  font-size: 1.3rem;
  line-height: 1.3;
}

#seo-content-area h3 {
  margin: 1.1rem 0 0.5rem;
  color: var(--navy-800);
  font-size: 1.08rem;
}

#seo-content-area p {
  margin: 0.7rem 0;
  color: #35435c;
}

#seo-content-area ul {
  margin: 0.6rem 0 0.8rem;
  padding-left: 1.2rem;
}

#seo-content-area li {
  margin: 0.28rem 0;
  color: #35435c;
}

.faq-block {
  margin-top: 1.2rem;
  border-top: 1px solid var(--gray-100);
  padding-top: 1rem;
}

.faq-item {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 0.82rem 0.92rem;
  margin-top: 0.75rem;
  background: var(--gray-25);
}

.faq-item h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.author-bio {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  align-items: center;
  background: var(--gray-25);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: #f2f6fc;
}

.author-bio h2 {
  margin: 0 0 0.35rem;
  color: var(--navy-900);
  font-size: 1.1rem;
}

.author-bio p {
  margin: 0;
  color: var(--gray-600);
}

.page-shell h1 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(1.35rem, 3.4vw, 1.9rem);
}

.page-shell p,
.page-shell li {
  color: #35435c;
}

.contact-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.contact-note {
  background: var(--gray-25);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.9rem;
}

.not-found-panel {
  text-align: center;
}

.not-found-panel p {
  max-width: 60ch;
  margin-inline: auto;
}

.site-footer {
  border-top: 1px solid var(--gray-100);
  background: var(--white);
  padding: 1.25rem 0 6rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: center;
  text-align: center;
  color: var(--gray-600);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
}

.footer-links a {
  color: var(--navy-700);
  font-weight: 500;
}

.footer-links a[aria-current="page"] {
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  background: #0d2b5d;
  color: var(--white);
  box-shadow: var(--shadow-md);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.cookie-banner.is-hidden {
  display: none;
}

.cookie-inner {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem 0;
}

.cookie-text {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.96);
}

.cookie-action {
  justify-self: start;
}

.btn-accept {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--green-600);
  color: var(--white);
}

.btn-accept:hover {
  background: var(--green-700);
}

@media (min-width: 640px) {
  .cookie-inner {
    grid-template-columns: 1fr auto;
    gap: 1rem;
  }

  .cookie-action {
    justify-self: end;
  }
}

@media (min-width: 768px) {
  .header-inner {
    gap: 1.5rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .site-nav a {
    font-size: 0.95rem;
  }

  .calculator-layout {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }

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

  .input-grid .field:last-child {
    grid-column: span 2;
  }

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

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

  .contact-grid .field:last-child,
  .contact-grid .field:nth-last-child(2) {
    grid-column: span 2;
  }

  .author-bio {
    grid-template-columns: auto 1fr;
  }
}
