/* ==========================================================================
   TerraAI Dark Theme for Ashby job board
   Brand purple: #7c6fd6
   Brand cyan: #40c4ff
   ========================================================================== */

/* ---------- Ashby theme variables ---------------------------------------- */

:root {
  /* Primary colors */
  --colorPrimary900: #16161d;
  --colorPrimary600: #40c4ff;

  /* Job board widths */
  --widthMaxJobBoard: 960px;

  /* Radii */
  --borderRadiusContainer: 10px;
  --borderRadiusControl: 8px;
  --borderRadiusButton: 8px;

  /* Font family */
  --fontFamily: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  /* Background color behind the entire job board */
  --colorAppBackground: #100f0f;

  --colorNeutral200: #1a1a1a;
}

/* ---------- Custom design tokens ----------------------------------------- */

:root {
  --terra-bg: #100f0f;                  /* page background (near-black / space) */
  --terra-bg-elevated: #000000;         /* cards / panels */
  --terra-bg-elevated-soft: #1a1a1a;    /* softer slightly lighter card */
  --terra-bg-soft: #151515;             /* subtle contrast background */
  --terra-border-subtle: #2b2b2b;
  --terra-border-strong: #464646;

  --terra-white: #ffffff;

  --terra-text: #f9fafb;
  --terra-text-strong: #ffffff;
  --terra-text-muted: #bebebe;
  --terra-text-soft: #8d8d8d;

  --terra-purple: #7c6fd6;              /* brand purple for headings */
  --terra-cyan: #40c4ff;                /* main brand accent */
  --terra-cyan-soft: rgba(64, 196, 255, 0.18);
  --terra-cyan-strong: #40c4ff;

  --terra-danger: #f97373;

  --terra-radius-sm: 4px;
  --terra-radius-md: 8px;
  --terra-radius-lg: 12px;

  --terra-shadow-soft: 0 20px 45px rgba(0, 0, 0, 0.55);
  --terra-shadow-subtle: 0 8px 22px rgba(0, 0, 0, 0.45);

  --terra-font-sans: var(--fontFamily);
}

/* ---------- Global layout & typography ----------------------------------- */

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--terra-bg);
  color: var(--terra-text-muted);
  font-family: var(--terra-font-sans);
  -webkit-font-smoothing: antialiased;
}

a:visited {
  color: var(--colorPrimary600) !important;
}

/* ---------- Main heading ------------------------------------------------- */

.ashby-job-board-heading {
  font-size: 1.5rem;
  color: var(--terra-purple);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ashby-job-board-heading-count {
  color: var(--terra-cyan);
  font-size: 1.5rem;
  font-weight: 400;
}

/* ---------- Department headings ------------------------------------------ */

.ashby-department-heading,
.ashby-department-heading-level {
  font-size: 1.5rem;
  color: var(--terra-cyan);
  margin-top: 48px;
  margin-bottom: 24px;
  font-weight: 600;
}

/* ---------- Filter bar --------------------------------------------------- */

.ashby-job-board-filters-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terra-text-soft);
  font-size: 0.88rem;
}

.ashby-job-board-reset-filters-label {
  cursor: pointer;
  color: var(--terra-text-soft);
  font-size: 0.88rem;
}

.ashby-job-board-reset-filters-label:hover {
  color: var(--terra-cyan);
}

.ashby-job-board-filter {
  background-color: var(--terra-bg-elevated);
  border-radius: var(--borderRadiusControl);
  border: 1px solid var(--terra-border-subtle);
  color: var(--terra-text-muted);
  padding: 8px 14px;
  font-family: var(--terra-font-sans);
  font-size: 0.9rem;
  min-width: 160px;
  outline: none;
}

/* ---------- Buttons ------------------------------------------------------ */

.ashby-job-board-back-to-all-jobs-button {
  appearance: none;
  border-radius: var(--borderRadiusButton);
  border: 1px solid var(--terra-cyan);
  background: radial-gradient(circle at 0% 0%, var(--terra-cyan-soft), #050816);
  color: var(--terra-text-strong);
  font-family: var(--terra-font-sans);
  font-weight: 550;
  font-size: 0.95rem;
  padding: 9px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.08s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.ashby-job-board-back-to-all-jobs-button:hover {
  background: linear-gradient(135deg, var(--terra-cyan-strong), #13a37f);
  border-color: var(--terra-cyan-strong);
  box-shadow: var(--terra-shadow-soft);
  transform: translateY(-1px);
}

.ashby-application-form-submit-button {
  padding: 16px !important;
  font-size: 0.95rem;
  appearance: none;
  border-radius: var(--borderRadiusButton);
  border: 1px solid var(--terra-cyan);
  background: var(--terra-cyan);
  color: #000000;
  font-family: var(--terra-font-sans);
  font-weight: 600;
  padding: 9px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.08s ease,
    border-color 0.18s ease,
    color 0.18s ease;
  margin-top: 24px;
}

.ashby-application-form-submit-button:hover,
.ashby-application-form-submit-button:focus-visible {
  background: linear-gradient(135deg, var(--terra-cyan-strong), #13a37f);
  border-color: var(--terra-cyan-strong);
  box-shadow: var(--terra-shadow-soft);
  transform: translateY(-1px);
}

/* Tabs (Overview / Application) */
.ashby-job-posting-right-pane-application-tab,
.ashby-job-posting-right-pane-overview-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--terra-text-soft);
  padding: 10px 20px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ashby-job-posting-right-pane-application-tab:hover,
.ashby-job-posting-right-pane-overview-tab:hover {
  color: var(--terra-text-strong);
  border-color: var(--terra-cyan);
  background-color: var(--terra-cyan-soft);
}

.ashby-job-posting-right-pane-tab-slider {
  background: var(--terra-cyan);
  height: 2px;
  box-shadow: 0 0 8px rgba(64, 196, 255, 0.5);
}

/* ---------- Job list view ------------------------------------------------ */

.ashby-job-posting-brief-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.ashby-job-posting-brief {
  border-radius: var(--terra-radius-md);
  border: 1px solid var(--terra-border-subtle);
  background-color: var(--terra-bg-elevated-soft);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--terra-shadow-subtle);
  display: flex;
  flex-direction: column;
  color: var(--terra-text-muted);
  transition: all 0.2s ease;
  cursor: pointer;
}

.ashby-job-posting-brief:hover {
  background-color: #021610;
  box-shadow: 0 0 0 1px var(--terra-cyan-strong) inset !important;
}

.ashby-job-posting-brief:hover .ashby-job-posting-brief-title {
  color: var(--terra-cyan) !important;
}

.ashby-job-posting-brief-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--terra-white);
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.ashby-job-posting-brief-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terra-text-soft);
}

.ashby-job-posting-brief-department-heading {
  color: var(--terra-cyan);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.ashby-job-posting-brief-department-heading-level {
  color: var(--terra-cyan);
}

.ashby-job-posting-brief-list {
  margin-top: 8px;
  color: var(--terra-text-muted);
  font-size: 0.875rem;
}

/* ---------- Job detail view ---------------------------------------------- */

.ashby-job-posting-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--terra-border-subtle);
}

.ashby-job-posting-heading {
  font-size: 2.1rem;
  color: var(--terra-text-strong);
  font-weight: 650;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}

.ashby-job-posting-left-pane {
  background-color: var(--terra-bg-elevated);
  border-radius: var(--terra-radius-md);
  border: 0px;
  padding: 22px 24px;
  color: var(--terra-text-muted);
}

.ashby-job-posting-right-pane {
  background-color: var(--terra-bg-elevated);
  border-radius: var(--terra-radius-md);
  border: 1px solid var(--terra-border-subtle);
  box-shadow: var(--terra-shadow-soft);
  padding: 22px 24px;
  margin-top: 24px;
  color: var(--terra-text-muted);
}

.ashby-job-posting-left-pane *,
.ashby-job-posting-right-pane * {
  background-color: transparent;
}

.ashby-job-posting-left-pane p,
.ashby-job-posting-left-pane li {
  color: var(--terra-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.ashby-job-posting-left-pane h2,
.ashby-job-posting-left-pane h3 {
  margin-top: 22px;
  font-size: 1.05rem;
  color: var(--terra-text-strong);
}

.ashby-job-posting-left-pane ul,
.ashby-job-posting-left-pane ol {
  margin-left: 0;
  padding-left: 0;
}

.ashby-job-posting-left-pane ul li,
.ashby-job-posting-left-pane ol li {
  margin-bottom: 6px;
  position: relative;
  padding-left: 1.2em;
}

.ashby-job-posting-left-pane ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--terra-cyan);
}

.ashby-job-posting-left-pane a {
  color: var(--terra-cyan);
}

.ashby-job-posting-left-pane a:hover,
.ashby-job-posting-left-pane a:focus-visible {
  color: var(--terra-cyan-strong);
}

/* ---------- Application form --------------------------------------------- */

.ashby-application-form-container {
  margin-top: 16px;
  background-color: var(--terra-bg-elevated);
  border-radius: var(--terra-radius-md);
  border: 1px solid var(--terra-border-subtle);
  padding: 32px;
}

.ashby-application-form-section-container {
  margin-bottom: 18px;
}

.ashby-application-form-section-header {
  color: var(--terra-purple);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--terra-border-subtle);
}

.ashby-application-form-section-header-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terra-text-soft);
}

.ashby-application-form-section-header-description {
  font-size: 0.85rem;
  color: var(--terra-text-soft);
}

.ashby-application-form-field-entry {
  margin-bottom: 20px;
}

.ashby-application-form-question-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terra-text-soft);
  display: block;
  margin-bottom: 4px;
}

.ashby-application-form-question-description {
  font-size: 0.85rem;
  color: var(--terra-text-soft);
  margin-bottom: 8px;
  line-height: 1.5;
}

.ashby-application-form-field-entry input[type="text"],
.ashby-application-form-field-entry input[type="email"],
.ashby-application-form-field-entry input[type="tel"],
.ashby-application-form-field-entry input[type="url"],
.ashby-application-form-field-entry textarea,
.ashby-application-form-field-entry select {
  width: 100%;
  background-color: var(--terra-bg-soft);
  border-radius: var(--terra-radius-sm);
  border: 1px solid var(--terra-border-subtle);
  color: var(--terra-text-muted);
  padding: 9px 12px;
  font-family: var(--terra-font-sans);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.ashby-application-form-field-entry input::placeholder,
.ashby-application-form-field-entry textarea::placeholder {
  color: var(--terra-text-soft);
}

.ashby-application-form-texting-consent-description {
  color: var(--terra-text-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-top: 8px;
}

/* Autofill widget */
.ashby-application-form-autofill-pane {
  background-color: rgba(30, 51, 45, 0.3);
  border-radius: var(--terra-radius-md);
  border: 1px solid var(--terra-border-subtle);
  padding: 20px;
  margin-bottom: 24px;
}

.ashby-application-form-autofill-input-root {
  border-radius: var(--terra-radius-md);
  border: 1px dashed var(--terra-border-subtle);
  background-color: #1e332d;
  padding: 12px 14px;
}

.ashby-application-form-autofill-uploader {
  background-color: var(--terra-bg-elevated);
  border: 2px dashed var(--terra-border-subtle);
  border-radius: var(--terra-radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ashby-application-form-autofill-uploader:hover {
  border-color: var(--terra-cyan);
  background-color: rgba(64, 196, 255, 0.05);
}

.ashby-application-form-autofill-input-base-layer {
  background: var(--terra-bg-soft);
  border: 1px solid var(--terra-border-subtle);
  border-radius: var(--terra-radius-sm);
  padding: 12px 16px;
  color: var(--terra-text-muted);
}

.ashby-application-form-autofill-input-drag-layer {
  background: rgba(64, 196, 255, 0.1);
  border: 2px dashed var(--terra-cyan);
  border-radius: var(--terra-radius-md);
}

.ashby-application-form-autofill-input-pending-layer {
  background: rgba(16, 15, 15, 0.9);
  backdrop-filter: blur(4px);
}

.ashby-application-form-autofill-input-title {
  color: var(--terra-text-strong);
  font-size: 0.9rem;
}

.ashby-application-form-autofill-input-description {
  font-size: 0.85rem;
  color: var(--terra-text-soft);
}

.ashby-application-form-autofill-input-icon {
  color: var(--terra-cyan);
}

.ashby-application-form-autofill-input-form-alert,
[role="alert"],
[class*="error-message"] {
  color: var(--terra-danger);
  font-size: 0.78rem;
  margin-top: 4px;
  background-color: #191919;
  box-shadow: none !important;
  border-radius: var(--terra-radius-md);
}

/* ---------- Success / failure / blocked containers ----------------------- */

.ashby-application-form-success-container,
.ashby-application-form-failure-container,
.ashby-application-form-blocked-application-container {
  border-radius: var(--terra-radius-md);
  border: 1px solid var(--terra-border-subtle);
  background-color: var(--terra-bg-elevated);
  padding: 16px 18px;
  box-shadow: var(--terra-shadow-subtle);
}

.ashby-application-form-success-container {
  background: rgba(64, 196, 255, 0.1);
  border-color: var(--terra-cyan);
  color: var(--terra-cyan);
}

.ashby-application-form-failure-container {
  background: rgba(249, 115, 115, 0.1);
  border-color: var(--terra-danger);
  color: var(--terra-danger);
}

/* ---------- Surveys ------------------------------------------------------- */

.ashby-survey-form-container {
  margin-top: 24px;
  border-radius: var(--terra-radius-md);
  border: 1px solid var(--terra-border-subtle);
  background-color: var(--terra-bg-elevated);
  padding: 16px 18px;
}

/* ---------- Responsiveness ----------------------------------------------- */

@media (max-width: 768px) {
  .ashby-job-board-heading {
    font-size: 1.25rem;
  }

  .ashby-department-heading {
    font-size: 1.25rem;
    margin-top: 32px;
    margin-bottom: 16px;
  }

  .ashby-job-posting-heading {
    font-size: 1.75rem;
  }

  .ashby-job-posting-brief {
    padding: 20px;
  }

  .ashby-job-posting-left-pane,
  .ashby-job-posting-right-pane {
    padding: 16px 14px;
  }

  .ashby-application-form-container {
    padding: 24px 16px;
  }

  .ashby-application-form-submit-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .ashby-job-posting-brief {
    padding: 14px 14px;
  }

  .ashby-job-posting-brief-details {
    flex-direction: column;
    align-items: flex-start;
  }
}
