/* Shared foundation: reset, buttons, submission form, dialogs and toast. */
:root {
  --green: #8fc31f;
  --green-dark: #6f9a14;
  --green-soft: #eef6dc;
  --blue: #003a4a;
  --blue-deep: #002a36;
  --ink: #0f2a33;
  --muted: #5d7079;
  --line: #dfe6e2;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
.shell { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--green); color: var(--blue); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 12px; }
.noscript { padding: 16px; text-align: center; }
.noscript a { text-decoration: underline; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent; font-size: 15px; font-weight: 700; white-space: nowrap; transition: background .2s, border-color .2s, color .2s, transform .2s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary, .button.dark { background: var(--green); color: var(--blue-deep); }
.button.primary:hover:not(:disabled), .button.dark:hover:not(:disabled) { background: #9fd22c; }
.button.outline { background: white; border-color: #cfd8d4; color: var(--ink); }
.button.outline:hover:not(:disabled) { border-color: var(--green); }
.button:disabled { opacity: .55; transform: none; }
.text-link { color: var(--green-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Submission form (shared by the hub and the L2 dialogs). */
.project-form { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 32px; color: var(--ink); }
.project-form label:not(.check-option):not(.consent) { display: block; font-size: 14px; font-weight: 600; margin-bottom: 22px; }
.project-form input:not([type="checkbox"]), .project-form textarea, .project-form select { display: block; width: 100%; margin-top: 8px; padding: 12px 14px; border: 1px solid #d3ddd8; background: #fbfcfa; border-radius: 10px; font-weight: 400; font-size: 14px; }
.project-form input:focus, .project-form textarea:focus, .project-form select:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px #8fc31f33; }
.project-form textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.project-form small { display: block; font-size: 12px; font-weight: 400; line-height: 1.6; color: var(--muted); margin-top: 6px; }
.project-form fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.project-form legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.required { color: var(--green-dark); }
.optional, .field-hint { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.check-option { display: flex; gap: 8px; align-items: center; padding: 10px 12px; font-size: 13px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: white; }
.check-option:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
input[type="checkbox"] { accent-color: var(--green-dark); flex-shrink: 0; width: 16px; height: 16px; }
.consent { display: flex; align-items: start; gap: 10px; font-size: 13px; line-height: 1.6; margin: 0 0 20px; }
.repo-import { padding: 18px; margin-bottom: 24px; border: 1px dashed #c9d6bf; border-radius: 12px; background: #f8fbf2; }
.repo-import label { margin-bottom: 0 !important; }
.repo-import-row { display: flex; gap: 10px; margin-top: 8px; }
.repo-import-row input { margin-top: 0 !important; }
.activity-context { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 12px 16px; margin-bottom: 22px; border-radius: 10px; background: var(--green-soft); font-size: 14px; }
.activity-context span { color: var(--muted); font-size: 13px; }
.form-footnote { font-size: 12px; line-height: 1.7; color: var(--muted); margin-top: 10px; }
.form-error { color: #b3261e; font-size: 14px; margin-bottom: 14px; }
.submission-ready { background: var(--green-soft); padding: 20px; margin-top: 20px; border-radius: 12px; }
.submission-ready h3 { font-size: 17px; margin-bottom: 8px; }
.submission-ready p { font-size: 14px; line-height: 1.6; margin-bottom: 12px; }
.submission-ready .button { margin: 4px 8px 4px 0; }
.submission-ready .text-link { display: block; margin-top: 12px; }

/* Dialogs. */
dialog { width: min(820px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 0; border-radius: 18px; background: white; color: var(--ink); box-shadow: 0 30px 80px #00161d55; }
dialog::backdrop { background: #001a22b3; backdrop-filter: blur(3px); }
body:has(dialog[open]) { overflow: hidden; }
.dialog-close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: white; font-size: 22px; line-height: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--blue); color: white; padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px #0004; }

@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }
  .project-form { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr 1fr; }
  .repo-import-row { flex-direction: column; }
}
@media (max-width: 400px) { .check-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
