:root {
  --navy: #0d1b3e;
  --gold: #c9a227;
  --blue: #1565c0;
  --blue-dark: #0d47a1;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1a2332;
  --muted: #64748b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(21, 101, 192, 0.35);
}

.job-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.btn-view {
  background: #eef2ff;
  color: var(--navy);
  border: 1px solid #c7d2fe;
}

.btn-view:hover {
  background: #e0e7ff;
}

.btn-apply {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 27, 62, 0.2);
}

.btn-apply:hover {
  background: #152a52;
}

.state-wrap {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.state-wrap h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--navy);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #dbe4f0;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.state-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 24px;
}

.hero {
  background: linear-gradient(145deg, var(--navy) 0%, #1a3568 55%, #243f75 100%);
  color: #fff;
  padding: 52px 20px 64px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(201, 162, 39, 0.12);
  pointer-events: none;
}

.hero-inner,
.main-inner {
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.company-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.company-avatar {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 2px solid rgba(201, 162, 39, 0.5);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
}

.company-avatar.fallback {
  background: rgba(255, 255, 255, 0.1);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
}

.hero-location {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
}

.muted { color: var(--muted); font-size: 0.95rem; }

.about {
  margin: 20px 0 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

.links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.links a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
}

.links a:hover { background: rgba(255, 255, 255, 0.18); }

.hero-cta {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.hero-cta-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  max-width: 520px;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.main {
  margin-top: -32px;
  padding: 0 20px 48px;
}

.section-head {
  margin-bottom: 20px;
}

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.job-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(13, 27, 62, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.job-card {
  cursor: pointer;
}

.job-card:hover {
  box-shadow: 0 12px 32px rgba(13, 27, 62, 0.1);
  transform: translateY(-2px);
}

.job-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.job-card.featured {
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: 0 10px 28px rgba(201, 162, 39, 0.14);
}

.job-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 9px;
  border-radius: 6px;
  background: #e8f1ff;
  color: var(--blue);
}

.badge.gold { background: #fff8e7; color: #9a7b0a; }
.badge.green { background: #e8f5e9; color: #2e7d32; }

.job-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
}

.job-meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.job-desc {
  margin: 0;
  font-size: 14px;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
}

.job-footer {
  margin-top: auto;
  padding-top: 10px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid #f1f5f9;
}

.empty {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty h3 {
  margin-bottom: 8px;
}

.footer {
  text-align: center;
  padding: 28px 20px 44px;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-sub {
  margin: 6px 0 0;
  font-size: 13px;
}

.footer-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

/* Apply modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 62, 0.55);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px rgba(13, 27, 62, 0.25);
  text-align: left;
  max-height: min(90vh, 860px);
  overflow-y: auto;
}

.modal-card-wide {
  width: min(640px, 100%);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #e2e8f0;
}

.job-detail-title {
  margin: 8px 0 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.25;
}

.job-detail-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.job-detail-facts {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.detail-fact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.detail-fact-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.detail-fact-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  text-align: right;
}

.job-detail-section {
  margin-top: 20px;
}

.job-detail-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.job-detail-description {
  margin: 0;
  white-space: pre-wrap;
  color: #334155;
  font-size: 14px;
  line-height: 1.6;
}

.apply-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.apply-panel-text {
  margin: 0;
  color: #475569;
  font-size: 14px;
}

.modal-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.modal-job {
  margin: 10px 0 0;
  font-weight: 800;
  color: var(--navy);
  font-size: 15px;
}

.modal-text {
  margin: 14px 0 0;
  color: #475569;
  font-size: 14px;
}

.modal-steps {
  text-align: left;
  margin: 16px 0 0;
  padding-left: 20px;
  color: #475569;
  font-size: 13px;
}

.modal-steps li { margin-bottom: 8px; }

.modal-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

@media (max-width: 600px) {
  .company-row { align-items: flex-start; }
  .jobs-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
  .job-card-actions { grid-template-columns: 1fr; }
  .detail-fact { flex-direction: column; gap: 4px; }
  .detail-fact-value { text-align: left; }
}
