:root {
  color-scheme: light;
  --green-dark: #31462c;
  --green-main: #6f8f4e;
  --green-soft: #dfe8d2;
  --brown-dark: #4b382f;
  --brown-main: #6b5544;
  --beige-light: #f6f1e8;
  --beige-main: #e8dcc7;
  --text-main: #2f2a24;
  --white: #ffffff;
  --bg: var(--beige-light);
  --surface: var(--green-soft);
  --text: var(--text-main);
  --muted: var(--brown-main);
  --line: rgba(75, 56, 47, 0.18);
  --accent: var(--green-main);
  --accent-dark: var(--green-dark);
  --accent-blue: var(--green-main);
  --secondary: var(--brown-dark);
  --error-bg: #FFE8E6;
  --error-text: #A32929;
  --scroll-offset: 5.5rem;
}

html {
  scroll-padding-top: var(--scroll-offset);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  scroll-behavior: smooth;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, rgba(246, 241, 232, 0.96), rgba(232, 220, 199, 0.92));
  border-bottom: 1px solid rgba(75, 56, 47, 0.12);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(75, 56, 47, 0.08);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  width: 300px;
  height: auto;
  display: block;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.main-nav a {
  position: relative;
  color: var(--brown-dark);
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 100%;
  height: 2px;
  background: var(--green-main);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.22s ease;
}

.main-nav a:hover {
  color: var(--green-dark);
}

.main-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green-dark), var(--green-main));
  color: var(--white);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(49, 70, 44, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(49, 70, 44, 0.28);
  background: linear-gradient(135deg, var(--brown-dark), var(--green-dark));
}

.site-header + .page,
.site-header + .content-section {
  padding-top: 1.25rem;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid rgba(166, 154, 126, 0.36);
  padding: 1.25rem 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--accent-dark);
}

.brand {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
}

.brand img {
  display: block;
  height: 3.5rem;
  width: auto;
}

.nav-button {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.9rem 1.35rem;
  box-shadow: 0 18px 35px rgba(157, 102, 56, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 22px 38px rgba(78, 34, 15, 0.18);
}

.page {
  width: min(1000px, calc(100% - 3.5rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.content-section {
  margin-top: 2.5rem;
  scroll-margin-top: var(--scroll-offset);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(75, 56, 47, 0.12);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(75, 56, 47, 0.08);
  padding: 2.1rem 2.4rem;
  overflow-x: hidden;
}

.hero-cta-box {
  padding: 2rem;
}

.hero-cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.hero-cta-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.hero-cta-action .button-link {
  width: fit-content;
}

.hero-profile-image {
  display: block;
  width: min(100%, 240px);
  height: auto;
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(75, 56, 47, 0.14);
}

.index-page b {
  color: var(--accent-dark);
}

.howto-link,
.text-link {
  text-underline-offset: 0.2em;
}

.howto-link {
  color: inherit;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 700;
}

.howto-link:hover,
.text-link:hover {
  color: var(--accent);
}

.step-summary {
  margin-bottom: 0.35rem;
}

.step-details[hidden] {
  display: none;
}

.step-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: auto;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.step-toggle:hover,
.step-toggle:focus-visible {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
  transform: none;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.step-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.step-toggle-less {
  display: none;
}

.step-toggle[aria-expanded="true"] .step-toggle-more {
  display: none;
}

.step-toggle[aria-expanded="true"] .step-toggle-less {
  display: inline;
}

.content-section h2 {
  margin-top: 0;
  padding-top: 0;
  margin-bottom: 1.25rem;
  color: var(--accent-dark);
  font-size: clamp(1.9rem, 3vw, 2.4rem);
}

.table-wrapper {
  overflow-x: auto;
  margin: 1.25rem 0 1.5rem;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(75, 56, 47, 0.14);
  box-shadow: 0 10px 24px rgba(75, 56, 47, 0.06);
  border-radius: 12px;
  overflow: hidden;
}

.info-table th,
.info-table td {
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(75, 56, 47, 0.12);
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}

.info-table th {
  background: linear-gradient(135deg, var(--green-dark), var(--green-main));
  color: var(--white);
  font-weight: 600;
}

.info-table tr:nth-child(even) td {
  background: rgba(223, 232, 210, 0.35);
}

.info-table tr:hover td {
  background: rgba(111, 143, 78, 0.12);
}

.about-split,
.project-split {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.about-split {
  grid-template-columns: minmax(0, 280px) 1fr;
}

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

.project-details {
  margin-top: 1.5rem;
}

.research-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, 0.8fr);
  gap: 2.5rem;
  align-items: center;
}

.section-lead {
  font-size: 1.08rem;
}

.research-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

.research-idea {
  padding: 1.5rem;
  background: rgba(223, 232, 210, 0.5);
  border: 1px solid rgba(111, 143, 78, 0.2);
  border-radius: 18px;
}

.research-idea h3,
.research-support h3 {
  margin-top: 0;
  color: var(--accent-dark);
}

.research-support {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.participation-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(223, 232, 210, 0.72));
}

.participation-cta .button-link {
  white-space: nowrap;
}

.about-image,
.project-image {
  width: 100%;
  min-height: 320px;
  background: #fff;
  border: 1px solid rgba(33, 37, 44, 0.08);
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(33, 37, 44, 0.08);
  overflow: hidden;
}

.project-image {
  display: grid;
  place-items: center;
}

.research-logo {
  min-height: 280px;
  background: var(--beige-light);
}

.research-logo img {
  object-fit: contain;
  padding: 1.25rem;
}

.profile-image {
  align-self: start;
}

.project-image img,
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.howto-image {
  width: min(100%, 32rem);
  max-width: 100%;
  min-height: 0;
  margin: 1rem 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  display: block;
}

.howto-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 20px;
  border: 1px solid rgba(75, 56, 47, 0.14);
  box-shadow: 0 14px 30px rgba(75, 56, 47, 0.12);
}

@media (max-width: 600px) {
  .howto-image {
    width: 100%;
    max-width: 100%;
  }
}

.about-text {
  display: grid;
  gap: 1rem;
}

.centered-cta {
  text-align: center;
  margin-top: 1.75rem;
}

.button-link,
button {
  justify-self: start;
  min-height: 2.75rem;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.3rem;
  background: linear-gradient(135deg, var(--green-dark), var(--green-main));
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button-link:hover,
button:hover {
  background: linear-gradient(135deg, var(--brown-dark), var(--green-dark));
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(49, 70, 44, 0.2);
}

@media (max-width: 780px) {
  .hero-cta-grid {
    grid-template-columns: 1fr;
  }

  .hero-cta-action {
    justify-content: flex-start;
  }

  .about-split,
  .research-intro-grid,
  .research-columns,
  .participation-cta {
    grid-template-columns: 1fr;
  }

  .research-logo {
    width: min(100%, 26rem);
    margin: 0 auto;
  }

  .participation-cta .button-link {
    justify-self: start;
  }

  .about-image {
    min-height: 18rem;
  }
}

.narrow {
  width: min(720px, calc(100% - 2rem));
}

.intro {
  margin-bottom: 2rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.05;
}

h2 {
  margin: 0.5rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 1.1rem;
}

h3 {
  color: var(--accent-dark);
}

p {
  margin: 0 0 1rem;
}

.intro p,
.hint {
  color: var(--muted);
}

.data-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.data-form > label {
  grid-template-rows: auto 1fr 2.75rem;
}

.data-form > label > .field-label {
  grid-row: 1;
}

.data-form > label > .field-error {
  grid-row: 2;
  align-self: end;
}

.data-form > label > input,
.data-form > label > select {
  grid-row: 3;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
}

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  min-height: auto;
  padding: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  justify-self: auto;
}

.help-btn:hover {
  background: var(--accent-dark);
  transform: none;
  box-shadow: none;
}

input,
select {
  width: 100%;
  height: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  font: inherit;
  background: #fff;
}

input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  min-height: 1.1rem;
  margin: 0;
  accent-color: var(--accent);
}

input:focus,
select:focus {
  outline: 3px solid rgba(10, 41, 71, 0.18);
  border-color: var(--accent);
}

.has-error input,
.has-error select {
  border-color: var(--error-text);
  box-shadow: 0 0 0 2px rgba(163, 41, 41, 0.12);
}

label span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.field-hint {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
}

.field-error {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--error-text);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.35;
}

.field-error[hidden] {
  display: none;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-label span {
  color: var(--text);
}

.checkbox-label a {
  color: var(--accent);
}

.wide {
  grid-column: 1 / -1;
}

.image-upload-block {
  display: grid;
  gap: 0.6rem;
}

.image-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.image-upload-block.has-error .image-picker {
  border: 1px solid var(--error-text);
  border-radius: 8px;
  padding: 0.6rem;
  box-shadow: 0 0 0 2px rgba(163, 41, 41, 0.12);
}

.selected-image-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  display: grid;
  gap: 0.45rem;
}

.selected-image-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.image-remove-btn {
  min-height: auto;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  background: var(--brown-main);
}

.image-remove-btn:hover {
  background: var(--brown-dark);
}

.secondary-btn {
  background: var(--brown-main);
}

.secondary-btn:hover {
  background: var(--brown-dark);
}

.captcha {
  min-height: 78px;
}

button,
.button-link {
  justify-self: start;
  min-height: 2.75rem;
  border: 0;
  border-radius: 6px;
  padding: 0.7rem 1rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
}

.messages {
  margin-bottom: 1rem;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(43, 35, 24, 0.45);
  padding: calc(var(--scroll-offset) + 1rem) 1rem 1rem;
  overflow-y: auto;
}

.modal-content {
  max-width: 32rem;
  width: min(100%, 32rem);
  margin: 0 auto 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(46, 36, 20, 0.18);
  max-height: calc(100dvh - var(--scroll-offset) - 2rem);
  overflow-y: auto;
}

.modal-content h3 {
  margin: 0 0 0.5rem;
  color: var(--accent-dark);
}

.modal-content p {
  margin: 0;
  color: var(--text);
}

.close {
  float: right;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 6px;
}

.message.error {
  background: var(--error-bg);
  color: var(--error-text);
}

@media (max-width: 800px) {
  .header-container {
    flex-wrap: wrap;
    padding: 12px 20px;
    gap: 16px;
  }

  /*.brand-logo {
    width: 100px;
  }*/

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 18px;
    padding-top: 10px;
    border-top: 1px solid rgba(75, 56, 47, 0.12);
  }

  .main-nav a {
    font-size: 0.9rem;
  }

  .header-cta {
    min-height: 38px;
    padding: 0 16px;
    font-size: 0.9rem;
  }
}

@media (max-width: 680px) {
  .content-section {
    padding: 1.25rem 1rem;
  }

  .data-form,
  .project-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .data-form > * {
    min-width: 0;
    max-width: 100%;
  }

  .image-picker,
  .checkbox-label {
    flex-direction: column;
    align-items: flex-start;
  }

  .captcha .g-recaptcha,
  .captcha .g-recaptcha iframe {
    max-width: 100%;
    width: 100%;
  }

  .captcha .g-recaptcha iframe {
    display: block;
  }
}

@media (max-width: 520px) {
  .header-container {
    justify-content: center;
  }

  .main-nav {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .header-cta {
    width: 100%;
    max-width: 220px;
  }
}

/* Participation terms checkbox validation visuals */
.checkbox-field.has-error .checkbox-label span {
  color: var(--error-text);
  font-weight: 700;
}

.checkbox-field.has-error .checkbox-label input {
  outline: 2px solid rgba(191,47,47,0.12);
  border-radius: 4px;
}

/* reCAPTCHA state styles */
.captcha .g-recaptcha {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem;
}

.captcha.has-error .g-recaptcha {
  border-color: var(--error-text);
  box-shadow: 0 0 0 4px rgba(139,33,25,0.06);
}

.captcha.valid .g-recaptcha {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(10,41,71,0.08);
}

/* Disabled submit button */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Small helper hint shown near captcha when invalid (if present) */
.captcha .hint {
  color: var(--error-text);
  font-weight: 700;
  margin-top: 0.4rem;
}

/* The Close Button */
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}
