/* =============================================================
   The Democratic Consilist Party — apply.consilism.org
   Self-contained stylesheet (no dependency on the main site CSS)
   ============================================================= */

/* --- Custom Properties --- */
:root {
  /* Greens */
  --green-darkest:  #17261f;
  --green-dark:     #2c4336;
  --green-primary:  #3a5a49;
  --green-mid:      #4e7a63;
  --green-light:    #7aac91;
  --green-pale:     #d0e8da;
  --green-tint:     #eef5f1;

  /* Neutrals */
  --bg:             #faf9f7;
  --bg-white:       #ffffff;
  --bg-tint:        #f4f3f0;
  --charcoal:       #1c1917;

  /* Text */
  --text:           #1c1917;
  --text-secondary: #3d3935;
  --text-muted:     #6b7280;

  /* On dark */
  --on-dark:        #ffffff;
  --on-dark-muted:  rgba(255, 255, 255, 0.72);

  /* Borders */
  --border:         #d6d3ce;
  --border-light:   #ece9e4;

  /* Typography */
  --font-heading: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --container:  1120px;
  --nav-height: 4rem;

  /* Transitions */
  --t-fast: 150ms ease;
  --t-base: 200ms ease;
}

/* =============================================================
   Reset
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; }

/* =============================================================
   Accessibility
   ============================================================= */
.skip-link {
  position: absolute;
  top: -200%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--green-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 9999;
}
.skip-link:focus { top: 0.75rem; }

:focus-visible {
  outline: 3px solid var(--green-light);
  outline-offset: 3px;
}

/* =============================================================
   Layout
   ============================================================= */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* =============================================================
   Typography
   ============================================================= */
.section-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--green-primary);
  margin-bottom: 1rem;
}
.section-label::before {
  content: '';
  display: block;
  width: 1.5rem;
  height: 2px;
  background: currentColor;
  flex-shrink: 0;
}
.section-label--pale { color: var(--green-pale); }

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.125rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 1.375rem;
}
.section-title--light { color: var(--on-dark); }

.body-text {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 62ch;
  margin-bottom: 1rem;
}
.body-text:last-child { margin-bottom: 0; }
.body-text strong { color: var(--text); font-weight: 700; }

.inline-link {
  color: var(--green-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color var(--t-fast);
}
.inline-link:hover { color: var(--green-dark); }

/* =============================================================
   Navigation
   ============================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  height: var(--nav-height);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.nav-brand:focus-visible {
  outline: 3px solid var(--green-mid);
  outline-offset: 3px;
}

.nav-logo-img {
  height: 2.25rem;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.nav-name {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.nav-link {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 2px;
  transition: color var(--t-fast), background-color var(--t-fast);
  white-space: nowrap;
  cursor: pointer;
}
.nav-link:hover { color: var(--text); background: var(--bg-tint); }
.nav-link:focus-visible {
  outline: 3px solid var(--green-mid);
  outline-offset: 2px;
}

.nav-link--cta {
  background: var(--green-dark);
  color: #fff !important;
  font-weight: 600;
  padding: 0.4rem 1rem;
}
.nav-link--cta:hover { background: var(--green-darkest); }

.nav-link--current {
  color: var(--green-primary) !important;
  font-weight: 600;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 2px;
  flex-shrink: 0;
}
.nav-toggle:hover { background: var(--bg-tint); }
.nav-toggle:focus-visible {
  outline: 3px solid var(--green-mid);
  outline-offset: 2px;
}

.hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  pointer-events: none;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-name { display: none; }

  .nav-menu {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1.5rem 1rem;
    gap: 0.125rem;
    display: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  }
  .nav-menu--open { display: flex; }
  .nav-link { padding: 0.75rem; font-size: 0.9375rem; }
  .nav-link--cta { text-align: center; margin-top: 0.375rem; }
}

/* =============================================================
   Sections
   ============================================================= */
.section { padding-block: 5.5rem; }
.section--white { background: var(--bg-white); }
.section--dark  { background: var(--green-dark); }

@media (max-width: 640px) { .section { padding-block: 3.5rem; } }

/* =============================================================
   Page header (dark green banner)
   ============================================================= */
.page-header {
  background: var(--green-dark);
  background-image: repeating-linear-gradient(
    -55deg,
    transparent,
    transparent 60px,
    rgba(255,255,255,0.018) 60px,
    rgba(255,255,255,0.018) 61px
  );
  padding-block: 4rem 3.5rem;
  border-bottom: 3px solid var(--green-primary);
}

.page-header-title {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.page-header-sub {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--on-dark-muted);
  max-width: 60ch;
  line-height: 1.65;
  margin-top: 1rem;
}

/* =============================================================
   Join / Discord CTA section
   ============================================================= */
.join-inner { max-width: 680px; }

.join-body {
  font-size: 1.0625rem;
  color: var(--on-dark-muted);
  line-height: 1.75;
  margin-bottom: 2.25rem;
  max-width: 50ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.625rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  border-radius: 2px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible {
  outline: 3px solid var(--green-light);
  outline-offset: 3px;
}

.btn-large { font-size: 1rem; padding: 1rem 2.25rem; }

.btn-inverted {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
.btn-inverted:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
}

.btn-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

/* =============================================================
   Footer
   ============================================================= */
.site-footer {
  background: var(--green-darkest);
  padding-block: 1.5rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
}

.footer-sep {
  color: rgba(255,255,255,0.2);
  font-size: 0.875rem;
  user-select: none;
}

.footer-link {
  font-size: 0.8125rem;
  color: var(--green-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--t-fast);
}
.footer-link:hover { color: var(--green-pale); }

.footer-meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.28);
}

/* =============================================================
   Application layout
   ============================================================= */
.apply-layout {
  max-width: 720px;
}

.apply-intro {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-light);
}

/* =============================================================
   Form
   ============================================================= */
.apply-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--charcoal);
  letter-spacing: 0.01em;
}
.form-label-required::after {
  content: " *";
  color: var(--green-primary);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.2rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--charcoal);
  border-radius: 0;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(58, 90, 73, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232c4336' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--green-tint);
  border: 1px solid var(--green-pale);
}

.form-checkbox {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--green-primary);
  cursor: pointer;
}

.form-checkbox-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  cursor: pointer;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 0.5rem 0;
}

.form-section-heading {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 0;
}

/* Success / error messages (Formspree AJAX) */
.form-success {
  display: none;
  padding: 1.25rem 1.5rem;
  background: var(--green-tint);
  border: 1px solid var(--green-pale);
  border-left: 3px solid var(--green-primary);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.form-error-banner {
  display: none;
  padding: 1rem 1.25rem;
  background: #fff8f0;
  border-left: 3px solid #b05c00;
  font-size: 0.9rem;
  color: #5a3000;
  line-height: 1.6;
}
.form-field-error {
  font-size: 0.8rem;
  color: #b05c00;
  margin-top: 0.25rem;
  display: none;
}

.form-submit-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.btn-submit {
  background: var(--green-dark);
  color: #fff;
  border: none;
  padding: 0.85rem 2.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--t-fast);
}
.btn-submit:hover  { background: var(--green-darkest); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-submit:focus-visible {
  outline: 3px solid var(--green-mid);
  outline-offset: 2px;
}

.form-submit-note {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* =============================================================
   Contact box
   ============================================================= */
.contact-box {
  margin-top: 3.5rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--green-primary);
  background: var(--bg-white);
}

.contact-box-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-primary);
  margin-bottom: 0.4rem;
}

.contact-box-heading {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.contact-box-body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.contact-email {
  color: var(--green-primary);
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}
.contact-email:hover { text-decoration: underline; }

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 540px) {
  .form-submit-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =============================================================
   Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}
