:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-soft: #eef1f6;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1e4976;
  --primary-dark: #153a5f;
  --accent: #2563eb;
  --border: #e2e8f0;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

main {
  flex: 1 0 auto;
}

html {
  scroll-behavior: smooth;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
video {
  max-width: 100%;
  height: auto;
}

.container {
  width: min(1100px, 100% - 1.5rem);
  margin: 0 auto;
}

.site-nav {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  min-height: 5.5rem;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  height: 76px;
  width: auto;
  max-height: 12vh;
  display: block;
  border-radius: 0.4rem;
}

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

.nav-links a {
  color: #344054;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  transition: background 0.25s ease, color 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--primary);
  background: #f1f5f9;
}

.section {
  padding: 4.8rem 0;
  position: relative;
}

.section-alt {
  background: var(--surface-soft);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  position: relative;
  display: inline-block;
  padding-bottom: 0.35rem;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
}

p {
  color: var(--muted);
  max-width: 75ch;
}

.hero {
  background: linear-gradient(135deg, #0f2744 0%, #1e4976 45%, #2c5282 100%);
  color: #fff;
  overflow: visible;
}

.hero h1,
.hero .lead {
  overflow-wrap: break-word;
}

.hero p,
.hero .eyebrow {
  color: #e2e8f0;
}

.eyebrow {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.lead {
  font-size: clamp(1rem, 2.8vw, 1.1rem);
  max-width: 65ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  text-decoration: none;
  padding: 0.72rem 1.08rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.button:hover,
.button:focus-visible {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(15, 39, 68, 0.22);
}

.button-secondary {
  background: #ffffff;
  color: var(--primary);
  border-color: var(--border);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.button-small {
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
}

.steps,
.role-list {
  margin: 0.8rem 0 1.4rem 1.1rem;
  color: var(--text);
  font-weight: 500;
}

#roles .role-list {
  columns: 2;
  column-gap: 2rem;
}

.form-grid {
  display: grid;
  gap: 0.72rem;
  margin-top: 1.1rem;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.form-status {
  margin: 0.2rem 0 0;
  font-weight: 600;
}

.hidden {
  display: none;
}

label {
  font-weight: 600;
  color: var(--text);
  margin-top: 0.1rem;
}

input,
textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input[type="file"] {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0;
  font-size: 1rem;
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.15rem;
  margin-top: 1.2rem;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.05rem;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-card);
  border-color: #cbd5e1;
}

.card h3 {
  margin-bottom: 0.6rem;
}

.meta {
  margin: 0.5rem 0 1rem;
  color: #334155;
  font-weight: 600;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.job-card-compact {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.job-card-clickable {
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.job-card-clickable:active {
  transform: scale(0.995);
}

.job-card-hit-area {
  display: block;
  padding: 0.95rem 1.05rem;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.job-card-hit-area:hover .job-card-title {
  color: var(--primary);
}

.job-card-hit-area:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.job-card-compact .job-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  transition: color 0.15s ease;
}

.job-card-compact .job-card-location {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.job-card-cta {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.job-detail-section .job-detail-back {
  margin: 0 0 1.25rem;
}

.job-detail-back-link {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.job-detail-back-link:hover,
.job-detail-back-link:focus-visible {
  text-decoration: underline;
}

.job-detail-root {
  max-width: 48rem;
}

.job-detail-loading,
.job-detail-error {
  color: var(--muted);
  font-size: 1rem;
}

.job-detail-error a {
  color: var(--primary);
  font-weight: 600;
}

.job-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-soft);
}

.job-detail-title {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  margin: 0 0 0.5rem;
  line-height: 1.25;
}

.job-detail-location {
  margin: 0 0 1.25rem;
}

.job-detail-body {
  margin-bottom: 1.5rem;
  padding-bottom: 0.25rem;
}

.job-detail-actions {
  margin-top: 0;
}

.footer {
  flex-shrink: 0;
  background: #0f172a;
  color: #cbd5e1;
  padding: 2rem 0;
  padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer p {
  color: #cbd5e1;
  margin: 0.2rem 0;
}

.footer a {
  color: #93c5fd;
}

.employee-portal .employee-portal-header h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.employee-portal .employee-intro {
  max-width: 52rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.admin-login-shell {
  max-width: 28rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.admin-login-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.admin-login-subtitle {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.5rem;
  border: 1px solid #1e293b;
}

.admin-session-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.admin-session-label {
  font-size: 0.875rem;
  color: #94a3b8;
}

.admin-session-user {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.button-logout {
  background: transparent;
  color: #f8fafc;
  border: 1px solid #64748b;
}

.button-logout:hover,
.button-logout:focus-visible {
  background: rgba(248, 250, 252, 0.1);
  border-color: #94a3b8;
  box-shadow: none;
}

.admin-dashboard {
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.admin-dashboard-head {
  margin-bottom: 1.5rem;
}

.admin-dashboard-head h2 {
  margin-bottom: 0.35rem;
}

.admin-dashboard-lead {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-form-block,
.admin-list-block {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.admin-form-block h3,
.admin-list-block h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.admin-list-hint {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.admin-job-form.form-grid {
  margin-top: 0.75rem;
}

.job-description-label {
  font-weight: 600;
  color: var(--text);
}

.job-description-hint {
  margin: -0.25rem 0 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

.job-description-editor-wrap {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  overflow: hidden;
  background: var(--surface);
}

.job-description-editor-wrap .ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  flex-wrap: wrap;
  row-gap: 0.35rem;
  padding: 0.35rem 0.25rem;
}

.job-description-editor-wrap .ql-toolbar .ql-formats {
  margin-right: 0.35rem;
  margin-bottom: 0.15rem;
}

.job-description-editor-wrap .ql-container.ql-snow {
  border: none;
  font-size: 1rem;
  min-height: 12rem;
}

.job-description-rich {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.job-description-rich p {
  margin: 0 0 0.65em;
}

.job-description-rich p:last-child {
  margin-bottom: 0;
}

.job-description-rich ul,
.job-description-rich ol {
  margin: 0.4em 0 0.75em;
  padding-left: 1.35rem;
}

.job-description-rich li {
  margin: 0.25em 0;
}

.job-description-rich strong {
  color: var(--text);
  font-weight: 600;
}

.job-description-rich a {
  color: var(--primary);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.job-description-rich h2,
.job-description-rich h3 {
  font-size: 1.05rem;
  margin: 0.75em 0 0.35em;
  color: var(--text);
}

.job-description-rich h2:first-child,
.job-description-rich h3:first-child,
.job-description-rich p:first-child {
  margin-top: 0;
}

.admin-job-description-rich {
  max-height: 14rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.admin-job-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 0.9rem;
}

.admin-job-card {
  padding: 1rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.admin-job-card h4 {
  margin: 0 0 0.5rem;
}

.admin-access {
  max-width: 520px;
}

.reveal {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reveal.in-view {
  opacity: 1;
}

#employee-panel {
  background: transparent;
}

@media (max-width: 900px) {
  .section {
    padding: 3.5rem 0;
  }

  .hero.section {
    padding-top: 3rem;
    padding-bottom: 3.25rem;
  }
}

@media (max-width: 700px) {
  .nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    min-height: auto;
    padding: 0.65rem 0;
  }

  .brand {
    align-self: flex-start;
  }

  .nav-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.2rem 0 0.45rem;
    margin: 0 -0.15rem;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .nav-links a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.55rem 0.75rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .brand-logo {
    height: clamp(48px, 14vw, 64px);
    max-height: none;
  }

  .section {
    padding: 2.75rem 0;
  }

  .hero.section {
    padding-top: 2.5rem;
    padding-bottom: 2.75rem;
  }

  #roles .role-list {
    columns: 1;
  }

  .form-grid {
    max-width: none;
    padding: 0.9rem;
  }

  .admin-form-block,
  .admin-list-block {
    padding: 1rem;
  }

  .admin-session-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .admin-session-meta {
    justify-content: center;
  }

  .button-logout {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(1100px, 100% - 1.25rem);
  }

  .section {
    padding: 2.25rem 0;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-row .button,
  .cta-row a.button {
    width: 100%;
    text-align: center;
    min-height: 48px;
  }

  input,
  textarea,
  select {
    font-size: 1rem;
    min-height: 48px;
  }

  textarea {
    min-height: 8rem;
  }

  .button:not(.button-logout) {
    min-height: 48px;
    width: 100%;
    max-width: 100%;
  }

  .button.button-small {
    min-height: 44px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .admin-job-card .cta-row {
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transition: none;
  }

  .button,
  .card,
  .job-card-clickable {
    transition: none;
  }

  .job-card-clickable:active {
    transform: none;
  }
}
