/* ============================================================
   V&V Lab Application — Modern Minimal Design
   ============================================================ */

/* --- Reset & base --- */
.apply-page {
  --accent: #006747;
  --accent-light: #e8f5f0;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e5e7eb;
  --border-focus: #006747;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --accent-sand: #c4a35a;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0 16px 80px;
  -webkit-font-smoothing: antialiased;
}

.apply-page *,
.apply-page *::before,
.apply-page *::after {
  box-sizing: border-box;
}


/* --- Topbar (hidden for now — using sidebar nav) --- */
.apply-topbar {
  display: none;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.apply-topbar__inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}
.apply-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.apply-steps::-webkit-scrollbar { display: none; }
.apply-step {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  transition: all var(--transition);
  cursor: pointer;
}
.apply-step:hover {
  color: var(--text-secondary);
  background: var(--bg);
}
.apply-step.active {
  color: var(--accent);
  background: var(--accent-light);
}
.apply-step.done {
  color: var(--text);
  background: #f3f4f6;
}
.apply-progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.apply-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* --- Hero --- */
.apply-hero {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 0 48px;
  text-align: center;
}
.apply-hero__badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.apply-hero__title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 8px;
  color: var(--text);
}
.apply-hero__sub {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 16px;
  font-weight: 400;
}
.apply-hero__desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- Sections --- */
.apply-section {
  max-width: 800px;
  margin: 0 auto 24px;
  scroll-margin-top: 140px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.apply-section:hover {
  box-shadow: var(--shadow-lg);
}
.apply-section__header {
  padding: 32px 40px 0;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.apply-section__num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.apply-section__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}
.apply-section__hint {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-left: auto;
}
.apply-section__body {
  padding: 28px 40px 36px;
}
.apply-section--final {
  background: transparent;
  border: none;
  text-align: center;
  padding: 24px 0 0;
}
.apply-section--final:hover {
  box-shadow: none;
}

/* --- Grid --- */
.apply-grid {
  display: grid;
  gap: 16px 24px;
  margin-bottom: 16px;
}
.apply-grid--2 { grid-template-columns: 1fr 1fr; }
.apply-grid--3 { grid-template-columns: 1fr 1fr 1fr; }

/* --- Fields --- */
.apply-field {
  display: flex;
  flex-direction: column;
}
.apply-field--cond {
  margin-left: 24px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}
.apply-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.apply-label--lg {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.apply-sublabel {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin: -2px 0 12px;
  line-height: 1.5;
}
.req { color: var(--accent); }
.apply-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* --- Inputs --- */
.apply-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 0.92rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.apply-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(187, 0, 0, 0.08);
}
.apply-input::placeholder { color: var(--text-tertiary); }
.apply-input--sm { max-width: 200px; }
.apply-input--error { border-color: var(--accent); }
select.apply-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* --- Textarea --- */
.apply-textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  font-size: 0.92rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  line-height: 1.6;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.apply-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(187, 0, 0, 0.08);
}
.apply-textarea::placeholder { color: var(--text-tertiary); }
.apply-meta {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-align: right;
  margin-top: 4px;
}

/* --- Role cards (radio) --- */
.apply-role-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.apply-role-card {
  cursor: pointer;
  margin: 0;
}
.apply-role-card input { display: none; }
.apply-role-card__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  text-align: center;
}
.apply-role-card__icon {
  font-size: 1.5rem;
  color: var(--text-tertiary);
  transition: color var(--transition);
}
.apply-role-card__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.apply-role-card input:checked + .apply-role-card__inner {
  border-color: var(--text);
  background: var(--bg);
}
.apply-role-card input:checked + .apply-role-card__inner .apply-role-card__icon { color: var(--text); }
.apply-role-card input:checked + .apply-role-card__inner .apply-role-card__label { color: var(--text); font-weight: 600; }
.apply-role-card__inner:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

/* --- Pill checkboxes/radios --- */
.apply-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.apply-pill {
  cursor: pointer;
  margin: 0;
}
.apply-pill input { display: none; }
.apply-pill span {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  transition: all var(--transition);
  white-space: nowrap;
}
.apply-pill span:hover {
  border-color: #d1d5db;
  background: #f3f4f6;
}
.apply-pill input:checked + span {
  border-color: var(--text);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
}
.apply-pill--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.apply-pill--disabled span { cursor: not-allowed; }

/* --- Toggle (write / upload) --- */
.apply-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.apply-toggle__opt {
  cursor: pointer;
  margin: 0;
}
.apply-toggle__opt input { display: none; }
.apply-toggle__opt span {
  display: block;
  padding: 10px 24px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.apply-toggle__opt input:checked + span {
  background: var(--accent);
  color: #fff;
}

/* --- File upload zones --- */
.apply-upload {
  position: relative;
}
.apply-upload__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.apply-upload__zone {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.apply-upload__zone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.apply-upload__zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.01);
}
.apply-upload__zone.has-file {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-light);
}
.apply-upload__icon {
  font-size: 1.5rem;
  color: var(--text-tertiary);
  width: 48px;
  height: 48px;
  background: var(--card);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.apply-upload__zone.has-file .apply-upload__icon {
  color: var(--accent);
  background: #fff;
}
.apply-upload__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.apply-upload__text strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.apply-upload__text span {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.apply-upload__status {
  font-size: 0.82rem;
  margin-top: 8px;
  display: none;
}
.apply-upload__status.visible {
  display: flex;
  align-items: center;
  gap: 8px;
}
.apply-upload__status .fname {
  color: var(--text);
  font-weight: 500;
}
.apply-upload__status .fsize {
  color: var(--text-tertiary);
}
.apply-upload__status .fremove {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  margin-left: auto;
  background: none;
  border: none;
  font-size: 0.82rem;
  font-family: var(--font);
}

/* --- Skills: autocomplete + star-rated list --- */
.apply-autocomplete-wrap {
  position: relative;
}
.apply-autocomplete-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.apply-autocomplete-list.open { display: block; }
.apply-ac-item {
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}
.apply-ac-item:hover, .apply-ac-item.highlighted {
  background: var(--bg);
}
.apply-ac-item small {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  margin-left: 6px;
}

/* Skill list with star ratings */
.apply-skill-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.apply-skill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeSlideUp 0.2s ease;
}
.apply-skill-row__name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  min-width: 140px;
}
.apply-skill-row__stars {
  display: flex;
  gap: 2px;
}
.apply-skill-row__star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
  color: var(--border);
  transition: color var(--transition);
}
.apply-skill-row__star.filled {
  color: #1a1a1a;
}
.apply-skill-row__star:hover {
  color: var(--text-secondary);
}
.apply-skill-row__remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  transition: color var(--transition);
}
.apply-skill-row__remove:hover { color: var(--accent); }

/* Legend */
.apply-skill-legend {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.68rem;
  color: var(--text-tertiary);
}
.apply-skill-legend i {
  font-size: 0.6rem;
  color: var(--text-tertiary);
}

/* --- Reference cards --- */
.apply-ref-card {
  position: relative;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 16px 56px;
  margin-bottom: 12px;
}
.apply-ref-card__num {
  position: absolute;
  left: 18px;
  top: 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Consent --- */
.apply-consent {
  max-width: 600px;
  margin: 0 auto 32px;
  text-align: left;
}
.apply-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  cursor: pointer;
  margin-bottom: 16px;
}
.apply-check a { color: var(--accent); text-decoration: none; }
.apply-check a:hover { text-decoration: underline; }
.apply-check input { display: none; }
.apply-check__box {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 1px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.apply-check__box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}
.apply-check input:checked + .apply-check__box {
  background: var(--accent);
  border-color: var(--accent);
}
.apply-check input:checked + .apply-check__box::after {
  transform: rotate(45deg) scale(1);
}

/* --- Submit button --- */
.apply-submit {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 48px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 60px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(187, 0, 0, 0.2);
}
.apply-submit:hover {
  background: #a00;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(187, 0, 0, 0.3);
}
.apply-submit:active {
  transform: translateY(0);
}
.apply-submit:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.apply-submit__arrow {
  font-size: 1.2rem;
  transition: transform var(--transition);
}
.apply-submit:hover .apply-submit__arrow {
  transform: translateX(4px);
}

/* --- Start over --- */
.apply-startover {
  margin-top: 24px;
}
.apply-startover__btn {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  transition: color var(--transition);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
}
.apply-startover__btn:hover {
  color: var(--text-secondary);
  text-decoration-color: var(--text-tertiary);
}

/* --- Success --- */
.apply-success {
  max-width: 600px;
  margin: 80px auto;
  text-align: center;
  padding: 48px 24px;
}
.apply-success__icon { margin-bottom: 24px; }
.apply-success__title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}
.apply-success__text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 8px;
}
.apply-success__contact {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 24px;
}
.apply-success__contact a { color: var(--accent); text-decoration: none; }

/* --- Loading overlay --- */
.apply-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.apply-overlay__inner {
  text-align: center;
}
.apply-overlay__inner p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 20px;
}
.apply-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Error messages --- */
.apply-error-msg {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 4px;
}

/* --- Draft banner --- */
.apply-draft-banner {
  max-width: 800px;
  margin: 0 auto 16px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.apply-draft-banner button {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 6px 16px;
  cursor: pointer;
  transition: all var(--transition);
}
.apply-draft-banner .restore {
  background: var(--accent);
  color: #fff;
  border: none;
}
.apply-draft-banner .discard {
  background: transparent;
  color: #6b7280;
  border: 1px solid var(--border);
}

/* --- Submit error --- */
.apply-submit-error {
  max-width: 800px;
  margin: 0 auto 16px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  color: var(--accent);
  font-size: 0.9rem;
}

/* --- Role card subtitle --- */
.apply-role-card__sub {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 400;
}
.apply-role-card input:checked + .apply-role-card__inner .apply-role-card__sub {
  color: var(--text-secondary);
}

/* --- Position message (hidden — shown in right sidebar tip instead) --- */
.apply-position-msg {
  display: none;
}

/* --- Welcome message after name entry --- */
.apply-welcome-msg {
  margin-top: 20px;
  animation: fadeSlideUp 0.4s ease;
}
.apply-welcome-msg p {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
}

/* --- Extra doc row (compact card: type + upload + remove) --- */
.apply-extra-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  animation: fadeSlideUp 0.25s ease;
}
.apply-extra-row__type {
  flex-shrink: 0;
  width: 180px;
}
.apply-extra-row__type .apply-input {
  height: 40px;
  font-size: 0.8rem;
  padding: 0 12px;
  background: var(--card);
}
.apply-extra-row__file {
  flex: 1;
  min-width: 0;
}
.apply-extra-row__file .apply-upload__zone {
  padding: 10px 16px;
  border-width: 1.5px;
  gap: 10px;
}
.apply-extra-row__file .apply-upload__icon {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  border-radius: 6px;
}
.apply-extra-row__file .apply-upload__text strong { font-size: 0.82rem; }
.apply-extra-row__file .apply-upload__text span { font-size: 0.72rem; }
.apply-extra-remove {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 2px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition);
}
.apply-extra-remove:hover {
  color: var(--accent);
}
@media (max-width: 768px) {
  .apply-extra-row {
    flex-wrap: wrap;
  }
  .apply-extra-row__type {
    width: 100%;
  }
}

/* --- Extra doc suggestion chips --- */
.apply-extras-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.apply-extra-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.apply-extra-chip:hover {
  border-color: var(--text-tertiary);
  border-style: solid;
  color: var(--text);
}
.apply-extra-chip i {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* --- Refs toggle button --- */
.apply-refs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
}
.apply-refs-toggle:hover {
  border-color: var(--text-tertiary);
  color: var(--text);
}
.apply-refs-toggle span {
  font-size: 1.1rem;
  line-height: 1;
}

/* Pre-selection hint */
.apply-preselect {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.88rem;
  margin-top: 24px;
  padding: 20px;
}

/* --- Cascade reveal animation --- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.apply-section--reveal {
  animation: fadeSlideUp 0.45s ease both;
}
.apply-section--reveal:nth-child(2) { animation-delay: 0s; }
.apply-section--reveal:nth-child(3) { animation-delay: 0.06s; }
.apply-section--reveal:nth-child(4) { animation-delay: 0.12s; }
.apply-section--reveal:nth-child(5) { animation-delay: 0.18s; }
.apply-section--reveal:nth-child(6) { animation-delay: 0.24s; }
.apply-section--reveal:nth-child(7) { animation-delay: 0.30s; }

/* --- Dynamic fields --- */
.apply-field--dyn {
  overflow: hidden;
}

/* --- Field hint (below degree, etc) --- */
.apply-field-hint {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 500;
}

/* --- Pitch optional badge --- */
.apply-pitch-optional {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

/* --- Left sidebar nav --- */
.apply-sidenav {
  position: fixed;
  top: 70px;
  left: max(16px, calc((100vw - 1300px) / 2));
  width: 180px;
  z-index: 90;
  animation: fadeSlideUp 0.4s ease;
}
.apply-sidenav__head {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.apply-sidenav__logo {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.apply-sidenav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: all var(--transition);
}
.apply-sidenav__link:hover {
  color: var(--text);
  background: var(--bg);
  text-decoration: none;
}
.apply-sidenav__link.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}
.apply-sidenav__link.done {
  color: var(--text);
}
.apply-sidenav__link.done .apply-sidenav__num {
  background: #f3f4f6;
  color: var(--text);
}
.apply-sidenav__num {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-tertiary);
  background: #f3f4f6;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.apply-sidenav__link.active .apply-sidenav__num {
  background: var(--accent-light);
  color: var(--accent);
}
.apply-sidenav__progress {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.apply-sidenav__bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.apply-sidenav__fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Sidebar reset/start-over */
.apply-sidenav__reset {
  display: block;
  margin-top: 12px;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}
.apply-sidenav__reset:hover {
  color: var(--text-secondary);
}

/* --- Right sidebar tips --- */
.apply-sidetips {
  position: fixed;
  top: 70px;
  right: max(16px, calc((100vw - 1300px) / 2));
  width: 240px;
  z-index: 90;
  animation: fadeSlideUp 0.4s ease;
}
.apply-sidetip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  animation: fadeSlideUp 0.3s ease;
}
.apply-sidetip h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.apply-sidetip p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 8px;
}
.apply-sidetip p:last-child { margin-bottom: 0; }
.apply-sidetip__pos-msg {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-style: italic;
}
.apply-sidetip__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.apply-sidetip__links a {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}
.apply-sidetip__links a:hover {
  opacity: 0.7;
}
.apply-sidetip__note {
  margin-top: 12px;
  padding: 12px;
  background: var(--accent-light);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}
.apply-sidetip__note p {
  font-size: 0.75rem;
  color: #7a1a1a;
  margin: 0;
}

/* --- Quality note (inline in docs section) --- */
.apply-quality-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 16px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.apply-quality-note i {
  color: var(--accent);
  font-size: 1rem;
  margin-top: 2px;
  flex-shrink: 0;
}
.apply-quality-note p {
  font-size: 0.8rem;
  color: #7a1a1a;
  line-height: 1.6;
  margin: 0;
}

/* --- Language toggle --- */
.apply-topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.apply-lang {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  flex-shrink: 0;
}
.apply-lang__btn {
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition);
}
.apply-lang__btn:hover { color: var(--text); }
.apply-lang__btn.active {
  background: var(--accent);
  color: #fff;
}

/* --- RTL support --- */
[dir="rtl"] .apply-page {
  font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}
[dir="rtl"] .apply-section__header { flex-direction: row-reverse; }
[dir="rtl"] .apply-field--cond { margin-left: 0; margin-right: 24px; padding-left: 0; padding-right: 16px; border-left: none; border-right: 2px solid var(--border); }
[dir="rtl"] .apply-position-msg { border-left: none; border-right: 3px solid var(--accent); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
[dir="rtl"] .apply-quality-note { border-left: none; border-right: 3px solid var(--accent); }
[dir="rtl"] .apply-sidetip__note { border-left: none; border-right: 3px solid var(--accent); }
[dir="rtl"] select.apply-input { background-position: left 12px center; padding-right: 16px; padding-left: 36px; }
[dir="rtl"] .apply-ref-card { padding-left: 24px; padding-right: 56px; }
[dir="rtl"] .apply-ref-card__num { left: auto; right: 18px; }
[dir="rtl"] .apply-sidenav { left: auto; right: max(16px, calc((100vw - 1300px) / 2)); }
[dir="rtl"] .apply-sidetips { right: auto; left: max(16px, calc((100vw - 1300px) / 2)); }
[dir="rtl"] .apply-submit__arrow { transform: scaleX(-1); }
[dir="rtl"] .apply-submit:hover .apply-submit__arrow { transform: scaleX(-1) translateX(4px); }

/* ============================================================
   Responsive
   ============================================================ */
/* Hide sidebars on medium screens */
@media (max-width: 1400px) {
  .apply-sidetips { display: none !important; }
}
@media (max-width: 1100px) {
  .apply-sidenav { display: none !important; }
}

@media (max-width: 768px) {
  .apply-page { padding: 0 12px 64px; }
  .apply-hero { padding: 40px 0 32px; }
  .apply-hero__title { font-size: 2rem; }
  .apply-hero__desc { font-size: 0.95rem; }

  .apply-section__header { padding: 24px 24px 0; }
  .apply-section__body { padding: 20px 24px 28px; }
  .apply-section__hint { display: none; }

  .apply-grid--2,
  .apply-grid--3 { grid-template-columns: 1fr; }

  .apply-role-grid { grid-template-columns: repeat(3, 1fr); }

  .apply-ref-card { padding-left: 48px; }
  [dir="rtl"] .apply-ref-card { padding-left: 24px; padding-right: 48px; }

  .apply-submit { width: 100%; justify-content: center; }

  .apply-topbar__row { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 480px) {
  .apply-role-grid { grid-template-columns: 1fr 1fr; }
  .apply-hero__title { font-size: 1.6rem; }
  .apply-pill-grid { gap: 6px; }
  .apply-pill span { padding: 6px 14px; font-size: 0.8rem; }
}
