/* CSS Variables */
:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--gray-600);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.125rem;
  opacity: 0.9;
}

/* Filters */
.filters {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: -2rem auto 2rem;
  max-width: 1000px;
  position: relative;
  z-index: 10;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select,
.filter-group input {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: white;
  color: var(--gray-800);
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #047857;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Job List */
.jobs-section {
  padding: 2rem 0;
}

.jobs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.jobs-count {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Job Card */
.job-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  transition: box-shadow 0.15s ease;
}

.job-card:hover {
  box-shadow: var(--shadow-lg);
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.job-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.job-title a {
  color: inherit;
}

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

.job-client {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.job-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.job-meta-icon {
  width: 1rem;
  height: 1rem;
  opacity: 0.7;
}

.job-summary {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.skill-tag {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.job-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

.job-dates {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.job-closing {
  color: var(--warning);
}

.job-closing.urgent {
  color: var(--danger);
  font-weight: 500;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-clearance {
  background: #dbeafe;
  color: #1e40af;
}

.badge-clearance.baseline {
  background: #dcfce7;
  color: #166534;
}

.badge-clearance.nv1 {
  background: #fef3c7;
  color: #92400e;
}

.badge-clearance.nv2 {
  background: #fee2e2;
  color: #991b1b;
}

.badge-clearance.pv {
  background: #f3e8ff;
  color: #6b21a8;
}

.badge-location {
  background: var(--gray-100);
  color: var(--gray-700);
}

.badge-work-type {
  background: #e0e7ff;
  color: #3730a3;
}

/* Job Detail Page */
.job-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.job-detail-header {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.job-detail-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.job-detail-client {
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

.job-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.job-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-value {
  font-weight: 500;
  color: var(--gray-800);
}

.job-detail-body {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.job-detail-body h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

.job-description {
  color: var(--gray-700);
  white-space: pre-wrap;
}

.job-detail-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Application Form */
.apply-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.apply-header {
  text-align: center;
  margin-bottom: 2rem;
}

.apply-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.apply-header p {
  color: var(--gray-600);
}

.apply-form {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
}

.form-group .required {
  color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* Consent Checkbox */
.consent-group {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin-top: 0.25rem;
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--gray-700);
}

.checkbox-text a {
  color: var(--primary);
  font-weight: 500;
}

.checkbox-text a:hover {
  text-decoration: underline;
}

.consent-group .form-hint {
  margin-top: 0.75rem;
  margin-left: 1.75rem;
}

/* File Upload */
.file-upload {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.file-upload:hover {
  border-color: var(--primary-light);
  background: var(--gray-50);
}

.file-upload.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.file-upload-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  color: var(--gray-400);
}

.file-upload-text {
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.file-upload-hint {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.file-upload input {
  display: none;
}

.file-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  margin-top: 1rem;
}

.file-selected-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-700);
}

.file-selected-remove {
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
}

.file-selected-remove:hover {
  color: var(--danger);
}

/* Success Message */
.success-message {
  text-align: center;
  padding: 3rem 2rem;
}

.success-icon {
  width: 4rem;
  height: 4rem;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.success-message h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.success-message p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--gray-500);
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Error State */
.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-500);
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

/* Footer */
.footer {
  background: var(--gray-800);
  color: var(--gray-400);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .job-card-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .job-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .job-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .job-detail-actions {
    flex-direction: column;
  }
}
