/* ============================================
   LASTING DYNAMICS HIRING PORTAL
   Design System CSS

   Based on:
   - DESIGN-SYSTEM.md brand specifications
   - Geist font family
   - Brand color #0066D6
   - Clean, spacious, card-based UI
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
  /* ---- Blue Palette ---- */
  --ld-blue-50:  #E6F2FF;
  --ld-blue-100: #CCE5FF;
  --ld-blue-200: #99CCFF;
  --ld-blue-300: #66B2FF;
  --ld-blue-400: #3399FF;
  --ld-blue-500: #0066D6;
  --ld-blue-600: #0066DB;
  --ld-blue-700: #0052B8;
  --ld-blue-800: #003D8A;
  --ld-blue-900: #00295C;

  /* ---- Text Colors ---- */
  --text-primary:   #111827;
  --text-secondary:  #4B5563;
  --text-muted:      #6B7280;
  --text-link:       #0066D6;

  /* ---- Backgrounds ---- */
  --bg-white:    #FFFFFF;
  --bg-gray-50:  #F9FAFB;
  --bg-gray-100: #F3F4F6;
  --bg-gray-800: #1F2937;
  --bg-gray-900: #111827;

  /* ---- Borders ---- */
  --border-light:  #E5E7EB;
  --border-subtle: #F3F4F6;

  /* ---- Semantic ---- */
  --color-success: #10B981;
  --color-error:   #EF4444;
  --color-warning: #F59E0B;

  /* ---- Shadows ---- */
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:   0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:   0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-blue: 0 4px 12px rgba(0, 102, 214, 0.1);

  /* ---- Spacing Scale ---- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-28: 112px;

  /* ---- Border Radius ---- */
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* ---- Transitions ---- */
  --transition-fast:   150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow:   300ms ease;

  /* ---- Layout ---- */
  --container-max: 1280px;
  --container-px:  24px;
  --header-height: 72px;
}

@media (min-width: 1024px) {
  :root {
    --container-px: 32px;
    --header-height: 80px;
  }
}


/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  /* Prevent layout shift from scrollbar */
  scrollbar-gutter: stable;
}

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-white);
  overflow-x: hidden;
}

img, picture, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--ld-blue-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}


/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-5);
  background: var(--ld-blue-500);
  color: var(--bg-white);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

.text-center {
  text-align: center;
}


/* ============================================
   TYPOGRAPHY
   ============================================ */

/* Section label — the distinctive LD blue uppercase label */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ld-blue-500);
  margin-bottom: var(--space-3);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: 2.75rem; /* 44px mobile */
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem; /* 32px mobile */
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.25rem; /* 20px */
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

@media (min-width: 768px) {
  h1 {
    font-size: 3rem; /* 48px */
  }
  h2 {
    font-size: 2.25rem; /* 36px */
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 3.5rem; /* 56px — DESIGN-SYSTEM.md spec */
  }
  h2 {
    font-size: 2.5rem; /* 40px — DESIGN-SYSTEM.md spec */
  }
}


/* ============================================
   BUTTONS & CTAs
   ============================================ */

/* Primary button — filled blue */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--ld-blue-500);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  text-decoration: none;
  background-color: var(--ld-blue-500);
  color: var(--bg-white);
}

.btn-primary:hover {
  background-color: var(--ld-blue-600);
  border-color: var(--ld-blue-600);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  background-color: var(--ld-blue-700);
}

/* Full-width button */
.btn-full {
  display: block;
  width: 100%;
  text-align: center;
}

/* Large button */
.btn-lg {
  padding: 14px 32px;
  font-size: 1.05rem;
}

/* Link CTA — text link with arrow animation */
.link-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--ld-blue-500);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: gap var(--transition-normal);
}

.link-cta:hover {
  gap: var(--space-2);
}

.link-cta span[aria-hidden] {
  transition: transform var(--transition-normal);
}

.link-cta:hover span[aria-hidden] {
  transform: translateX(4px);
}


/* ============================================
   BADGES
   ============================================ */

/* Department badge on job cards */
.department-badge {
  display: flex;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background-color: var(--ld-blue-50);
  color: var(--ld-blue-600);
  line-height: 1.3;
  justify-self: flex-start;
}

/* Location/type meta badges */
.job-meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Dot separator between meta items */
.job-meta span + span::before {
  content: '·';
  margin-right: var(--space-1);
  color: var(--border-light);
  font-weight: 700;
}


/* ============================================
   HEADER
   ============================================ */

header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow var(--transition-normal);
}

/* Add subtle shadow on scroll (via JS class toggle) */
header[role="banner"].scrolled {
  box-shadow: var(--shadow-sm);
}

header[role="banner"] nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

/* Logo */
header[role="banner"] nav > a:first-child {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

header[role="banner"] nav > a:first-child img {
  height: 32px;
  width: auto;
}

/* Main nav links */
header[role="banner"] ul[role="menubar"] {
  display: none; /* hidden on mobile — hamburger needed */
  gap: var(--space-6);
  align-items: center;
}

header[role="banner"] ul[role="menubar"] a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-2) 0;
  position: relative;
  transition: color var(--transition-fast);
}

header[role="banner"] ul[role="menubar"] a:hover {
  color: var(--text-primary);
}

header[role="banner"] ul[role="menubar"] a[aria-current="page"] {
  color: var(--ld-blue-500);
}

/* Active indicator underline */
header[role="banner"] ul[role="menubar"] a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--ld-blue-500);
  border-radius: 1px;
}

/* Language dropdown selector */
.lang-dropdown {
  position: relative;
  margin-left: auto;
  font-size: 0.8125rem;
  font-weight: 500;
}

.lang-dropdown > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-white);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  list-style: none; /* remove default marker */
  transition: all var(--transition-fast);
}

.lang-dropdown > summary::-webkit-details-marker {
  display: none;
}

.lang-dropdown > summary:hover {
  border-color: var(--ld-blue-300);
  background-color: var(--bg-gray-50);
}

.lang-dropdown[open] > summary {
  border-color: var(--ld-blue-500);
}

.lang-dropdown > summary .lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-dropdown > summary .lang-chevron {
  transition: transform var(--transition-fast);
  color: var(--text-muted);
  flex-shrink: 0;
}

.lang-dropdown[open] > summary .lang-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel */
.lang-options {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 100;
  min-width: 150px;
  background-color: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 4px;
  list-style: none;
  margin: 0;
}

.lang-options li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.lang-options li a:hover {
  background-color: var(--bg-gray-50);
  color: var(--text-primary);
}

.lang-options li a[aria-current="true"] {
  color: var(--ld-blue-500);
  font-weight: 600;
  background-color: var(--ld-blue-50);
}

.lang-options li a .lang-flag {
  font-size: 1.125rem;
  line-height: 1;
}

/* Header CTA button */
header[role="banner"] nav > .btn-primary {
  display: inline-flex;
  margin-left: auto;
  padding: 8px 20px;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

/* Desktop nav */
@media (min-width: 768px) {
  header[role="banner"] ul[role="menubar"] {
    display: flex;
  }

  header[role="banner"] nav > .btn-primary {
    display: inline-flex;
    margin-left: 0;
  }

  .lang-dropdown {
    margin-left: 0;
  }
}

/* Push CTA to right edge */
@media (min-width: 768px) {
  header[role="banner"] nav {
    gap: var(--space-6);
  }

  header[role="banner"] ul[role="menubar"] {
    flex: 1;
  }
}

/* Mobile hamburger menu toggle */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.mobile-menu-toggle:hover {
  background-color: var(--bg-gray-50);
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 1px;
  transition: all var(--transition-normal);
}

/* Hide hamburger on desktop */
@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}


/* ============================================
   BREADCRUMB
   ============================================ */

nav[aria-label="Breadcrumb"] {
  padding: var(--space-4) 0 0;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}

nav[aria-label="Breadcrumb"] ol {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

nav[aria-label="Breadcrumb"] a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

nav[aria-label="Breadcrumb"] a:hover {
  color: var(--ld-blue-500);
}

/* Separator between crumbs */
nav[aria-label="Breadcrumb"] li + li::before {
  content: '/';
  margin-right: var(--space-2);
  color: var(--border-light);
}


/* ============================================
   JOB CARD (Base styles for related positions)
   ============================================ */

.job-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.job-card:hover {
  border-color: var(--ld-blue-500);
  box-shadow: var(--shadow-blue);
}

.job-card .department-badge {
  margin-bottom: var(--space-3);
}

.job-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.job-card h3 a {
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.job-card h3 a:hover {
  color: var(--ld-blue-500);
}

.job-card .job-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
  margin-bottom: var(--space-3);
}

.job-card .salary {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-success);
  margin-bottom: var(--space-5);
  /* Push footer to bottom */
  margin-top: auto;
  padding-top: var(--space-3);
}


/* ============================================
   JOB DETAIL PAGE (Single position)
   ============================================ */

.job-detail {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-10) var(--container-px) var(--space-10);
}

.job-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: auto 1fr;
  gap: var(--space-10);
  align-items: start;
}

.job-detail-header {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 0;
}

.job-detail-content {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.job-detail-sidebar {
  grid-column: 2;
  grid-row: 1 / -1;
}

.job-detail-logo {
  display: inline-block;
  margin-bottom: var(--space-6);
  transition: opacity var(--transition-normal);
}

.job-detail-logo:hover {
  opacity: 0.7;
}

.job-detail-logo img {
  height: 36px;
  width: auto;
}


.job-detail-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  margin: var(--space-3) 0 var(--space-3);
  color: var(--text-primary);
}

.job-detail-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: var(--space-10) 0 var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid #f3f4f6;
}

.job-detail-content h2:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.job-detail-content p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.job-detail-content strong {
  color: var(--text-primary);
}

/* Requirements lists */
.job-requirements-list {
  padding-left: var(--space-6);
  margin-bottom: var(--space-6);
  list-style: decimal;
}

ul.job-requirements-list {
  list-style: disc;
}

.job-requirements-list li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  position: relative;
}

.job-requirements-list li::marker {
  color: var(--text-primary);
}

/* Benefits grid */
.job-benefits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.job-benefit-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-gray-50);
  border-radius: 10px;
}

.job-benefit-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ld-blue-50);
  color: var(--ld-blue-500);
}

.job-benefit-icon svg {
  width: 24px;
  height: 24px;
}

.job-benefit-item strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.job-benefit-item p {
  font-size: 0.875rem;
  margin: 0;
  color: var(--text-muted);
}

/* Team photo */
.team-photo {
  margin: var(--space-8) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.team-photo img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Process (ordered list) */
.job-process-list {
  counter-reset: process;
  list-style: none;
  padding: 0;
}

.job-process-list li {
  counter-increment: process;
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid #f3f4f6;
}

.job-process-list li::before {
  content: counter(process);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  background: var(--ld-blue-500);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.job-process-list li strong {
  display: block;
  color: var(--text-primary);
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.job-process-list li p {
  margin: 0;
  font-size: 0.9rem;
}

/* Sidebar */
.job-detail-sidebar {
  position: sticky;
  top: var(--space-10);
}

.job-sidebar-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: var(--space-6);
}

.job-sidebar-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.job-sidebar-details {
  margin: 0 0 var(--space-5);
}

.job-sidebar-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid #f3f4f6;
}

.job-sidebar-row dt {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.job-sidebar-row dd {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.job-sidebar-row dd.salary {
  color: var(--color-success);
}

.job-sidebar-share {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid #f3f4f6;
  text-align: center;
}

.job-sidebar-share p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.share-links {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}

.share-links a,
.share-links button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-secondary);
  background: #f3f4f6;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.share-links a:hover,
.share-links button:hover {
  color: var(--ld-blue-500);
  background: #e8f0fe;
  text-decoration: none;
}

.copy-link-btn.copied {
  color: var(--color-success);
  background: #ecfdf5;
}


/* ============================================
   RELATED POSITIONS
   ============================================ */

.related-positions {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-12) var(--container-px);
  text-align: center;
}

.related-positions h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: var(--space-3) 0 var(--space-8);
}

.related-positions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  text-align: left;
}

.related-positions-grid .job-card {
  padding: var(--space-6);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.related-positions-grid .job-card:hover {
  border-color: var(--ld-blue-500);
  box-shadow: 0 4px 12px rgba(0, 102, 214, 0.1);
}

.related-positions-grid .job-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: var(--space-2) 0;
}

.related-positions-grid .job-card h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.related-positions-grid .job-card h3 a:hover {
  color: var(--ld-blue-500);
}


/* ============================================
   APPLICATION FORM
   ============================================ */

.application-section {
  background: var(--bg-gray-50);
  padding: var(--space-16) 0;
}

.application-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.application-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.application-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: var(--space-3) 0 var(--space-3);
}

.application-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.application-form {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: var(--space-8);
  overflow: hidden;
}

.form-row {
  margin-bottom: var(--space-5);
}

.form-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.form-row--2col > * {
  min-width: 0;
}

.form-group label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.required {
  color: var(--color-error);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ld-blue-500);
  box-shadow: 0 0 0 3px rgba(0, 102, 214, 0.1);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-size: 16px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

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

/* Campi invalidi evidenziati dopo submit attempt */
.application-form.was-validated input:not([type="hidden"]):not([type="file"]):not([type="checkbox"]):invalid,
.application-form.was-validated select:invalid,
.application-form.was-validated textarea:invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.application-form.was-validated input[type="checkbox"]:invalid {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

.application-form.was-validated .file-upload-area:has(input:invalid) {
  border-color: #ef4444;
}

/* File upload area */
.file-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: var(--space-10);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--ld-blue-500);
  background: var(--ld-blue-50);
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-prompt {
  color: var(--text-muted);
}

.file-upload-prompt svg {
  color: var(--ld-blue-500);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-2);
}

.file-upload-prompt strong {
  color: var(--ld-blue-500);
}

.file-upload-hint {
  font-size: 0.8rem;
  margin-top: var(--space-1);
}

/* File selected state */
.file-upload-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ld-blue-50, #eff6ff);
  border: 1px solid var(--ld-blue-200, #bfdbfe);
  border-radius: 8px;
  color: var(--ld-blue-700, #1d4ed8);
}

.file-upload-selected svg {
  flex-shrink: 0;
  color: var(--ld-blue-500);
}

.file-upload-selected-name {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.file-upload-remove:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* Hide prompt when file is selected */
.file-upload-area.has-file .file-upload-prompt {
  display: none;
}

.file-upload-area.has-file {
  border-style: solid;
  border-color: var(--ld-blue-200, #bfdbfe);
  background: transparent;
  padding: 0;
  overflow: hidden;
}

/* Checkbox */
.form-group--checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.form-group--checkbox input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--ld-blue-500);
  flex-shrink: 0;
}

.form-group--checkbox label {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
}

.form-group--checkbox label a {
  color: var(--ld-blue-500);
}

/* Submit row */
.form-row--submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

/* Loading state */
.form-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8, 64px) var(--space-4);
  gap: var(--space-4);
  color: var(--text-muted);
  font-size: 1rem;
}

.form-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-default, #e5e7eb);
  border-top-color: var(--ld-blue-500);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Success / Error messages */
.form-message {
  padding: var(--space-6, 48px) var(--space-4);
  border-radius: 10px;
  text-align: center;
}

.form-message--success {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
}

.form-message--error {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.form-message strong {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.form-message p {
  font-size: 0.95rem;
  margin: 0 0 8px;
  line-height: 1.5;
}

.form-message p:last-child {
  margin-bottom: 0;
}

.form-message a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-message a:hover {
  opacity: 0.8;
}

/* Inline validation states */
.form-group--invalid input,
.form-group--invalid select,
.form-group--invalid textarea {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-group--valid input,
.form-group--valid select,
.form-group--valid textarea {
  border-color: var(--color-success) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.form-error-message {
  font-size: 0.8rem;
  color: var(--color-error);
  margin-top: var(--space-1);
}

/* Help text under form fields */
.form-help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Disabled button state */
.btn-primary:disabled,
.btn-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Form progress bar */
.form-progress {
  margin-bottom: var(--space-6);
}

.form-progress-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}

.form-progress-fill {
  height: 100%;
  background: var(--ld-blue-500);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.form-progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
  text-align: right;
}


/* ============================================
   COUNTRY SELECT (Searchable combobox)
   ============================================ */

.country-select {
  position: relative;
}

.country-select__input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: text;
}

.country-select__input:focus {
  outline: none;
  border-color: var(--ld-blue-500);
  box-shadow: 0 0 0 3px rgba(0, 102, 214, 0.1);
}

.country-select__arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #6b7280;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
}

.country-select[aria-expanded="true"] .country-select__arrow {
  transform: translateY(-50%) rotate(180deg);
}

.country-select__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  margin: 0;
  list-style: none;
}

.country-select__option {
  padding: 8px 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.country-select__option:hover,
.country-select__option--focused {
  background: var(--bg-gray-50);
  color: var(--text-primary);
}

.country-select__option--selected {
  background: var(--ld-blue-50);
  color: var(--ld-blue-600);
  font-weight: 500;
}

.country-select__option--no-results {
  padding: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  cursor: default;
}

/* Validation integration */
.form-group--invalid .country-select__input {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-group--valid .country-select__input {
  border-color: var(--color-success) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Noscript fallback: show native select when JS disabled */
noscript ~ .country-select {
  display: none;
}


/* ============================================
   SOCIAL PROOF
   ============================================ */

.social-proof {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-12) var(--container-px) var(--space-16);
}

.social-proof-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.social-proof-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: var(--space-3) 0;
}

.social-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  max-width: 1080px;
  margin: 0 auto;
}

.testimonial-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.testimonial-card .quote-icon {
  display: block;
  color: var(--ld-blue-200);
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: var(--space-2);
  font-family: Georgia, serif;
}

.testimonial-card blockquote {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: var(--space-4);
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-author-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.testimonial-author-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background-color: var(--bg-gray-900);
  color: #D1D5DB; /* gray-300 — better contrast on dark bg */
  padding-top: var(--space-12);
}

@media (min-width: 1024px) {
  .site-footer {
    padding-top: var(--space-16);
  }
}

.footer-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-8);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

/* Footer brand column */
.footer-brand {
  margin-bottom: var(--space-4);
}

@media (min-width: 1024px) {
  .footer-brand {
    margin-bottom: 0;
  }
}

.footer-brand img {
  height: 40px;
  width: auto;
  margin-bottom: var(--space-4);
  filter: brightness(0) invert(1);
}

.footer-brand > p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #D1D5DB;
  margin-bottom: var(--space-4);
  max-width: 340px;
}

.footer-brand address {
  font-size: 0.875rem;
  color: #D1D5DB;
  line-height: 1.6;
}

.footer-brand address a {
  color: var(--ld-blue-400);
  transition: color var(--transition-fast);
}

.footer-brand address a:hover {
  color: var(--ld-blue-300);
}

/* Footer nav sections */
.site-footer nav h3,
.footer-social h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bg-white);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-4);
}

.site-footer nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.site-footer nav ul a {
  font-size: 0.875rem;
  color: #9CA3AF;
  transition: color var(--transition-fast);
  display: inline-block;
  padding: var(--space-1) 0;
}

.site-footer nav ul a:hover {
  color: var(--bg-white);
}

/* Social links */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--bg-gray-800);
  color: #9CA3AF;
  transition: all var(--transition-fast);
}

.social-links a:hover {
  background-color: #374151;
  color: var(--bg-white);
}

.social-links a svg {
  flex-shrink: 0;
}

/* Footer bottom bar */
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  text-align: center;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-8) var(--container-px);
  border-top: 1px solid #374151;
  margin-top: var(--space-8);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-bottom p {
  font-size: 0.8125rem;
  color: #9CA3AF;
}

.footer-bottom nav {
  display: flex;
  gap: var(--space-4);
}

.footer-bottom nav a {
  font-size: 0.8125rem;
  color: #9CA3AF;
  transition: color var(--transition-fast);
}

.footer-bottom nav a:hover {
  color: #9CA3AF;
}

/* Footer mobile: center everything */
@media (max-width: 767px) {
  .footer-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-brand > p {
    text-align: center;
  }

  .footer-social {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .social-links {
    justify-content: center;
  }
}


/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background-color: var(--bg-gray-900);
  color: #D1D5DB;
  padding: var(--space-5) var(--container-px);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  animation: cookie-slide-up 0.4s ease forwards;
}

@keyframes cookie-slide-up {
  to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner {
    animation: none;
    transform: translateY(0);
  }
}

.cookie-banner__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  max-width: var(--container-max);
  margin: 0 auto;
}

.cookie-banner__text {
  font-size: 0.875rem;
  line-height: 1.5;
  flex: 1;
}

.cookie-banner__text a {
  color: var(--ld-blue-400);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.cookie-banner__text a:hover {
  color: var(--ld-blue-300);
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

.cookie-banner__btn-accept {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--ld-blue-500);
  border-radius: var(--radius-md);
  background-color: var(--ld-blue-500);
  color: var(--bg-white);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.cookie-banner__btn-accept:hover {
  background-color: var(--ld-blue-600);
  border-color: var(--ld-blue-600);
}

.cookie-banner__btn-reject {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  font-family: inherit;
  color: #9CA3AF;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.cookie-banner__btn-reject:hover {
  color: var(--bg-white);
}

@media (max-width: 768px) {
  .cookie-banner__content {
    flex-direction: column;
    text-align: center;
  }

  .cookie-banner__actions {
    width: 100%;
    justify-content: center;
  }
}

@media print {
  .cookie-banner {
    display: none;
  }
}


/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 1024px) {
  /* Job detail: collapse to single column */
  .job-detail-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .job-detail-header {
    grid-column: 1;
    grid-row: auto;
    order: 1;
  }

  .job-detail-sidebar {
    grid-column: 1;
    grid-row: auto;
    position: static;
    order: 2;
  }

  .job-detail-content {
    grid-column: 1;
    grid-row: auto;
    order: 3;
  }

  .job-sidebar-card {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .job-sidebar-card h3 {
    width: 100%;
  }

  .job-sidebar-details {
    flex: 1;
    min-width: 240px;
  }
}

@media (max-width: 768px) {
  /* Related grids */
  .related-positions-grid {
    grid-template-columns: 1fr;
  }

  /* Job benefits grid */
  .job-benefits-grid {
    grid-template-columns: 1fr;
  }

  /* Social proof grid */
  .social-proof-grid {
    grid-template-columns: 1fr;
  }

  /* Application form */
  .form-row--2col {
    grid-template-columns: 1fr;
  }

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

  .form-disclaimer {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .job-detail-header h1 {
    font-size: 1.8rem;
  }

  .application-form {
    padding: var(--space-5);
  }
}


/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children in grids (benefits, related positions) */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 400ms; }

/* Accessibility: disable animations for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal-stagger > .reveal {
    transition-delay: 0ms;
  }
}


/* ============================================
   STICKY MOBILE CTA
   ============================================ */

.mobile-apply-cta {
  display: none;
}

@media (max-width: 1023px) {
  .mobile-apply-cta {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding: var(--space-3) var(--container-px);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  .mobile-apply-cta.is-visible {
    transform: translateY(0);
  }

  .mobile-apply-cta .btn-primary {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 24px;
    font-size: 1rem;
  }

  body.has-mobile-cta {
    padding-bottom: 72px;
  }
}


/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  header[role="banner"],
  .skip-link,
  nav[aria-label="Breadcrumb"],
  .mobile-apply-cta {
    display: none;
  }

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

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .job-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666;
  }
}
