:root {
  --bg: #f6f1e7;
  --bg-alt: #efe3d2;
  --text: #1f1b16;
  --muted: #60584d;
  --accent: #2c7c70;
  --accent-strong: #1f564f;
  --accent-warm: #f2a13a;
  --card: rgba(255, 255, 255, 0.78);
  --border: rgba(31, 27, 22, 0.14);
  --shadow: 0 24px 70px rgba(31, 27, 22, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #fff9f0 0%, var(--bg) 55%, #efe6d7 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: "Unbounded", "Space Grotesk", sans-serif;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  position: relative;
  z-index: 1;
}

.hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.45));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 36px 40px 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  margin-bottom: 36px;
  animation: floatIn 0.8s ease forwards;
}

.hero__tag {
  display: inline-flex;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-strong);
  background: rgba(44, 124, 112, 0.12);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.2;
}

.hero p {
  font-size: 16px;
  margin-top: 12px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero__meta span {
  font-size: 13px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: 28px;
  align-items: start;
}

.inputs {
  display: grid;
  gap: 22px;
}

.results {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(31, 27, 22, 0.1);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(20px);
  animation: floatIn 0.7s ease forwards;
  animation-delay: var(--delay, 0ms);
}

.card__head {
  margin-bottom: 20px;
}

.card__head h2 {
  font-size: 20px;
}

.card__head p {
  font-size: 14px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

input,
select {
  border: 1px solid rgba(31, 27, 22, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.9);
  transition: border 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  width: 100%;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2360584d' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 8px;
  padding-right: 38px;
  cursor: pointer;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(44, 124, 112, 0.7);
  box-shadow: 0 0 0 3px rgba(44, 124, 112, 0.15);
}

input:disabled,
select:disabled {
  opacity: 0.6;
}

input[readonly] {
  opacity: 0.75;
  background: rgba(255, 255, 255, 0.65);
}

input::placeholder {
  color: rgba(96, 88, 77, 0.55);
}

.info-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-strong);
  background: rgba(44, 124, 112, 0.12);
  border: 1px solid rgba(44, 124, 112, 0.35);
  cursor: help;
  position: relative;
  line-height: 1;
}

.info-icon:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 124, 112, 0.2);
}

.info-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 260px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 20;
}

.info-tooltip::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent rgba(255, 255, 255, 0.98) transparent;
}

.info-icon:hover .info-tooltip,
.info-icon:focus .info-tooltip {
  opacity: 1;
  visibility: visible;
}

.search {
  display: flex;
  gap: 10px;
}

.search input {
  flex: 1;
}

button {
  font-family: inherit;
}

button.ghost {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

button.ghost:hover {
  border-color: rgba(44, 124, 112, 0.4);
  color: var(--accent-strong);
}

.selection {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(44, 124, 112, 0.08);
  border: 1px dashed rgba(44, 124, 112, 0.4);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.details {
  margin-top: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.6);
}

.details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-strong);
  margin-bottom: 12px;
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
  z-index: 5;
  max-height: 340px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggestions__header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.suggestions__list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.suggestions__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggestions__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
}

.suggestion {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(244, 238, 229, 0.6);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.suggestion:hover {
  border-color: rgba(44, 124, 112, 0.4);
  background: rgba(44, 124, 112, 0.08);
}

.suggestion__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.suggestion__meta {
  font-size: 12px;
  color: var(--muted);
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(31, 27, 22, 0.08);
  font-size: 14px;
}

.metric:last-child {
  border-bottom: none;
}

.metric strong {
  font-size: 16px;
}

.metric--total {
  font-weight: 700;
  color: var(--accent-strong);
  padding-top: 14px;
}

.card--result h2 {
  font-size: 18px;
}

.card--note {
  background: linear-gradient(140deg, rgba(44, 124, 112, 0.12), rgba(242, 161, 58, 0.18));
  border: 1px solid rgba(44, 124, 112, 0.3);
}

.card--note ul {
  margin: 12px 0 18px;
  padding-left: 18px;
  color: var(--muted);
}

.status {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
}

.status.ok {
  color: #1f6d5f;
  border-color: rgba(31, 109, 95, 0.3);
}

.status.warn {
  color: #a56a1c;
  border-color: rgba(165, 106, 28, 0.3);
}

.status.error {
  color: #a3422a;
  border-color: rgba(163, 66, 42, 0.3);
}

.footer {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
}

.hidden {
  display: none;
}

.bg-blur {
  position: fixed;
  inset: auto;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  z-index: 0;
}

.bg-blur--one {
  background: #f2a13a;
  top: -80px;
  right: 10%;
}

.bg-blur--two {
  background: #2c7c70;
  bottom: -120px;
  left: 5%;
}

.noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .results {
    position: static;
  }

  .footer {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 28px;
  }

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