/* Polymath Industrial — Contribute (application) page styles */

/* ── HERO ─────────────────────────────────────────────────────────── */

.contribute-hero {
  padding: var(--s-9) 0 var(--s-7);
  position: relative;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(184, 84, 42, 0.04), transparent 60%),
    var(--ground-0);
}

.contribute-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  font-size: var(--fs-xs);
  color: var(--rust);
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--s-6);
}
.contribute-eyebrow-rule {
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(90deg, var(--rust), transparent);
}

.contribute-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, var(--fs-4xl));
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: var(--s-5);
  max-width: 18ch;
}
.contribute-title em {
  font-family: "Georgia", "Times New Roman", serif;
  font-style: italic;
  color: var(--rust-bright);
  letter-spacing: -0.04em;
}

.contribute-lede {
  font-size: clamp(var(--fs-md), 1.4vw, var(--fs-lg));
  color: var(--fg-dim);
  line-height: 1.55;
  max-width: 60ch;
}

/* ── FORM LAYOUT ──────────────────────────────────────────────────── */

.contribute-form-section { padding: var(--s-8) 0 var(--s-10); }

.form-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--s-8);
  align-items: start;
}
@media (max-width: 980px) {
  .form-layout { grid-template-columns: 1fr; gap: var(--s-7); }
}

/* ── SIDEBAR ──────────────────────────────────────────────────────── */

.form-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}
@media (max-width: 980px) {
  .form-sidebar { position: static; }
}

.sidebar-block {
  padding: var(--s-5);
  background: var(--ground-1);
  border-left: 2px solid var(--rust);
}

.sidebar-label {
  font-size: var(--fs-xs);
  color: var(--rust);
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--s-4);
}

.sidebar-skills {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--fg-dim);
}
.sidebar-skills li {
  padding-left: var(--s-4);
  position: relative;
}
.sidebar-skills li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--rust);
  font-weight: 700;
}

.sidebar-text {
  font-size: var(--fs-sm);
  color: var(--fg-dim);
  line-height: 1.55;
}

.sidebar-steps {
  list-style: none;
  padding: 0;
  counter-reset: side;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.sidebar-steps li {
  counter-increment: side;
  font-size: var(--fs-sm);
  color: var(--fg-dim);
  padding-left: var(--s-5);
  position: relative;
  line-height: 1.5;
}
.sidebar-steps li::before {
  content: counter(side, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--rust);
  font-weight: 500;
}

/* ── FORM ─────────────────────────────────────────────────────────── */

.application-form {
  background: var(--ground-1);
  border: 1px solid var(--border);
  padding: var(--s-7);
  position: relative;
  overflow: hidden;
}
.application-form::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 60px;
  height: 1px;
  background: var(--rust);
}
.application-form::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 1px;
  height: 60px;
  background: var(--rust);
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-7);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border);
}
.form-id {
  font-size: var(--fs-xs);
  color: var(--bone-3);
  letter-spacing: var(--tracking-wide);
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--s-7) 0;
}

.legend {
  font-size: var(--fs-sm);
  color: var(--rust-bright);
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
}
.legend::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.fieldset-hint {
  font-size: var(--fs-sm);
  color: var(--fg-mute);
  margin-bottom: var(--s-5);
  margin-top: calc(-1 * var(--s-3));
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
  margin-bottom: var(--s-5);
}
.field-row .field { margin-bottom: 0; }
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--bone-0);
  letter-spacing: var(--tracking-tight);
}
.req {
  color: var(--rust-bright);
  margin-left: 2px;
}

.field-hint {
  font-size: var(--fs-xs);
  color: var(--bone-3);
  margin-top: var(--s-1);
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea {
  width: 100%;
  background: var(--ground-0);
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  padding: var(--s-3) var(--s-4);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--bone-0);
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--rust);
  background: var(--ground-2);
}
input::placeholder, textarea::placeholder { color: var(--bone-3); }
textarea { resize: vertical; min-height: 120px; line-height: 1.55; font-family: var(--font-sans); }

.field.invalid input,
.field.invalid textarea {
  border-color: #c44a3c;
  background: rgba(196, 74, 60, 0.05);
}

/* ── SKILLS GRID ──────────────────────────────────────────────────── */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-3);
}

.skill-chip {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--ground-0);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  font-size: var(--fs-sm);
  font-weight: 400;
  letter-spacing: 0;
  user-select: none;
}
.skill-chip:hover {
  border-color: var(--bone-3);
  background: var(--ground-2);
}
.skill-chip input {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--bone-3);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all var(--dur-fast) var(--ease-out);
}
.skill-chip input:checked {
  background: var(--rust);
  border-color: var(--rust);
}
.skill-chip input:checked::after {
  content: "";
  position: absolute;
  left: 3px; top: 0;
  width: 4px;
  height: 8px;
  border: solid var(--bone-0);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.skill-chip:has(input:checked) {
  border-color: var(--rust);
  background: rgba(184, 84, 42, 0.08);
}
.skill-chip span {
  color: var(--bone-0);
}

/* ── HONEYPOT ─────────────────────────────────────────────────────── */

.hp-trap {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── ACTIONS ──────────────────────────────────────────────────────── */

.form-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
}
.form-fineprint {
  font-size: var(--fs-xs);
  color: var(--fg-mute);
  line-height: 1.55;
}
.form-fineprint a { color: var(--rust-bright); }
.form-fineprint a:hover { color: var(--bone-warm); }

#submit-btn { align-self: flex-start; }
#submit-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── RESULT MESSAGE ───────────────────────────────────────────────── */

.form-result {
  margin-top: var(--s-5);
  padding: var(--s-5);
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.form-result.success {
  border-color: var(--forest-bright);
  background: rgba(74, 107, 74, 0.08);
  color: var(--bone-0);
}
.form-result.error {
  border-color: #c44a3c;
  background: rgba(196, 74, 60, 0.08);
  color: var(--bone-0);
}
.form-result strong {
  display: block;
  margin-bottom: var(--s-2);
  font-weight: 600;
}
