*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple: #5b4ef8;
  --purple-dark: #4338e0;
  --purple-bg: #eeeefe;
  --gray-light: #f3f4f8;
  --gray-text: #6b7280;
  --border: #e5e7eb;
  --dark: #111827;
  --white: #fff;
  --radius: 14px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--gray-light);
  color: var(--dark);
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}


/* ── PAGE ────────────────────────────────── */
.page {
  padding-top: 64px;
  min-height: 100vh;
}

/* ══ VIEWS ══ */
#companies-view {
  display: block;
}

#openings-view {
  display: none;
}

/* ── COMPANIES HEADER ────────────────────── */
.companies-header {
  background: white;
  padding: 40px 40px 32px;
  border-bottom: 1px solid var(--border);
}

.companies-header-inner {
  max-width: 1280px;
  margin: auto;
}

.companies-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.companies-header p {
  color: var(--gray-text);
  font-size: .95rem;
  margin-bottom: 24px;
}

.search-filter-row {
  display: flex;
  gap: 12px;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  width: 16px;
  height: 16px;
}

.search-box input {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 16px 0 42px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--dark);
  background: white;
  outline: none;
  transition: border-color .2s;
}

.search-box input:focus {
  border-color: var(--purple);
}

.search-box input::placeholder {
  color: #adb5bd;
}

.industry-select {
  height: 46px;
  min-width: 180px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 36px 0 14px;
  font-family: inherit;
  font-size: .875rem;
  color: #374151;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
}

.industry-select:focus {
  border-color: var(--purple);
}

/* ── COMPANIES GRID ──────────────────────── */
.companies-content {
  max-width: 1280px;
  margin: auto;
  padding: 32px 40px 60px;
}

.companies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.company-card {
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color .2s, box-shadow .2s;
}

.company-card:hover {
  border-color: #c4bcfd;
  box-shadow: 0 4px 20px rgba(91, 78, 248, .08);
}

.cc-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.cc-logo {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cc-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.cc-industry {
  font-size: .82rem;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: 4px;
}

.cc-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  color: var(--gray-text);
}

.cc-location svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.cc-desc {
  font-size: .855rem;
  color: #4b5563;
  line-height: 1.65;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cc-meta {
  display: flex;
  gap: 18px;
  margin-bottom: 16px;
  font-size: .8rem;
  color: var(--gray-text);
}

.cc-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cc-meta svg {
  width: 13px;
  height: 13px;
}

.cc-actions {
  display: flex;
  gap: 10px;
}

.btn-view-openings {
  flex: 1;
  height: 40px;
  background: var(--purple-bg);
  color: var(--purple);
  border: 1.5px solid #c4bcfd;
  border-radius: 9px;
  font-size: .875rem;
  font-weight: 700;
  transition: background .2s, border-color .2s;
}

.btn-view-openings:hover {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
}

.btn-ext {
  width: 40px;
  height: 40px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--gray-text);
  transition: border-color .2s, color .2s;
  flex-shrink: 0;
}

.btn-ext:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.btn-ext svg {
  width: 15px;
  height: 15px;
}

.no-results {
  text-align: center;
  padding: 60px 0;
  color: var(--gray-text);
  grid-column: 1 / -1;
}

.no-results svg {
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  color: #d1d5db;
  display: block;
  margin: 0 auto 14px;
}

/* ══════════════════════════════════════════
       OPENINGS VIEW
    ══════════════════════════════════════════ */
.openings-header {
  background: white;
  padding: 32px 40px 28px;
  border-bottom: 1px solid var(--border);
}

.openings-header-inner {
  max-width: 1280px;
  margin: auto;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  color: var(--gray-text);
  background: none;
  border: none;
  margin-bottom: 20px;
  transition: color .2s;
}

.back-btn:hover {
  color: var(--purple);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.company-profile-banner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cpb-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.cpb-info h1 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.cpb-industry {
  font-size: .85rem;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: 6px;
}

.cpb-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--gray-text);
}

.cpb-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cpb-meta svg {
  width: 13px;
  height: 13px;
}

.cpb-meta a {
  color: var(--purple);
  font-weight: 600;
}

.cpb-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.btn-website {
  height: 40px;
  padding: 0 18px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: white;
  color: var(--gray-text);
  font-size: .875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color .2s, color .2s;
}

.btn-website:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.btn-website svg {
  width: 14px;
  height: 14px;
}

/* About strip */
.about-strip {
  background: white;
  border-top: 1px solid var(--border);
  padding: 0 40px;
}

.about-strip-inner {
  max-width: 1280px;
  margin: auto;
  padding: 20px 0;
  font-size: .875rem;
  color: #4b5563;
  line-height: 1.7;
  border-bottom: 1px solid var(--border);
}

/* Openings content */
.openings-content {
  max-width: 1280px;
  margin: auto;
  padding: 28px 40px 60px;
}

.openings-label {
  font-size: .9rem;
  color: var(--gray-text);
  margin-bottom: 18px;
}

.openings-label strong {
  color: var(--dark);
}

/* reuse listing cards */
.listings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.listing-card {
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 24px;
  transition: border-color .2s, box-shadow .2s;
  cursor: default;
}

.listing-card:hover {
  border-color: #c4bcfd;
  box-shadow: 0 4px 20px rgba(91, 78, 248, .08);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.card-logo {
  width: 52px;
  height: 52px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.card-title-block h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.card-title-block p {
  font-size: .85rem;
  color: var(--gray-text);
}

.mode-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 600;
}

.badge-hybrid {
  background: #eef2ff;
  color: #6366f1;
}

.badge-remote {
  background: #ecfdf5;
  color: #10b981;
}

.badge-onsite {
  background: #fff7ed;
  color: #f97316;
}

.badge-weeks {
  background: #f9fafb;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .8rem;
  color: var(--gray-text);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.meta-row span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.meta-row svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.skill-tag {
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .775rem;
  border: 1px solid transparent;
}

.st-blue {
  background: #eff6ff;
  color: #3b82f6;
  border-color: #bfdbfe;
}

.st-cyan {
  background: #ecfeff;
  color: #06b6d4;
  border-color: #a5f3fc;
}

.st-violet {
  background: #f5f3ff;
  color: #7c3aed;
  border-color: #ddd6fe;
}

.st-green {
  background: #ecfdf5;
  color: #10b981;
  border-color: #a7f3d0;
}

.st-pink {
  background: #fdf2f8;
  color: #ec4899;
  border-color: #fbcfe8;
}

.st-orange {
  background: #fff7ed;
  color: #f97316;
  border-color: #fed7aa;
}

.st-gray {
  background: #f9fafb;
  color: #374151;
  border-color: #e5e7eb;
}

.st-teal {
  background: #f0fdfa;
  color: #0d9488;
  border-color: #99f6e4;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f3f4f6;
  padding-top: 14px;
  font-size: .82rem;
}

.applicants {
  color: var(--gray-text);
  display: flex;
  align-items: center;
  gap: 5px;
}

.applicants svg {
  width: 13px;
  height: 13px;
}

.apply-link {
  color: var(--purple);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* empty openings */
.empty-openings {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-text);
  grid-column: 1/-1;
}

.empty-openings svg {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  display: block;
  color: #d1d5db;
}

.empty-openings h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
}

.empty-openings p {
  font-size: .875rem;
}

body {
  overflow-x: hidden;
}

/* page padding */
@media (max-width: 1024px) {
  .companies-header,
  .companies-section,
  .companies-grid-wrapper,
  .companies-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .companies-filters,
  .search-filter-row,
  .filter-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .companies-grid,
  .company-grid,
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .companies-header,
  .companies-section,
  .companies-grid-wrapper,
  .companies-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .companies-header h1,
  .page-title {
    font-size: 2rem;
    line-height: 1.15;
  }

  .companies-header p,
  .page-subtitle {
    font-size: 1rem;
    line-height: 1.5;
  }

  .companies-grid,
  .company-grid,
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .company-card {
    padding: 20px 18px;
    border-radius: 20px;
  }

  .company-card-top,
  .company-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
  }

  .company-logo,
  .company-image {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 16px;
    object-fit: cover;
  }

  .company-title,
  .company-card h3 {
    font-size: 1.65rem;
    line-height: 1.2;
    margin-bottom: 6px;
    word-break: break-word;
  }

  .company-category,
  .company-industry,
  .company-location {
    font-size: 0.98rem;
    line-height: 1.4;
  }

  .company-description,
  .company-card p {
    font-size: 1rem;
    line-height: 1.65;
  }

  .company-stats,
  .card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .company-actions,
  .card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
  }

  .company-actions .btn,
  .card-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  input,
  select,
  .search-input,
  .filter-select {
    min-height: 48px;
    font-size: 1rem;
  }
}

@media (max-width: 520px) {
  .companies-header h1,
  .page-title {
    font-size: 1.8rem;
  }

  .company-card-top,
  .company-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .company-logo,
  .company-image {
    width: 88px;
    height: 88px;
  }

  .company-stats,
  .card-meta,
  .company-actions,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .company-title,
  .company-card h3 {
    font-size: 1.45rem;
  }

  .company-description,
  .company-card p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}