/* ═══════════════════════════════════════════════════════════════════════════
   Apply Job Page
   ═══════════════════════════════════════════════════════════════════════════ */

.apply-wrap {
  padding: 30px 0 60px;
  min-height: 60vh;
  background: var(--gray-50, #f9fafb);
}

/* Layout: form + sidebar */
.apply-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .apply-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Job Info Card ─────────────────────────────────────── */
.apply-job-info {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
  padding: 20px 24px;
}
.apply-job-logo img,
.apply-job-logo .logo-ph {
  width: 56px; height: 56px;
  border-radius: 10px;
  object-fit: cover;
}
.logo-ph--56 {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--purple, #6c47ff);
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  border-radius: 10px;
}
.apply-job-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900, #111827);
  margin: 0 0 4px;
  line-height: 1.3;
}
.apply-job-company {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px;
  color: var(--gray-600, #4b5563);
}

/* ── Form Card ─────────────────────────────────────────── */
.apply-form-card {
  background: var(--white, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
  padding: 28px;
}
.apply-form-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
}
.apply-form-desc {
  font-size: 14px;
  color: var(--gray-500, #6b7280);
  margin: 0 0 24px;
}

/* ── Form Elements ─────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700, #374151);
  margin-bottom: 6px;
}
.form-label .req {
  color: #ef4444;
}
.form-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-900, #111827);
  background: var(--white, #fff);
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--purple, #6c47ff);
  box-shadow: 0 0 0 3px rgba(108, 71, 255, 0.12);
}
.form-input.has-error {
  border-color: #ef4444;
}
.form-textarea {
  resize: vertical;
  min-height: 100px;
}
.form-hint {
  font-size: 12px;
  color: var(--gray-500, #6b7280);
  margin: 0 0 8px;
}
.form-char-count {
  font-size: 12px;
  color: var(--gray-400, #9ca3af);
  text-align: right;
  margin-top: 4px;
}
.form-error {
  font-size: 13px;
  color: #ef4444;
  margin-top: 4px;
  min-height: 0;
}

/* ── Checkbox ──────────────────────────────────────────── */
.form-group--checkbox {
  margin-top: 24px;
}
.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.form-checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  width: 16px; height: 16px;
  accent-color: var(--purple, #6c47ff);
  flex-shrink: 0;
}
.form-checkbox-text {
  font-size: 13px;
  color: var(--gray-600, #4b5563);
  line-height: 1.5;
}
.form-checkbox-text a {
  color: var(--purple, #6c47ff);
  text-decoration: underline;
}

/* ── File Upload ───────────────────────────────────────── */
.file-upload-area {
  position: relative;
  border: 2px dashed var(--gray-300, #d1d5db);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--purple, #6c47ff);
  background: rgba(108, 71, 255, 0.03);
}
.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--gray-400, #9ca3af);
  font-size: 14px;
  pointer-events: none;
}
.file-upload-placeholder svg {
  color: var(--gray-400, #9ca3af);
}

/* File preview list */
.file-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.file-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  font-size: 13px;
}
.file-preview-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--purple, #6c47ff);
  color: #fff;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.file-preview-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-700, #374151);
}
.file-preview-size {
  color: var(--gray-400, #9ca3af);
  font-size: 12px;
  flex-shrink: 0;
}
.file-preview-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 2px;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Submit Button ─────────────────────────────────────── */
.btn-full {
  width: 100%;
  justify-content: center;
}
.btn-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-spinner svg {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Form Message ──────────────────────────────────────── */
.apply-form-message {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.apply-form-message--success {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}
.apply-form-message--error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* ── Sidebar ───────────────────────────────────────────── */
.apply-sidebar .tips-card {
  position: sticky;
  top: 90px;
}
.tips-list {
  margin: 10px 0 0;
  padding: 0 0 0 18px;
  font-size: 13px;
  color: var(--gray-600, #4b5563);
  line-height: 1.8;
}

/* ── Error Card ────────────────────────────────────────── */
.apply-error-card {
  max-width: 460px;
  margin: 60px auto;
  text-align: center;
  background: var(--white, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 14px;
  padding: 48px 32px;
}
.apply-error-icon {
  margin-bottom: 16px;
}
.apply-error-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
}
.apply-error-text {
  font-size: 14px;
  color: var(--gray-500, #6b7280);
  margin: 0 0 24px;
}

/* ── CAPTCHA ───────────────────────────────────────────── */
.cf-turnstile,
.g-recaptcha {
  margin-top: 4px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  .apply-form-card {
    padding: 20px 16px;
  }
  .apply-job-info {
    padding: 16px;
  }
  .apply-job-title {
    font-size: 17px;
  }
  .apply-error-card {
    padding: 32px 20px;
    margin: 30px auto;
  }
}
