/**
 * Ashby Careers & Application Styles
 * 
 * Add this CSS to your Webflow site for consistent styling
 * of the dynamically generated job listings and application forms.
 * 
 * Customize colors and fonts to match your brand.
 */

/* =================================================================
   CSS Variables - Customize these to match your brand
   ================================================================= */
:root {
  /* Colors */
  --ashby-primary: #2563eb;
  --ashby-primary-hover: #1d4ed8;
  --ashby-secondary: #64748b;
  --ashby-text: #1e293b;
  --ashby-text-muted: #64748b;
  --ashby-border: #e2e8f0;
  --ashby-background: #f8fafc;
  --ashby-white: #ffffff;
  --ashby-error: #ef4444;
  --ashby-error-bg: #fef2f2;
  --ashby-success: #22c55e;
  --ashby-success-bg: #f0fdf4;

  /* Typography */
  --ashby-font-family: inherit;
  --ashby-font-size-base: 16px;
  --ashby-font-size-sm: 14px;
  --ashby-font-size-lg: 18px;
  --ashby-font-size-xl: 24px;
  --ashby-font-size-2xl: 32px;

  /* Spacing */
  --ashby-spacing-xs: 4px;
  --ashby-spacing-sm: 8px;
  --ashby-spacing-md: 16px;
  --ashby-spacing-lg: 24px;
  --ashby-spacing-xl: 32px;
  --ashby-spacing-2xl: 48px;

  /* Border radius */
  --ashby-radius-sm: 4px;
  --ashby-radius-md: 8px;
  --ashby-radius-lg: 12px;

  /* Transitions */
  --ashby-transition: 200ms ease;
}

/* =================================================================
   Loading & Error States
   ================================================================= */
.ashby-loading-state,
.ashby-error-state,
.ashby-empty-state {
  text-align: center;
  padding: var(--ashby-spacing-2xl);
  color: var(--ashby-text-muted);
}

.ashby-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--ashby-border);
  border-top-color: var(--ashby-primary);
  border-radius: 50%;
  animation: ashby-spin 0.8s linear infinite;
  margin: 0 auto var(--ashby-spacing-md);
  display: flex;
  justify-content: center;
  align-items: center;
}

.ashby-spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: ashby-spin 0.8s linear infinite;
  display: inline-block;
  margin-right: var(--ashby-spacing-sm);
}

@keyframes ashby-spin {
  to {
    transform: rotate(360deg);
  }
}

.ashby-error-state p {
  margin: var(--ashby-spacing-sm) 0;
}

.ashby-error-details {
  font-size: var(--ashby-font-size-sm);
  color: var(--ashby-error);
}

.ashby-retry-btn,
.ashby-back-link {
  display: inline-block;
  margin-top: var(--ashby-spacing-md);
  padding: var(--ashby-spacing-sm) var(--ashby-spacing-lg);
  background: var(--ashby-primary);
  color: var(--ashby-white);
  border: none;
  border-radius: var(--ashby-radius-md);
  cursor: pointer;
  font-size: var(--ashby-font-size-base);
  text-decoration: none;
  transition: background var(--ashby-transition);
}

.ashby-retry-btn:hover,
.ashby-back-link:hover {
  background: var(--ashby-primary-hover);
}

/* =================================================================
   Job Listings (Careers Page)
   ================================================================= */
.ashby-department-group {
  margin-bottom: var(--ashby-spacing-xl);
}

.ashby-department-title {
  font-size: var(--ashby-font-size-lg);
  font-weight: 600;
  color: var(--ashby-text);
  margin-bottom: var(--ashby-spacing-md);
  padding-bottom: var(--ashby-spacing-sm);
  border-bottom: 1px solid var(--ashby-border);
}

.ashby-jobs-list {
  display: flex;
  flex-direction: column;
  gap: var(--ashby-spacing-sm);
}

.ashby-job-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ashby-spacing-lg);
  background: var(--ashby-white);
  border: 1px solid var(--ashby-border);
  border-radius: var(--ashby-radius-lg);
  cursor: pointer;
  transition: all var(--ashby-transition);
}

.ashby-job-card:hover {
  border-color: var(--ashby-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.ashby-job-content {
  flex: 1;
}

.ashby-job-title {
  font-size: var(--ashby-font-size-lg);
  font-weight: 600;
  margin: 0 0 var(--ashby-spacing-sm);
  color: var(--ashby-text);
}

.ashby-job-title a {
  color: inherit;
  text-decoration: none;
}

.ashby-job-title a:hover {
  color: var(--ashby-primary);
}

.ashby-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ashby-spacing-md);
  font-size: var(--ashby-font-size-sm);
  color: var(--ashby-text-muted);
}

.ashby-job-meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--ashby-spacing-xs);
}

.ashby-job-meta span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--ashby-secondary);
  border-radius: 50%;
}

.ashby-job-meta span:first-child::before {
  display: none;
}

.ashby-job-arrow {
  color: var(--ashby-secondary);
  transition: transform var(--ashby-transition), color var(--ashby-transition);
}

.ashby-job-card:hover .ashby-job-arrow {
  color: var(--ashby-primary);
  transform: translateX(4px);
}

/* =================================================================
   Filters
   ================================================================= */
.ashby-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ashby-spacing-md);
  margin-bottom: var(--ashby-spacing-xl);
}

[data-ashby-filter] {
  padding: var(--ashby-spacing-sm) var(--ashby-spacing-md);
  border: 1px solid var(--ashby-border);
  border-radius: var(--ashby-radius-md);
  background: var(--ashby-white);
  font-size: var(--ashby-font-size-base);
  color: var(--ashby-text);
  min-width: 180px;
}

[data-ashby-filter="search"] {
  flex: 1;
  min-width: 250px;
}

/* =================================================================
   Job Details Page
   ================================================================= */
.ashby-job-header {
  margin-bottom: var(--ashby-spacing-xl);
}

.ashby-job-header .ashby-job-title {
  font-size: var(--ashby-font-size-2xl);
  margin-bottom: var(--ashby-spacing-md);
}

.ashby-meta-item {
  display: inline-flex;
  align-items: center;
  padding: var(--ashby-spacing-xs) var(--ashby-spacing-md);
  background: var(--ashby-background);
  border-radius: var(--ashby-radius-sm);
  font-size: var(--ashby-font-size-sm);
  color: var(--ashby-text-muted);
  margin-right: var(--ashby-spacing-sm);
  margin-bottom: var(--ashby-spacing-sm);
}

.ashby-compensation {
  font-size: var(--ashby-font-size-lg);
  font-weight: 500;
  color: var(--ashby-primary);
  margin-top: var(--ashby-spacing-md);
  display: none;
}

.ashby-job-description {
  line-height: 1.7;
  color: var(--ashby-text);
}

.ashby-job-description h2,
.ashby-job-description h3,
.ashby-job-description h4 {
  margin-top: var(--ashby-spacing-xl);
  margin-bottom: var(--ashby-spacing-md);
}

.ashby-job-description ul,
.ashby-job-description ol {
  margin: var(--ashby-spacing-md) 0;
  padding-left: var(--ashby-spacing-lg);
}

.ashby-job-description li {
  margin-bottom: var(--ashby-spacing-sm);
}

/* =================================================================
   Application Form
   ================================================================= */
.ashby-form {
  max-width: 600px;
}

.ashby-form-field {
  margin-bottom: var(--ashby-spacing-lg);
}

.ashby-label {
  display: block;
  font-weight: 500;
  color: var(--ashby-text);
  margin-bottom: var(--ashby-spacing-sm);
}

.ashby-required {
  color: var(--ashby-error);
  margin-left: var(--ashby-spacing-xs);
}

.ashby-field-description {
  font-size: var(--ashby-font-size-sm);
  color: var(--ashby-text-muted);
  margin: var(--ashby-spacing-xs) 0 var(--ashby-spacing-sm);
}

.ashby-field-description p {
  margin: 0;
}

.ashby-input,
.ashby-textarea,
.ashby-select {
  width: 100%;
  padding: var(--ashby-spacing-md);
  border: 1px solid var(--ashby-border);
  border-radius: var(--ashby-radius-md);
  font-size: var(--ashby-font-size-base);
  font-family: var(--ashby-font-family);
  color: var(--ashby-text);
  background: var(--ashby-white);
  transition: border-color var(--ashby-transition),
    box-shadow var(--ashby-transition);
}

.ashby-input:focus,
.ashby-textarea:focus,
.ashby-select:focus {
  outline: none;
  border-color: var(--ashby-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ashby-input::placeholder,
.ashby-textarea::placeholder {
  color: var(--ashby-text-muted);
}

.ashby-textarea {
  resize: vertical;
  min-height: 120px;
}

.ashby-input-error {
  border-color: var(--ashby-error) !important;
}

.ashby-field-error {
  color: var(--ashby-error);
  font-size: var(--ashby-font-size-sm);
  margin-top: var(--ashby-spacing-xs);
}

/* =================================================================
   Location Autocomplete
   ================================================================= */
.ashby-location-wrapper {
  position: relative;
}

.ashby-location-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ashby-white);
  border: 1px solid var(--ashby-border);
  border-top: none;
  border-radius: 0 0 var(--ashby-radius-md) var(--ashby-radius-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ashby-location-suggestion {
  padding: var(--ashby-spacing-md);
  cursor: pointer;
  transition: background var(--ashby-transition);
  border-bottom: 1px solid var(--ashby-border);
}

.ashby-location-suggestion:last-child {
  border-bottom: none;
}

.ashby-location-suggestion:hover {
  background: var(--ashby-background);
}

.ashby-location-no-results {
  padding: var(--ashby-spacing-md);
  color: var(--ashby-text-muted);
  font-style: italic;
}

.ashby-field-hint {
  font-size: var(--ashby-font-size-sm);
  color: var(--ashby-text-muted);
  margin-top: var(--ashby-spacing-xs);
}

/* =================================================================
   Ashby Embed
   ================================================================= */
#ashby-embed-container {
  min-height: 400px;
}

.ashby-embed-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--ashby-spacing-2xl);
  color: var(--ashby-text-muted);
}

#ashby_embed {
  width: 100%;
}

/* Style the Ashby embed iframe */
#ashby_embed iframe {
  width: 100%;
  min-height: 600px;
  border: none;
}

.ashby-apply-link {
  display: inline-block;
  margin-top: var(--ashby-spacing-md);
  padding: var(--ashby-spacing-sm) var(--ashby-spacing-lg);
  background: var(--ashby-primary);
  color: var(--ashby-white);
  text-decoration: none;
  border-radius: var(--ashby-radius-md);
  transition: background var(--ashby-transition);
}

.ashby-apply-link:hover {
  background: var(--ashby-primary-hover);
}

/* =================================================================
   File Input
   ================================================================= */
.ashby-file-input {
  position: relative;
}

.ashby-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ashby-file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--ashby-spacing-xl);
  border: 2px dashed var(--ashby-border);
  border-radius: var(--ashby-radius-lg);
  background: var(--ashby-background);
  cursor: pointer;
  transition: all var(--ashby-transition);
  text-align: center;
}

.ashby-file-label:hover,
.ashby-file-label.drag-over {
  border-color: var(--ashby-primary);
  background: rgba(37, 99, 235, 0.05);
}

.ashby-file-label.has-file {
  border-style: solid;
  border-color: var(--ashby-success);
  background: var(--ashby-success-bg);
}

.ashby-file-label svg {
  margin-bottom: var(--ashby-spacing-sm);
  color: var(--ashby-secondary);
}

.file-label-text {
  font-size: var(--ashby-font-size-sm);
  color: var(--ashby-text-muted);
}

.ashby-file-preview {
  margin-top: var(--ashby-spacing-sm);
}

.file-preview-content {
  display: flex;
  align-items: center;
  gap: var(--ashby-spacing-sm);
  padding: var(--ashby-spacing-sm) var(--ashby-spacing-md);
  background: var(--ashby-white);
  border: 1px solid var(--ashby-border);
  border-radius: var(--ashby-radius-sm);
  font-size: var(--ashby-font-size-sm);
}

.file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--ashby-text-muted);
}

.file-remove {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ashby-text-muted);
  cursor: pointer;
  padding: 0 var(--ashby-spacing-xs);
}

.file-remove:hover {
  color: var(--ashby-error);
}

/* =================================================================
   Checkbox & Multi-select
   ================================================================= */
.ashby-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: var(--ashby-spacing-sm);
}

.ashby-checkbox {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.ashby-checkbox-label {
  cursor: pointer;
  user-select: none;
}

.ashby-multiselect {
  display: flex;
  flex-direction: column;
  gap: var(--ashby-spacing-sm);
}

.ashby-multiselect-option {
  display: flex;
  align-items: center;
  gap: var(--ashby-spacing-sm);
  cursor: pointer;
}

.ashby-multiselect-option input {
  width: 18px;
  height: 18px;
}

/* =================================================================
   Submit Button
   ================================================================= */
.ashby-form-actions {
  margin-top: var(--ashby-spacing-xl);
}

.ashby-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--ashby-spacing-md) var(--ashby-spacing-xl);
  background: var(--ashby-primary);
  color: var(--ashby-white);
  border: none;
  border-radius: var(--ashby-radius-md);
  font-size: var(--ashby-font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ashby-transition);
  min-width: 180px;
}

.ashby-submit-btn:hover:not(:disabled) {
  background: var(--ashby-primary-hover);
}

.ashby-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
}

/* =================================================================
   Form Messages
   ================================================================= */
.ashby-form-message {
  display: flex;
  align-items: flex-start;
  gap: var(--ashby-spacing-md);
  padding: var(--ashby-spacing-lg);
  border-radius: var(--ashby-radius-lg);
  margin-top: var(--ashby-spacing-lg);
}

.ashby-form-message.ashby-success {
  background: var(--ashby-success-bg);
  border: 1px solid var(--ashby-success);
}

.ashby-form-message.ashby-error {
  background: var(--ashby-error-bg);
  border: 1px solid var(--ashby-error);
}

.message-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.ashby-success .message-icon {
  background: var(--ashby-success);
  color: white;
}

.ashby-error .message-icon {
  background: var(--ashby-error);
  color: white;
}

.message-content strong {
  display: block;
  margin-bottom: var(--ashby-spacing-xs);
}

.message-content p {
  margin: 0;
  color: var(--ashby-text-muted);
}

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 768px) {
  .ashby-job-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ashby-spacing-md);
  }

  .ashby-job-arrow {
    align-self: flex-end;
  }

  .ashby-filters {
    flex-direction: column;
  }

  [data-ashby-filter] {
    width: 100%;
  }

  .ashby-job-header .ashby-job-title {
    font-size: var(--ashby-font-size-xl);
  }
}
