:root {
  --navy: #1b365d;
  --subtitle: #c5d3e6;
  --ink: #1f2733;
  --muted: #4a4a4a;
  --border: #dde3ec;
  --field-border: #5c6b82;
  --accent: #0076be;
  --accent-ink: #ffffff;
  --focus-ring: #b07000;
  --error: #b50909;
  --ok: #2e7d32;
  --warn: #8a5300;
  --bg: #f4f6f9;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Montserrat",
    "Segoe UI",
    system-ui,
    -apple-system,
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.5;
}

.page-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
}

h1 {
  font-size: 1.375rem;
  line-height: 1.25;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

.intro {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.25rem;
}

#intro {
  margin-bottom: 1rem;
}

form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field .req {
  color: var(--error);
  margin-left: 0.15rem;
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  background: #fff;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a.opp-card:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 1px;
}

.page-scroll:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
}

.field-error {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.template-download {
  margin-top: 0.5rem;
}

.template-download-btn {
  font: inherit;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.template-download-btn:hover {
  color: #005b91;
}

.turnstile {
  margin-block: 1rem;
}

.turnstile-error {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.submit {
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
}

.submit:hover {
  background: #005b91;
}

.submit:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

.status-wrap {
  flex: none;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

.status {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 3px;
}

.status:empty {
  display: none;
}

.status.info {
  background: #eef4fb;
  border: 1px solid var(--accent);
}

.status.error {
  background: #fdeeee;
  border: 1px solid var(--error);
  color: var(--error);
}

.status.success {
  background: #eef7ef;
  border: 1px solid var(--ok);
  color: var(--ok);
}

.status.warning {
  background: #fff6e5;
  border: 1px solid var(--warn);
  color: var(--warn);
}

.opp-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.opp-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
}

a.opp-card:hover {
  border-color: var(--accent);
}

.opp-card.is-upcoming {
  color: var(--muted);
  cursor: default;
}

.opp-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.opp-desc {
  margin: 0 0 0.75rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.opp-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.opp-deadline {
  color: var(--muted);
  font-size: 0.9rem;
}

.opp-cta {
  color: var(--accent);
  font-weight: 600;
}

.opp-badge {
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}

.brand-header {
  flex: none;
  background: var(--navy);
  color: #fff;
}

.brand-inner {
  max-width: none;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 1.25rem;
}

.brand-logo {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--subtitle);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-footer {
  flex: none;
  background: var(--navy);
  color: #fff;
  padding: 12px 0;
}

.footer-inner {
  max-width: none;
  margin: 0;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
}

.footer-contact {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #dbe4f0;
}

.footer-org {
  font-weight: 700;
  color: #fff;
}

.footer-contact a {
  color: #fff;
  text-decoration: underline;
}

.footer-tagline {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtitle);
}

@media (max-width: 30rem) {
  .page {
    padding: 1rem 1rem 3rem;
  }

  form {
    padding: 1rem;
  }

  .brand-inner {
    padding: 8px 1rem;
  }

  .brand-footer {
    padding: 10px 0;
  }

  .footer-inner {
    padding: 0 1rem;
  }

  .status-wrap {
    padding: 0 1rem;
  }
}

@media (max-height: 32rem) {
  html {
    scroll-padding-top: var(--status-bar-height, 4rem);
  }

  body {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .page-scroll {
    overflow-y: visible;
  }

  .status-wrap {
    position: sticky;
    top: 0;
    z-index: 1;
  }
}
