:root {
  --glr-green: #8cc63f;
  --glr-green-dark: #6fa42d;
  --bg: #f3f4f1;
  --panel: #ffffff;
  --ink: #101010;
  --muted: #5d6258;
  --line: #dfe3d8;
  --soft: #eef4e7;
  --dark: #161616;
  --danger: #b42318;
  --star: #8cc63f;
  --shadow: 0 18px 50px rgba(16, 16, 16, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(135deg, rgba(140, 198, 63, 0.16) 0 24%, transparent 24% 100%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 68%, #e9eee2 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 10px;
  background: var(--glr-green);
  z-index: 10;
}

.app-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 32px;
}

.app-shell.wide {
  width: min(1180px, calc(100% - 32px));
}

.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--dark);
  color: #ffffff;
  border: 0;
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -80px;
  width: 240px;
  height: 240px;
  background: var(--glr-green);
  transform: rotate(18deg);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0 0 12px;
  max-width: 760px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  font-weight: 900;
}

.hero p,
.instruction,
.rating-label,
.result-card p {
  color: var(--muted);
}

.hero p:not(.eyebrow) {
  color: #e9e9e9;
  max-width: 760px;
  font-size: 1.08rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--glr-green);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

h2 {
  margin: 0 0 18px;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

input,
select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  padding: 15px 16px;
  font-size: 1rem;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(140, 198, 63, 0.35);
  outline-offset: 2px;
  border-color: var(--glr-green);
}

.primary-button,
.secondary-button {
  border-radius: 4px;
  padding: 14px 18px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.primary-button {
  border: 2px solid var(--glr-green);
  background: var(--glr-green);
  color: #111111;
}

.primary-button:hover {
  background: var(--glr-green-dark);
  border-color: var(--glr-green-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button {
  background: #ffffff;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.secondary-button:hover {
  background: var(--ink);
  color: #ffffff;
}

.inline-link {
  width: fit-content;
}

.hidden {
  display: none !important;
}

.section-header,
.actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.project-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 18px;
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--line);
  border-left: 8px solid var(--glr-green);
  border-radius: 4px;
  padding: 18px;
}

.project-card h3 {
  margin: 4px 0 0;
  letter-spacing: -0.02em;
}

.stand-number {
  margin: 0;
  color: var(--glr-green-dark);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.star-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.star-button {
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #f8faf4;
  color: #adb5a6;
  font-size: 1.4rem;
  cursor: pointer;
}

.star-button:hover {
  border-color: var(--glr-green);
}

.star-button.active {
  color: #111111;
  background: var(--star);
  border-color: var(--star);
}

.rating-label {
  grid-column: 1 / -1;
  margin: -6px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.sticky-submit {
  position: sticky;
  bottom: 0;
  margin-top: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid var(--line);
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 -10px 30px rgba(16, 16, 16, 0.08);
}

.sticky-submit p {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
}

.message {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  padding: 16px 18px;
  border-radius: 4px;
  font-weight: 900;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.message.error {
  background: #fff2f0;
  color: var(--danger);
  border: 2px solid #f2b8b5;
}

.success-card {
  text-align: center;
  border-top: 8px solid var(--glr-green);
}

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

.result-card {
  background: #ffffff;
  border: 2px solid var(--line);
  border-top: 8px solid var(--glr-green);
  border-radius: 4px;
  padding: 20px;
}

.result-card h2 {
  border-bottom: 2px solid var(--line);
  padding-bottom: 12px;
}

.top-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.top-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--soft);
  border: 1px solid #dce8cf;
  border-radius: 4px;
  padding: 14px;
}

.rank {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  color: var(--glr-green);
  font-weight: 900;
  flex: 0 0 auto;
}

.error-text {
  color: var(--danger);
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 920px);
    padding-top: 34px;
  }

  .card {
    padding: 20px;
  }

  .hero::after {
    width: 160px;
    height: 160px;
    right: -88px;
    top: -72px;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .star-row {
    justify-content: flex-start;
  }

  .star-button {
    width: 38px;
    height: 38px;
  }

  .sticky-submit {
    flex-direction: column;
    align-items: stretch;
  }

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