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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #06b6d4;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-elevated: #334155;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --border: #334155;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

.header__actions {
  display: flex;
  gap: 12px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn--lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn--full {
  width: 100%;
}

/* Hero */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(135deg, var(--bg) 0%, #1a1040 50%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  position: relative;
  z-index: 1;
}

.hero__content {
  flex: 1;
  max-width: 600px;
}

.hero__content h1 {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.highlight {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__content p {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 32px;
  max-width: 480px;
}

.hero__actions {
  display: flex;
  gap: 16px;
}

.hero__stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 32px;
  text-align: center;
  min-width: 160px;
}

.stat-card__number {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card__label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Section titles */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}

.section-desc {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 40px;
  font-size: 1rem;
}

/* Categories */
.categories {
  padding: 80px 0;
}

.categories__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.category-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.category-card__icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.category-card__name {
  font-weight: 600;
  font-size: 0.9rem;
}

.category-card__count {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Browse */
.browse {
  padding: 80px 0;
  background: var(--bg-card);
}

.browse__controls {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.search-bar {
  flex: 1;
  min-width: 200px;
}

.search-bar__input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar__input:focus {
  border-color: var(--primary);
}

.filter-select {
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  min-width: 160px;
}

.filter-select:focus {
  border-color: var(--primary);
}

.jobs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.job-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}

.job-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.job-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.job-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.job-card__category {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
}

.job-card__budget {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
}

.job-card__desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* How It Works */
.how {
  padding: 80px 0;
}

.how__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.how__step {
  text-align: center;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.how__step:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.how__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.how__step h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.how__step p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Footer */
.footer {
  padding-top: 64px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer__brand p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 8px;
}

.footer__links h4 {
  font-size: 0.9rem;
  margin-bottom: 16px;
  color: var(--text);
}

.footer__links a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 8px;
  transition: color 0.2s;
}

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

.footer__bottom {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.6rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal__close:hover {
  color: var(--text);
}

.modal h2 {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-dim);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--success);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 3000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .hero__inner {
    flex-direction: column;
    text-align: center;
  }

  .hero__content h1 {
    font-size: 2.4rem;
  }

  .hero__content p {
    margin: 0 auto 32px;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__stats {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .how__grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* Auth Pages */
.auth-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 120px 24px 60px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 460px;
  animation: modalIn 0.3s ease;
}

.auth-card--wide {
  max-width: 560px;
}

.auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.auth-desc {
  color: var(--text-dim);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.auth-form .btn {
  margin-top: 8px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.radio-group {
  display: flex;
  gap: 12px;
}

.radio-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s;
  font-size: 0.9rem;
}

.radio-label:has(input:checked) {
  border-color: var(--primary);
}

.radio-label input {
  width: auto;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.alert--error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert--success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Dashboard */
.dashboard {
  padding: 120px 0 60px;
}

.dashboard__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.dashboard__header h1 {
  font-size: 1.8rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  margin-top: 40px;
}

.section-header h1,
.section-header h2 {
  font-size: 1.3rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge--worker {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
}

.badge--employer {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

/* Job Status */
.job-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.job-status--open {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.job-status--in_progress {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.job-status--completed {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.job-status--cancelled,
.job-status--rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.job-status--accepted {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.job-status--pending {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state p {
  color: var(--text-dim);
  margin-bottom: 20px;
  font-size: 1rem;
}

/* Button Small */
.btn--sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* Job Detail */
.job-detail {
  padding: 120px 0 60px;
}

.job-detail__grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
}

.job-detail__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.job-detail__main h1 {
  font-size: 1.8rem;
  margin-bottom: 24px;
}

.job-detail__desc {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 24px;
}

.job-detail__meta {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 32px;
}

.apply-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 24px;
}

.apply-section h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

/* Sidebar */
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.sidebar-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.sidebar-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.app-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.app-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.app-card p {
  margin-bottom: 4px;
}

/* Profile */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .job-detail__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav,
  .header__actions {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 24px;
    gap: 16px;
  }

  .header__actions.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 240px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border);
  }

  .hero__content h1 {
    font-size: 2rem;
  }

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

  .browse__controls {
    flex-direction: column;
  }

  .filter-select {
    min-width: auto;
  }
}
